Take the 2-minute tour ×
Sound Design Stack Exchange is a question and answer site for sound engineers, producers, editors, and enthusiasts. It's 100% free, no registration required.

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 avp.stackexchange.com Jan 27 at 15:07

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

1  
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
1  
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
2  
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
2  
Have you tried VLC? –  muntoo Mar 25 '11 at 22:40
show 3 more comments

2 Answers 2

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
add comment

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
2  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.