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

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: ""
1
vorbiscomment -w file.ogg  < /dev/null
1
  • This is the best for what I needed. Thanks for the idea, it has stood the past of time. – Fabio A. Correa Nov 13 '16 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.