PDA

View Full Version : ffmpeg: How to extract MP3 audio from FLV video losslessly (demux/extract MP3)


Stream Recorder
04-16-2006, 04:09 AM
How to extract MP3 files from FLV video files with freeware command-line ffmpeg (Windows, Linux, Mac OS X)

First of all find out what type of audio is used in the video file:
ffmpeg -i inputfile.flv
You will get something like
Stream #0.1: Audio: mp3, 44100 Hz, mono, s16, 128 kb/s

Now you know that MP3 audio is used (or AAC, or Speex, or Wav,...), so use the following command:
ffmpeg -i input.flv -vn -acodec copy output.mp3

Stream Recorder
04-16-2006, 04:09 AM
Here is how to extract MP3 from FLV files residing in the directory and all its subdirectories:
find ./ -name '*.flv' -type f -exec ffmpeg -i {} -vn -acodec copy {}.mp3 \;
input.flv.mp3 will be extracted from input.flv
MP3 files will be saved into the same directory.


Shell script for extracting MP3s from FLV files using ffmpeg:

#!/bin/bash
for i in $(find -iname *.flv); do
filename='basename "$i" .flv'
echo "Extracting MP3 from $i"
ffmpeg -i $i -vn -acodec copy "$filename".mp3

Stream Recorder
04-16-2006, 04:09 AM
Replay Media Catcher (http://all-streaming-media.com/record-video-stream/Replay-Media-Catcher-HTTP-RTMP-FLV-MP3-ripper-recorder.htm) (RMC) 4 uses ffmpeg for extracting MP3 audio tracks from FLV files to MP3. If you don't like command line tools, you can use software like RMC 4 instead:

http://img827.imageshack.us/img827/8764/replaymediacatcherextra.jpg

How to convert FLV (with MP3 audio track) to MP3 without losing quality with Replay Media Catcher (RMC) 4 after downloading FLV file automatically:

Open Replay Media Catcher.
Start Recording
Select the "Audio Extraction (Extract MP3 to MP3)" conversion preset
Navigate to a web-site you want to record FLV stream from
HTTP and RTMP .FLV streams will be downloaded/captured automatically. Then MP3 audio tracks will be extracted to .MP3 files automatically.


How to convert any FLV or MP4 file (with MP3 audio track) to MP3 with Replay Media Catcher 4:

Open Replay Media Catcher.
Select the "Audio Extraction (Extract MP3 to MP3)" conversion preset
Go to "Tools" -> "Convert ..."
Select FLV files from which you want to extract MP3 audio tracks
(CTRL key can help to select multiple files) and hit the "Open" button.
MP3 tracks from the selected FLV file(s) will be extracted into .MP3 file(s)