How to convert flash video (flv) to mp3 in Ubuntu


$ sudo apt-get install ffmpeg lame

How to use:
Create a script:

$ sudo vim /usr/bin/flv-to-mp3

Copy this code:

# this script should convert files from FLV to WAV and then to MP3
echo ” “
echo ” Welcome to FLV to MP3 converter! version 0.1″
echo ” “
# exit if the user did not enter anything:
if [ -z “$infile_name” ]; then
echo ” “
echo “You did not tell me the file name, so I will exit now.”
echo ” “
echo ” “
ffmpeg -i “$infile_name” -acodec pcm_s16le -ac 2 -ab 128k -vn -y “${infile_name%.flv}.wav”
lame –preset cd “${infile_name%.flv}.wav” “${infile_name%.flv}.mp3”
rm “${infile_name%.flv}.wav”
echo ” “
echo “OK. I’m done! Have fun!”
echo ” “

and make it executable with:

# sudo chmod a+x /usr/bin/flv-to-mp3

Then you’ll be able to run the command:

$ flv-to-mp3 myfile.flv

from any directory to convert a file from FLV to MP3.



Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: