Fast audio format convertion using ffmpeg

FFMPEG is the swiss army knife of Internet Streaming. As written in the homepage “is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter. “

Now, we are going to convert all FLAC files from a specific directory to MP3 256K.  It’s not a good idea from the quality perspective, but, you know, some players don’t support FLAC file.

First step is installing FFMPEG with all required codecs. If you are using a Debian base distro just run the following command:

# sudo apt-get install ffmpeg lame flac

unfortunately, ffmpeg is not part of Ubuntu 14.04 official repositories, so we need to add it before installing it:

# sudo apt-add-repository ppa:jon-severinsson/ffmpeg
# sudo apt-get update

Now from the source directory we can run something like that:

# (for FILE in *.flac ; do ffmpeg -i "$FILE" -f mp3 -ab 256000 "`basename "$FILE" .flac`.mp3" || break; done

this is only an example: ffmpeg can handle a lot of formats. To have a list:

# ffmpeg -formats

I suggest to read the official doc to go in deep

Linux commands in a nutshell

writing down a series of posts about GNU Linux commands.is one of the main purposes of this blog.
In these posts we are going to review some Linux commands with practical examples.This is not a complete but it’s a compact list of commands to refer when needed.These posts are not a linux training or a complete guide: you can use manpages for that (aka RTFM)The goal is share information about GNU Linux commands , improve my knowledge and use this website to cut & paste commands that I’m not able to remember 🙂

Bug fixes, suggestions and feedbacks are welcome as usual !

Posts list:

dmesg using human readable output format