December 15th, 2007


Command line to convert ogg to mp3 with tags (using gstreamer)

I recreate this every so often, so I’m going to write this down once and for all:
for ogg in *.ogg; do
 gst-launch-0.10 filesrc location="${ogg}" ! \
   oggdemux ! vorbisdec ! audioconvert ! \
   lame preset=extreme ! xingmux ! id3v2mux ! \
   filesink location="${ogg/.ogg/.mp3}";
 # vbrfix "${ogg/.ogg/.mp3}" "${ogg/.ogg/.new}"
 # mv "${ogg/.ogg/.new}" "${ogg/.ogg/.mp3}"
 # rm -f "${ogg}" vbrfix* 

And, as a bonus, if logjam doesn’t know how to get music from rhythmbox (in Ubuntu 7.10/gutsy), it’s because it’s attempting to execute “rhythmbox --print-playing”, but it should be doing “rhythmbox-client --print-playing”, so set this in LogJam/Preferences/System/Detect Music From/Custom Command and LogJam will start detecting your music.

Edit BTW: there is a limitation of the id3v2mux in that the tags it writes won't necessarily be read by all players/tools. mpg321 seems to deal with them, but not id3v2 and id3tool done.
  • Current Music
    Cake - Perhaps, Perhaps, Perhaps
  • Tags