3

How can I get this "something" out of the .ogg file? How can I clear comments/infos like this from the file?

$ strings foo.ogg |grep -i SOMETHING
ARTIST=SOMETHING
$ 

OS: Scientific Linux 6.3

slm
  • 363,520
  • 117
  • 767
  • 871
gasko peter
  • 5,434
  • 22
  • 83
  • 145

2 Answers2

4

You can use the command vorbiscomment to read, modify and delete the metadata on a Ogg Vorbis file. It's part of the vorbis-tools package.

Installation

$ sudo yum install vorbis-tools

reading

You can use the -l switch to list out the tags with their corresponding values like so:

$ 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

Modifying

You can modify the tags by writing them out to a file, editing them and then reapplying them back to the .ogg file. This is shown in method #1. You can get fancy and do it as a one liner as in method #2.

method #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

method #2:

$ vorbiscomment -l antonio_diabelli__rondino.ogg  | \
    sed 's/Various Artists/2LiveCrew/' | \
    vorbiscomment -w antonio_diabelli__rondino.ogg 

after:

$ 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

deleting

To delete everything including the artist tag:

$ vorbiscomment -w -t "artist=" antonio_diabelli__rondino1.ogg

after:

$ vorbiscomment -l antonio_diabelli__rondino.ogg 
artist=

There isn't a way to get rid of the last bit. You have to provide vorbiscomment at least one tag name with no value, otherwise you'll get the following error:

$ echo "" | vorbiscomment -w antonio_diabelli__rondino.ogg 
bad comment: ""
slm
  • 363,520
  • 117
  • 767
  • 871
1
vorbiscomment -w file.ogg  < /dev/null
Anthon
  • 78,313
  • 42
  • 165
  • 222
kermit
  • 21
  • 1