Using GStreamer to turn VBR to CBR

I’ve been listening to a few episodes of LugRadio and I’ve found them very enjoying so far. What I haven’t enjoyed so much though is my silly MP3 player. The episodes are recorded in variable bit rate (VBR) and my player is utterly pants with handling that–I can’t rely on the timer, I can’t see the total length of a track and I can’t fast forward. Add to this that the bloody thing doesn’t remember its position within a track and it’s obvious just how much pain it’s bringing me at the moment. In a relatively recent episode someone mentioned gnormalize to turn it into a constant bit rate (CBR) MP3. Just too bad that gnormalize isn’t available as a Debian package.

“Why have an entire program written for something that should be simple to do on the commandline using GStreamer?”

Well, here’s the command line that recodes an MP3 (no matter what bit rate it has) to an MP3 with a CBR of 96:

gst-launch-0.8 filesrc location=lugradio.mp3 ! mad \
! lame bitrate=96 ! filesink location=lugradio_cbr.mp3

Now using my player is slightly less painful :-)

Leave a comment