Sound Design Stack Exchange is a question and answer site for sound engineers, producers, editors, and enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a free Linux tool that can convert a rather large collection of FLV files into MP3 format. Most of the tools I've tried use ffmpeg under the hood, but they fail to convert many of the files, all passing up the error message from ffmpeg:

[flv @ 0xb7f32388]Unsupported video codec (7)

I've tried importing the FLV files into various other tools (iTunes, Audacity, Pitivi) but none of them work. The odd thing is that the Totem movie player plays them just fine... but it does not feature a way to extract the sound of a movie.

What tools can you recommend?

share|improve this question

migrated from Jan 27 '14 at 15:07

This question came from our site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation.

FLV is a video format. MP3 is an audio format. I assume you want to only use the audio from the FLV? – d-_-b Mar 25 '11 at 3:02
I believe Totem uses the 'gstreamer' media framework. If so, you should be able to mangle a gstreamer pipeline to extract the audio, should you desire. I have never really been that up on gstreamer so I can't give details. – Bill Gribble Mar 25 '11 at 14:01
@sims: Yes, the idea is to extract the audio. It works with ffmpeg on some flv files, but not on all. – user683 Mar 25 '11 at 18:40
Hi Koen, welcome to Audio.SE. Is this question coming from a production or recording context of any sort? The answers on this site will be coming from that perspective. If you're looking to build up a media library or something like that (and I suspect you might be, given that you have a large collection), you might have more luck on one of the other sites (maybe Superuser?). – Warrior Bob Mar 25 '11 at 21:18
Have you tried VLC? – muntoo Mar 25 '11 at 22:40

Although you've already mentioned it, ffmpeg is the canonical (Linux) tool for this. I would recommend invoking ffmpeg directly (from the command line) with something like:

ffmpeg -i [infile].flv -vn -acodec libmp3lame -ab 128k [outfile].mp3

... where

-vn                disable video
-acodec libmp3lame convert audio to mp3 using the lame codec
-ab 128k           set the audio bitrate to 128k

With an up-to-date install of ffmpeg, running:

ffmpeg -formats | grep "FLV"

... should yield a line similar to:

DE flv             FLV format

If you don't see that line, ffmpeg has not been compiled with flv support. If you are running Ubuntu (for example), the following tutorial may help enabling restricted encoders in ffmpeg.

An initial sanity check for problematic files could be to check the file is really a Flash file by running:

file thefile.flv
thefile.flv: Macromedia Flash Video
share|improve this answer
Thanks for the information. It's interesting though, to use the 'file' command as a quick sanity check, and to use the 'formats' option as you do. It does not solve the problem, but it's still interesting ;-) – Koen Van Damme Apr 7 '12 at 16:16

The video may already contain audio in MP3 format. In this case it's better to copy the stream. This avoids re-encoding the audio, which takes time and involves quality loss.

ffmpeg -i [infile].flv -vn -acodec copy [outfile].mp3

... where

-vn                drop the video stream
-acodec copy       copy audio stream directly to output mp3 file
share|improve this answer
You could write a script that calls ffmpeg -i <your flv file> and parses the output to see what format the audio is in - then either copy (as above) or transcode as in the other answer. – Darren Greaves Nov 14 '11 at 15:44
Tried this, did not work. Thanks for the tip though. – Koen Van Damme Apr 7 '12 at 16:17

protected by AJ Henderson Jan 15 '15 at 22:55

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?