Monday, April 18, 2011

HTML5 Video... what??

Over these few years, there has been quick changes and movements in web video. With Apple's decision to block Flash out of the i-devices at all costs, which is consistent with their draconian control over their device, many websites have starting to provide video delivered using html5. So what is the difference?

First, we have to start with how video formats work. In the simplest form, a video file contains a video and an audio track. The video track is encoded in a codec such as H.264, Xvid, MPEG-2, etc. The audio track is usually encoded in MP3, Ogg-vorbis, or AC3. Then, the video and the audio is combined into a container format such as avi, mov, mkv, or flv. As a result, just because a.mov and b.mov are both mov files, it doesn't mean your media player will play it, since they can have radically different codecs.

In the 1990s, web video was in a horrendous mess with various bloated and CPU-hogging video players such as Windows Media Player and Real Player. Every time a video is embedded in a webpage, some users are bound to not have the player and not able to view it. Other users will experience lag and even crashing of browsers because the players were horrible and the computers were slow. Flash came to rescue in the end. When flash started to dominate the web with the highest install base, using Flash to deliver web video becomes a much more reliable way. Not only is it faster than the horrible alternatives, almost every single user is guaranteed to have it.

Flash video is delivered in a container format, flv. It gradually adopted newer and more efficient codecs such as H.264 as time went on and adoption spread. Eventually, most video becomes encoded H.264 and most players are able to play them well. Even graphics hardware are optimized to decode H.264 so that low power devices such as phones can play video as well.

However, flash has its own problems. The plugin itself was not exactly the most efficient piece of software even though it was much better than the alternatives. On certain computers, the plugin creates lag and causes browsers to crash. Linux platforms were not supported very well. As well, Apple claims that flash does not play well with mobile devices, and that is true to a certain extent. Of course the real reason Apple blocks Flash is so that developers can't bypass the AppStore (and develop apps on the highly versatile Flash platform that is free from Apple bureaucracy and lock-down) and are forced to let Apple have a cut in app sales and in-app purchases. Lastly, many people feel that letting a single company (Macromedia, now Adobe) control the whole web video business is scary.

HTML5 was developed with many new features. One of them was the ability to embed video directly. The video would be played by the browser directly without jumping through the hoop that is flash. However, there was a problem. Firefox refuses to play H.264 encoded videos because the browser is open source and the non-profit Mozilla organization cannot afford the possibility of having to pay a license to MPEG-LA in the future (or face lawsuit) for including it. Similarly, Google has its own plans to dominate the web video space; Google's Chrome browser, which is gaining market share fast, only plays Google's new codec Web-M, meant as a competitor to H.264, and is completely new and not a recognized standard at all.

The bottom line is that HTML 5 video is encumbered with the problem that there is no single codec that every major browser plays. When you encode a video in any codec, and then embed it on a web page using html5, there is bound to be a major browser, be it Firefox, Chrome, or Internet Explorer, that refuses to play it. Until the major players such as Microsoft, Apple, Google, and Mozilla sort out this issue and come up with something that plays in every browser (or if MPEG-LA releases H.264 to be free forever), html5 video is definitely not ready for production. In the mean time, flash is the only solution.

No comments:

Post a Comment