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

Installation:

$ sudo apt-get install ffmpeg lame

How to use:
Create a script:

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

Copy this code:

#!/bin/sh
# 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 ” “
infile_name=”$@”
# 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 ” “
exit
fi
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 ” “
exit

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.

Source:
http://ubuntuforums.org/

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

%d bloggers like this: