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.
gst-launch filesrc location=file.flac ! flacdec ! audioconvert ! lamemp3enc target=quality quality=2 ! id3v2mux ! filesink location=file.mp3
#
I had to use "flacparse" before "flacdec" for this to work.