If you want to extract audio from Flash Video files (FLV format), there are several options available. Unfortunately, many of them make the choice for you – to encode the audio stream into a different format. In some cases, this is not a problem, but if you are trying to keep the audio identical to what is inside the video, you need something that pulls the audio together. FFmpeg, a multimedia toolkit for Linux, Mac, and Windows, can do this with ease.
The example below is for Linux, but after installing it on Windows or Mac, you can run the same command as shown below.
Download and install FFmpeg
Download and install FFmpeg
First you need to download and install FFmpeg Most distributions have FFmpeg in their software repositories, although some support may have been removed for software patent reasons. However, a fairly simple version of FFmpeg will do for our purposes. On Ubuntu, you only need to use the following command in Terminal:
FFmpeg To Easily Extract Audio From FLV FIles” />
This command will also install quite a few additional libraries (along with FFmpeg
Extract audio from FLV files
Extract audio from FLV files
Once installed, using FFmpeg is fairly straightforward if you know which commands to use. There are hundreds of different options, specific syntax for use in different circumstances, and the sheer power and complexity can be a little overwhelming. Luckily for our work, FFmpeg is pretty straightforward.
– /
The first thing we need to do is figure out exactly what codecs are used in our FLV file. To do this, open Terminal (if not already open) and change to the directory where the FLV file is located. In our example, the file is named Bohemian_Rhapsody.flv and is located on the desktop. Thus, the command to enter will be as follows:
FFmpeg To Easily Extract Audio From FLV FIles” />
This moves the terminal program to the same directory (in this case the desktop), so all our commands will be active there. This is important because if you tell a program (for example, FFmpeg
Now that we have used cd to change from directory to desktop, we need to enter the following command:
FFmpeg To Easily Extract Audio From FLV FIles” />
Note. If you are trying to use this with a tutorial, substitute the filename every time you see it used in commands.
The above command is a bit of a hack and you will get errors, but don’t worry. In fact, we told ffmpeg that Bohemian_Rhapsody.flv is the input file. This is what “-i” tells ffmpeg.
When we hit Enter after the command, we don’t tell ffmpeg what to do with the file, so it throws an error. Nothing special. Just ignore it. Because along with the error, it also gives us information about the file. The detail we are interested in will look something like this:
FFmpeg To Easily Extract Audio From FLV FIles” />
The above information tells us the following. In order, it tells us that the stream is encoded with an AAC encoder, that it is 44100 Hz (the correct sample rate for writing to CD), that it is stereo, uses 16-bit samples and has a bit rate. 107 kb / s For extraction purposes, what we’re most interested in is that the file contains AAC audio. Knowing this, all we have to do is enter the following command:
FFmpeg To Easily Extract Audio From FLV FIles” />
Here’s what the different parts of the previous command do:
ffmpeg – runs FFmpeg
-i Bohemian_Rhapsody.flv – gives FFmpeg the name of the input file
-vn – tells FFmpeg to ignore the video track
-acodec copy – copies the audio track (instead of encoding to another format)
Bohemian_Rhapsody.m4a – Output Filename
After entering the previous command, it should only take a second or so, and you should notice a new file named Bohemian_Rhapsody.m4a on your desktop that will contain nothing but the original audio track from the original FLV file. Just open it in your favorite media player and listen to make sure everything is in order.
FFmpeg To Easily Extract Audio From FLV FIles” />
It is so simple. Of course, FFmpeg has many, many other options available. You can re-encode the audio to another format for downloading to your mobile phone, MP3 player or WAV file. You can control the video from the original FLV if you want by changing the bit rate, sample rate and number of channels.
And you might want to know this later, but for now, you know one thing for sure: using FFmpeg to extract audio from an FLV file is simple. Simple and fast.
–