如何从.ogg文件中获取此“内容”?如何从文件中清除这样的评论/信息?
$ strings foo.ogg |grep -i SOMETHING
ARTIST=SOMETHING
$
操作系统:Scientific Linux 6.3
您可以使用该命令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
至少提供一个没有值的标签名称,否则会出现以下错误:
$ echo "" | vorbiscomment -w antonio_diabelli__rondino.ogg
bad comment: ""
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句