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

About me

Giuseppe La Rosa

IT Specialist

Milan, Italy

Follow me on:


Hi, my name is Giuseppe La Rosa, I’m a System Engineer living in Milan (Italy). I was born in Catania (Italy) in 1978. I started to get interested in the world of computer science at the age of 8 years. I graduated in 2006 with a degree in Information Technology and then I attended a stage at New York University for 3 months in bioinformatics algorithms filed.
After that, I came back to Italy and I worked in several roles as Java Developer and System administrator. Now I am an Operations Business Manager in a big Telco company.
I have a deep passions in several fields related to IT as OS, languages, security, Cloud and much more.


OS: Linux, Unix, HP-UX, Oracle Exadata
Languages : Java (J2SE, J2EE, Servlet), Python, Ruby on Rails, Puppet, Shell scripting
Web languages: JSP, ASP, HTML, CSS, XML+DTD
Tools & other: HP Service Guard, Veritas Cluster, Veritas Volume Manager


RHCA (Red Hat Certified Architect)
Red Hat Certified System Administrator in OpenStack
Platform-as-a-Service: Red Hat OpenShift Enterprise
Red Hat Server Hardening
Red Hat Performance Tuning
RHCVA (Red Hat Certified Virtualization Administrator)
RHCE (Red Hat Certified Engineer)
ITIL V3 Foundation
Ec-Council Certified Ethical Hacker v7


Photo, Ju Jitsu and above all motorbike