
.oggファイルからこの「モノ」をどのように取得しますか?ファイルからこれらのコメント/情報をどのように消去できますか?
$ strings foo.ogg |grep -i SOMETHING
ARTIST=SOMETHING
$
オペレーティングシステム:サイエンティフィックLinux 6.3
答え1
このコマンドを使用して、vorbiscomment
Ogg Vorbisファイルのメタデータを読み取り、変更、および削除できます。これはパッケージの一部ですvorbis-tools
。
インストールする
$ sudo yum install vorbis-tools
読む
この-l
スイッチを使用して、次のようにタグとその値を一覧表示できます。
$ vorbiscomment -l antonio_diabelli__rondino.ogg
title=Antonio Diabelli / Rondino
artist=Various Artists
genre=Classical
date=1998
album=Growing Minds With Music - Classical Music
tracknumber=07
改訂する
タグをファイルに書き込んで編集し、.oggファイルに再適用してタグを変更できます。これは方法#1に示されています。方法#2のようにセリフで行うことができます。
方法1:
$ vorbiscomment -l antonio_diabelli__rondino.ogg
title=Antonio Diabelli / Rondino
artist=2LiveCrew
genre=Classical
date=1998
album=Growing Minds With Music - Classical Music
tracknumber=07
$ vorbiscomment -l antonio_diabelli__rondino.ogg > comment.txt
...edit the file...
$ vorbiscomment -w -c $ vorbiscomment -l antonio_diabelli__rondino.ogg
title=Antonio Diabelli / Rondino
artist=2LiveCrew
genre=Classical
date=1998
album=Growing Minds With Music - Classical Music
tracknumber=07comment.txt antonio_diabelli__rondino.ogg
方法#2:
$ vorbiscomment -l antonio_diabelli__rondino.ogg | \
sed 's/Various Artists/2LiveCrew/' | \
vorbiscomment -w antonio_diabelli__rondino.ogg
後ろに:
$ vorbiscomment -l antonio_diabelli__rondino.ogg
title=Antonio Diabelli / Rondino
artist=2LiveCrew
genre=Classical
date=1998
album=Growing Minds With Music - Classical Music
tracknumber=07
削除
アーティストタグを含むすべてのアイテムを削除するには:
$ vorbiscomment -w -t "artist=" antonio_diabelli__rondino1.ogg
後ろに:
$ vorbiscomment -l antonio_diabelli__rondino.ogg
artist=
最後のポイントを見回す方法はありません。vorbiscomment
値なしで少なくとも1つのタグ名を指定する必要があります。それ以外の場合は、次のエラーが発生します。
$ echo "" | vorbiscomment -w antonio_diabelli__rondino.ogg
bad comment: ""
答え2
vorbiscomment -w file.ogg < /dev/null