H.264, WebM, F4V, MP4, HTML5 and the f4vpp.exe

For a few years it was simple; Flash Video in the form of a .flv file was the preferred method of streaming to reach the widest possible audience. Then the H264 codec came along, HTML5 became a hot topic and Apple decided not to support Flash Video any more. Oh dear… it all got complicated and confusing again as the string of numbers and letters in the title of this blog confirms. Follow this link if you want to know more on the subject of The State of HTML5 Video.

So now, once again it’s a battle and we have two major competing formats; H264 and Google’s WebM (using the VP8 codec). Why oh why can’t they give these formats more user friendly names? This week WebM, took a major knockback when Mozilla (creators of the Firefox browser) announced support for H.264, which is now looking increasingly victorious in this latest format war.

Okay, so let’s assume that H.264 prevails and becomes the video compression technology of choice. Aside from concerns about H.264 being encumbered by patent royalty payments against the royalty-free WebM format, what does this really mean in practical terms for people like us who stream video both live and on demand?

Well, H.264 uses the MPEG-4 standard and can equal MPEG-2 quality at around half the data rate and across the entire bandwidth spectrum. So that means it’s great quality and efficient to stream to many different types of device using different speed connections. All good news so far, but there is a problem and it’s this; if you are using Flash Media Live Encoder 3.2 to create H.264 files as many webcasters currently do, then the F4V files created are designed to be streamed and will not play locally and cannot be edited!

Don’t despair; there is a sand wedge available to get us out of this particular bunker. Thanks to our CTO Mark Buckland for being a great Caddy and figuring out how to play this shot and making it as simple as possible! (Apologies for the abrupt jump into a golfing analogy, but it seemed to fit.)

First you have to ‘flatten’ the file using something called the f4v post processor. You can download this from the Adobe website as part of the Flash Media Server Tools. It doesn’t take long for a reasonable size file to process, but it is important to follow the following steps;

  1. Place the f4vpp.exe file in the same directory as the file you need to flatten.

  2. Open a command prompt window, by hitting Start and then type RUN in the search window.

  3. In the box that opens up type cmd.exe to open the Command prompt window.

  4. You now you need to Change Directory to the location where your f4v file (and of course the f4vpp.exe file) are located. If it happens to be a folder called ‘c:capture’, then the command you need to type is ‘cdcapture’.

  5. Next you need to enter the command to start the conversion. It must be typed accurately or the conversion will not work. Note that you cannot cut and paste either. The command is f4vpp.exe –i filename.f4v (where filename is the name of the file you wish to convert).

    Hit enter and the program will generate a new file with an ‘-f’ appended to the name, indicating that it has been flattened. This file can now be played locally.

  6. However, your troubles may not be over yet. These are not straightforward files to edit; if you don’t want it to re render itself completely that is. Often there are time pressures precluding this. The simplest and fastest technique we have found in this case is to first of all to change the file extension to mp4, simply by renaming it. The system will warn you that the file may not be usable afterwards but you can ignore this.

  7. Now you can use a program called Xilisoft Video Cutter 2 to mark the start and end points of the video. Note you can mark multiple video clips by hitting the + symbol and marking more clips. When you are ready hit CUT. The system will prompt for a file name and location for the new files and you can select to ‘keep the original format’ if that is what you want. When you are ready click ‘OK’.

    A new file will be created with ‘–cut’ added to the file name. These are true mp4 files and will play on most devices.

I wonder what challenge will be thrown at us next?