Please feel free to email me with any questions at with "blog" as the subject.

Search my blog:

Loading...

Thursday, 2 September 2010

Convert Flv to mp3 using FFmpeg

I have seen a lot of threads on various forums where people ask how they can convert flash videos, downloaded from the Internet, to mp3.

It is quite simple to do and there are many GUI tools for it. However if you want to do it in a script, or simply prefer to use the command line like me, then to following works quite well.

If you have ffmpeg and all the common codecs installed then use the following:

bash$ ffmpeg -i input.flv -ac 2 -ar 44100 -ab 320 output.mp3

obviously replacing input.flv and output.mp3 with your filenames.

If you don't have ffmpeg or any codecs installed then install them. Instructions are availible in the wiki for your distro.


I recommend you read your distro's wiki before installing codecs as there are legal issues in some countries.

Ubuntu = (You may need to enable the medibuntu repository: https://help.ubuntu.com/community/Medibuntu )

then use: bash$ sudo apt-get install ubuntu-restricted-extras ffmpeg

Arch = bash$ pacman -S gstreamer0.10-{base,good,bad,ugly}-plugins gstreamer0.10-ffmpeg ffmpeg