Convert flac files to mp3 using libmp3lame in ffmpeg

ffmpegX

So if your like me, and have a few cd’s backed up on your machine, and want to carry it around, or let’s say, to have them on your workplace machine with limited storage, but  still want to keep a quite good level of quality you’ll need it to convert to any other format. Mine being, mp3. So How to achieve this?

I googled around and found out a way to, using lame wich imho, is the best way to convert any given cd or flac file to mp3. But, to my knowledge i couldn’t encode flac files directly fr some weird reason, so another search gave me the possibility to use good old ffmpeg.

1) So having everything installed, open your favorite editor and copy these lines:

for f in *.flac
do
ffmpeg -i "$f" -acodec libmp3lame -ab 320k "${f%.flac}.mp3"
done

2) Save it as an .sh file i.e.: lame.sh

3) Copy the file to the desired folder containing the .flac files and type:

$ sh lame.sh

You’ll see that every file with flac extension is converted to mp3 whilst keeping all it’s info, with a 320kbs bitrate. 🙂

NOTE: i couldnt find afterwards the original topic @ubuntuforums.org, but kudos to whover wrote it. All credits to him/her.

Advertisements
Convert flac files to mp3 using libmp3lame in ffmpeg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s