Is there an application that allows me to extract the audio from a MP4 or FLV video file and store it as an MP3 file for use in a portable media player?
11 Answers
You can do the same in 12.04 by using several software.
Using WinFF
Install winff and libavcodec-extra first
sudo apt-get install winff libavcodec-extraOpen Winff from dash

Then in Winff window, do these
Add file
Select what catagory to convert (select Audio)
Select Audio file format (mp3)
Type the output folder for converted file

- Then click the Convert button. You can also click Options button to file tune the audio format and other options.


Using VLC
Install VLC and "libavcodec-extra" package first
sudo apt-get install vlc libavcodec-extraOpen VLC from dash by pressing
Superkey and typing "VLC" there
Then from top panel menu, Select Media → Convert/Save.
Then Add file to convert in the new window. Then click Convert button.

In the new window, Select the directory for output file, select the conversion profile (Audio mp3) and click Start button.

Using command line
First install the tools
sudo apt-get install ffmpeg libavcodec-extra libav-toolsIf you are using
Use this simple command to extract the audio file
avconv -i /input-file-name-with-path output-filename.mp3For example to convert the "How fast.ogg" video file into
how-fast.mp3use this command:avconv -i /usr/share/example-content/Ubuntu_Free_Culture_Showcase/How\ fast.ogg how-fast.mp3See the manual page for more options and information.
To Just extract audio
Check these answer
you can do it using ffmpeg. Install ffmpeg using following command:
sudo apt-get install ffmpeg libavcodec-unstripped-52
The package libavcodec-unstripped-52 is available in Multiverse repo, so you will need to enable it.
After installing these packages, you can use a command like the one below to extract the audio as mp3:
ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3
The -i option in the above command is simple: it is the path to the input file. The second option -f mp3 tells ffmpeg that the ouput is in mp3 format. The third option i.e -ab 192000 tells ffmpeg that we want the output to be encoded at 192Kbps and -vn tells ffmpeg that we dont want video. The last param is the name of the output file.
- 13,194
It is very easy to do with WinFF (install it), which is a GUI for ffmpeg.
- Click add.
- Select a video file
- In Convert to, select Audio
- Select an audio codec
- Click Convert. (Notice that the Convert button might sometimes disappear if the window is too small. Make the window larger if you don't see it)
Done. Screenshot:

- 29,687
Audacity can also open a flv file and export it as mp3, flac and other formats


My favorite way is to use gnome-terminal -e "avconv -i %f %f.mp3" in Thunar custom actions. Even better, to get a constant bitrate of 192 kbps:
avconv -i %f -c:a libmp3lame -ac 2 -b:a 190k %f.mp3
In fact the audio in a flv (and mp4) file is in aac format. To stay as close as possible to the quality of the original sound, consider using the aac in an m4a container. If the mp3 format is a must, consider the initial bitrate of the aac file when converting to mp3. More here.
soundconverter
is another tool that can convert audio formats and also video to audio only.
It can be installed in the Software Center (by clicking the above link) or by running these commands in a Terminal (Ctrl+Alt+T):
sudo apt-get update
sudo apt-get install soundconverter
You can achieve this with a simple command:
ffmpeg -i yourVideoInput.mp4 theAudioOutput.mp3
- 1,865
You can convert your media files using VLC player. Load a media file => to convert: Menubar > Media > Convert/Save.
- 356
mkvtoolnix is a good package, it can extract by tracks, chapters or specific timings at the same time.
mkvmerge -i <input_video>
Track ID 0: video (MPEG-4p10/AVC/h.264)
Track ID 1: audio (AC-3/E-AC-3)
Track ID 2: audio (AC-3/E-AC-3)
You want to extract TrackID 2 by each chapters (assume the long video)
mkvmerge -o <output_audio> --audio-tracks 2 --no-video --split chapters:all <input_video>
You get numbered files, output_audio001, output_audio002...
Then convert each audio file to mp3
- 1,519
Transmageddon
You can also use Transmagedon Video Converter to convert video file to sound file.
Or in trminal:
sudo apt-get install transmageddon
To convert to MP4, you have to select in Choose Video Codec as No Video.
Can convert to .ogg by selecting the Presets as Ogg.

I used VLC media player to convert a .flv file to a .mp4/mp3 file. Audacity failed at even loading the complete file. It could load only the first 8 seconds and I could export the audio. But, VLC was the fastest! Let every other piece of software be!
- 13
