Australian Technology

Decoding VP8 and H.264 video with JavaScript

Takeaway: A couple of new JavaScript libraries show a different way to route around the codec bickering for online video playback in HTML5.

With playback for video elements in HTML5 moved into the browser itself, we’ve seen the browser makers cast their votes as to which codec would reign supreme. From that mire, H.264 emerged as the victor, with Mozilla saying that for patent reasons, its browser would not support H.264, and Microsoft and Apple saying that they would not code for Ogg support. And it got even messier when Google launched WebM codec, as well.

Thankfully, JavaScript is lurking on the horizon to save users from the tedium of vendor codec politics, with JavaScript decoders appearing for WebM and H.264.

The first is Broadway, a JavaScript H.264 decoder that uses Android’s H.264 decoder compiled to LLVM, and then recompiled via Emscripten to JavaScript, before being optimised with Google’s JavaScript closure compiler. You can view a demo of it here.

The second is a brand new pre-alpha library called Route9.js, which is based on Broadway, and brings WebM decoding to JavaScript in a similar Emscripten manner that Broadway does for H.264. Its demo lives here.

Both of these libraries are prototypes, and the performance currently stinks sans-WebGL acceleration, but nevertheless the work is impressive — coupled with improving JavaScript engines and further improvements in the libraries, having a JavaScript-driven decoding solution appears close.

I had expected Flash to lurk about as a video-playback compatibility layer for some time yet, but these libraries give hope that there will be one less plug-in to worry about for video, and that can only be a good thing for everyone.

Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters.

Chris Duckett

About Chris Duckett

Programmer and journalist Chris Duckett is the Editor for TechRepublic Australia.

Chris Duckett

Chris Duckett
Chris started his journalistic adventure in 2006 as the Editor of Builder AU after originally joining the company as a programmer. He left CBS Interactive in 2010 to follow his deep desire to study the snowdrifts and culinary delights of Canada and returned to CBS in 2011 as the Editor of TechRepublic Australia, determined to meld together his programming and journalistic tendencies once and for all.
1
Comments

Join the conversation!

Follow via:
RSS
Email Alert