marți, 13 septembrie 2011

Remux a FLV to a MP4?

So you've just ripped a 600 MiB video from your favorite web site and you'd like to change the FLV file into a MP4? Here's how to do it in Windows (tested on Win7 x64, will be same for others) for the most common stream types in an FLV file, h264 video with AAC audio.

Here's the best way to do it that I have found, using FREE open-source tools.
Sometimes Open Source truly is better than commercial wares.


Both FLV and MP4 are containers or "boxes". These boxes hold the video and audio streams. Both types are capable of holding the same types of streams. So all we're going to do is extract the video and audio streams from the FLV and then put them into the new box, Mp4. This is commonly known are re-muxing or re-multiplexing.

We're not going to have to re-encode either the video or audio parts since there is no need to do that. The resulting MP4 will be almost exactly the same size as the original FLV and they will sound and look EXACTLY the same, since each box has the same contents. wink

Step 1 - Download a couple of tools

>> Download FLVExtract @ http://www.afterdawn.com/softwar…xtract.cfm (it's a whopping 80 kiB)

>> Download YAMB @ http://www.afterdawn.com/softwar…o/yamb.cfm (6.8 MiB)

Extract both of these into folders which you can easily remember such as "...desktop\videotools\FLV2MP4\" (or something like that - no further install required).

Step 2 - Remove the Audio and Video streams from the original FLV container (or box)

>> Run FLVExtract
> A box will appear on the screen. Make sure that the boxes for Extract Audio and Video are checked.
> Drag and drop your FLV file onto this little window.

[Marked A in the picture below]
http://i1235.photobucket.com/albums/ff428/Mikeb711/FLV2MP4_01.jpg

> The audio and video streams will be extracted to the same directory as the original FLV file (will take about 30 seconds for 600 MB)
> When extraction is done a confirmation will show the true fps of the FLV video, mark this down.
> Close FLVExtract

[Marked B in pic below, note the new files also]
http://i1235.photobucket.com/albums/ff428/Mikeb711/FLV2MP4_01a.jpg


Step 3 - Put the Audio and Video Streams into a brand new shiny MP4 Box

>> Run YAMB
> Double-Click on "Click to create and MP4 file with multiple audio, video...."

[Marked C in the pic below]
http://i1235.photobucket.com/albums/ff428/Mikeb711/FLV2MP4_02.jpg

> Click Add and then select the Video Stream created in Step 2 (it will be a .264 file)
> Click on Properties and double-check the the frame rate listed matches that which you wrote down in step 2.
> Click Add a second time and select the Audio Stream created in step 2 (.AAC file)
> Click next. This will create an MP4 file with the video and audio streams which were extracted in step 2.

http://i1235.photobucket.com/albums/ff428/Mikeb711/FLV2MP4_02a.jpg

Locate and play your brand new MP4 file and make sure that the audio stays in sync. If it does not you may need to adjust the fps rate in YAMB but in my experience 99 out of 100 times it will be perfect.

That's it! Please do not hesitate to ask any questions if you get stuck, have problems or have spotted an error in this.

Of course there are other ways to do the same thing but this method has proven really bulletproof for me and it is quick. Re-encoding the file using a commercial video "converter" will take a lot longer and you can easily lose quality and/or end up with a much larger file if you're not sure about what you are doing.

Credit goes to Mikeb71

Niciun comentariu:

Trimiteți un comentariu