Converting Audio to MP3 with GStreamer

December 18, 2010 by
Filed under: command line, HowTo, lame, linux, Ubuntu 

My last post was about converting audio files in Linux with GStreamer. In that post I showed how to convert FLAC files to Ogg Vorbis files and retain the audio tags. You may however, have an audio player that does not support playing Ogg Vorbis audio files and you want to convert your files to MP3 instead.

The following commands will work as long as you have the appropriate GStreamer plugins installed along with the LAME package.

This command will encode to MP3 using LAME's defaults.

gst-launch filesrc location=file.flac ! flacdec ! audioconvert ! lamemp3enc ! id3v2mux ! filesink location=file.mp3

If you want to encode your files with VBR at a higher quality level, you can do something like this.

Affiliate Link
gst-launch filesrc location=file.flac ! flacdec ! audioconvert ! lamemp3enc target=quality quality=2 ! id3v2mux ! filesink location=file.mp3


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>