You're viewing a single post. I have much more to say! The main blog page is a good starting point.

Converting Flac to Ogg Vorbis

Some of my digital music is in the lossless Flac format, which is way too large to carry around on my laptop. I use the following GStreamer magic to convert the Flac files (other types work too with this pipeline) to high quality Ogg Vorbis files:

for file in *.flac; do gst-launch-0.10 filesrc location="$file" ! decodebin ! audioconvert ! vorbisenc quality=0.8 ! oggmux ! filesink location="$file.ogg"; done;
rename 's/.flac.ogg/.ogg/' *.flac.ogg

I’m just blogging this because otherwise I’ll forget how to do this when I need it again…

Update: Yes, I know that oggenc -q8 *.ogg does basically the same, but oggenc won’t preserve ID3v2 tags on Flac files (people do this, don’t ask me why), while the GStreamer pipeline seems to preserve the metadata just fine.