FLV to AVI Conversion Guide

Original Page URL: http://www.digital-digest.com/articles/FLV_to_AVI_Conversion_Guide_page1.html
Author/Publisher:
Date Added: Oct 20, 2006
Date Updated: Oct 20, 2006


Flash Video (FLV) files are becoming more common due to sites like YouTube and Google Video. While there are dedicated players for FLV files and some multimedia players like Media Player Classic already has built in support for this video format, converting FLV to AVI is still sometimes preferable as AVI support in software and hardware is much more common. This guide shows you how to convert FLV video to AVI.

Our YouTube, Google Video Download and DivX Conversion Guide already covers how to download the FLV file from embedded video and also how to convert the FLV file to AVI using Dr. DivX. This guide does not cover the FLV download part and uses a slightly more complicated method for FLV to AVI conversion, but it is much more flexible and allows conversion to XviD and any other AVI format. As such, this guide is aimed at people that are at the very least familiar with the concept of (single and double pass) video encoding using VirtualDubMod, and if you are not, please refer to the YouTube, Google Video Download and DivX Conversion Guide instead.

Software you'll need:

Step 1: Using FLV Extract

This step will use FLV Extract to separate out (demultiplex) the video and audio components in the FLV file.

.NET Framework 2.0:

The first thing you need to do before you can run FLV Extract is to download and install Microsoft's .NET Framework version 2.0. It's a fairly large file and installation could take more than half an hour. Once you have it fully installed, you can now go on and download FLV Extract.

Start FLV Extract.

FLV Extract


Drag your FLV file into FLV Extract where indicated, and it will extract out the video as an AVI file and the audio is saved to a MP3 file. When the processing is completed, a confirmation dialog will pop up detailing the frame rate of the extracted video.

FLV Extract: Done


In the same directory as your original FLV file, there should now now an AVI file and an MP3 file (of the same filename as the original).

FLV, AVI, MP3


You can now close FLV Extract.



Step 2: Configuring ffdshow

We must now configure ffdshow so that VirtualDubMod (and any AVI supporting software) will be able to open up the AVI file produced by FLV Extract (which uses the FLV1/FLV4 codec).

Download ffdshow and start the installation. Click "Next" until you get to the "Select Components" screen, and make sure you select the "VFW interface" option. Press "Next" to continue.

ffdshow Install: Select Components


When you reach the "Select Additional Tasks" screen, it will now allow you to select which codecs ffdshow will decode for you (if you already have ffdshow installed, the current selected decoders will be shown). Although the settings here won't actually affect the VFW codec configuration needed for VirtualDubMod, it might be worth selecting the "FLV1", "VP5/VP6" settings for video and "MP3" for audio, which will then allow playback of the extracted AVI file in multimedia players like Media Player Classic or Windows Media Player. In any case, there will be a chance to change these settings after the installation.

ffdshow Install: Select Codecs


Press "Next" and then "Install" to start the installation. Once it is done, the follow screen will appear. Select the options as shown below (run video and VFW decoder configuration) and press "Finish" to complete the install.

ffdshow Install: Finish


The "ffdshow video decoder configuration" and "ffdshow video encoder configuration" windows should now have opened up (check the titles of the windows to tell which is which). In the "ffdshow video decoder configuration" program, select "Codecs" on the left hand side, make sure the "libavcodec" option is selected for both "VP6F" and "FLV1" as shown below and then press "Apply" and then "OK" to close this window. This should now allow you to playback the extracted AVI file in most multimedia/Directshow players.

ffdshow video decoder configuration: VP6F


ffdshow video decoder configuration: FLV1


In the "ffdshow video encoder configuration" window, click on the "Decoder" tab and select "Codecs" on the left hand side.

ffdshow video encoder configuration: Codecs


Again, make sure the "libavcodec" option is selected for both "VP6F" and "FLV1", press "Apply" and then "OK" to close this window. This should now allow you open the extracted AVI file in VirtualDubMod.



Step 3: Using VirtualDubMod

In this step, we'll use VirtualDubMod to join the AVI and MP3 file into a single AVI file, and also optionally, convert the video to DivX or XviD format from the current FLV1/FLV4 format.

If you plan on re-encoding the video to DivX/XviD, first make sure you have the DivX codec or the XviD codec installed. Both come with installers, so installation should be easy.

Download VirtualDubMod and extract the contents of the ZIP file to a folder (eg. C:\Program Files\VirtualDubMod\) and start VirtualDubMod.

Open the extracted AVI file using VirtualDubMod (File -> "Open video file"). From the "Streams" menu, select "Stream list".

VirtualDubMod: Streamlist


In the "Available streams" window, use the "Add" button to load in the extracted MP3 file. You might get an warning dialog about VBR MP3 files, press "No".

VirtualDubMod: VBR MP3 Warning


The MP3 audio file should now be loaded into the "Available streams" window as track 1. Right click on the track and make sure "Direct stream copy" is selected, and then select "Interleaving".

VirtualDubMod: Stream Options


The "Audio/Video Interleave Options" window will now open. Uncheck the "Enable audio/video interleaving" option, keep "Audio skew correction" set at 0ms. Uncheck both "Offset audio to maintain a/v sync" and "Cut off audio when video stream ends". Press "OK" to close this window and then "OK" again to close the "Available streams" window.

VirtualDubMod: Audio Interleaving


Now, there are two ways to continue on. One is to re-encode the video to DivX/XviD for maximum compatibility. The other is to keep the current FLV1/FLV4 video compression and just mux (join) the video/audio so that the AVI file is playable with sound - this approach will work on your system because you've set up ffdshow to decode FLV1/FLV4 in the previous step, but it will not work on a computer where this isn't setup (most computers). If you want to re-encode to DivX/XviD, skip to the instructions in the boxed section below, otherwise continue on with the next step.

As we are not re-encoding with DivX/XviD, we'll need to set the video encoding option to "Direct Stream Copy".

VirtualDubMod: Video Direct Stream Copy


From the "File" menu, select "Save As" and save the video to a new file (very important to create a new file, not overwrite the original AVI file). Make sure the "Don't run this job now..." option is unchecked. Press "Save" to save the AVI file. After a few seconds, the new AVI file is created and this should be playable (test it). If it all works, then we're done and you can now delete the FLV and the extracted AVI/MP3 files. This guide is now finished, and you don't need to continue with the instructions in the boxed section below as that's for re-encoding the video.

VirtualDubMod: Save



Re-encoding with DivX/XviD:

From the "Video" menu, select "Full processing mode" and then "Compression".

VirtualDubMod: Audio Video Options


Select either the "DivX 6.x.x Codec" or "XviD MPEG-4 Codec" and press "Configure" to set up the codec. This guide won't go into each and every DivX/XviD setting, instead you can find full explanations of each setting in our DivX 6.x Setup Guide and the XviD Setup Guide.

VirtualDubMod: Video Compression


If you are using a multi-pass encoding mode, skip to the "Multi-pass encoding" section below. If you have selected to use a single pass encoding mode in DivX/XviD, you can now press "OK" to close the video compression window. From the "File" menu, select "Save As" and save the video to a new file (very important to create a new file, not overwrite the original AVI file). Make sure the "Don't run this job now..." option is unchecked. Press "Save" to save the AVI file. The re-encoding will now start and after a short while, the new DivX/XviD AVI file is created. Test the newly created file, and if it all works, then we're done and you can now delete the FLV and the extracted AVI/MP3 files. This guide is now finished, and you don't need to continue with the instructions below for multi-pass encoding only.

VirtualDubMod: Save



Multi-pass encoding:

What will happen now is that we'll use VirtualDubMod's job control system to create a job for the first pass, and then create jobs for the other passes, and then run the jobs to get the encoding done.

Still within the video compression window, configure the codec for the first pass now and press "OK" to close the video compression window. From the "File" menu, select "Save As" and choose to save to a new file (don't overwrite the original) and I'd like to add "1stpass" to the end of the filename to make it clear that this is AVI produced from the first pass. Make sure the "Don't run this job now..." option is checked. Press "Save" to add the current job to the job control queue.

VirtualDubMod: Save 1st Pass



Go back to Video -> Compression and configure the codec for the next pass. Once that is done, go to File -> Save As again and as before, choose a new filename (eg. "bsg_season3_2ndpass.avi") and make sure the "Don't run this job now..." option is checked. Press "Save" to save the next pass. Continue with this for as many passes as you wish (3 passes is usually more than enough).

When you're read to start the encoding, from the "File" menu, select "Job control" to launch the job control window. Here, all the passes you've setup should be listed in the correct order.

VirtualDubMod: Job control



Press the "Start" button and encoding will start. When all the jobs have been listed as completed, the encoding process is done. The last AVI file produced (eg. "bsg_season3_2ndpass.avi" from the screenshot above) is the one you want, and you can delete all the other files. And we're done!



About Digital Digest | Help | Privacy | Submissions | Sitemap

© Copyright 1999-2011 Digital Digest. Duplication of links or content is strictly prohibited.