HTML5 Vs. Flash: The Video Benchmark Deathmatch

With the release of the iPad, among other things, HTML5's been pitted against Flash as the saviour of web video. It might be! (Or not!) Either way, a crucial arguing point is that it's more efficient. So, uh, is it?

Jan Ozer at Streaming Learning Centre decided to run some tests - simple tests - comparing CPU utilisation for HTML5-embedded and Flash-embedded h.264 videos, in different browsers, and across Windows and OS X. Spoiler: It didn't go so well for anyone involved.

So, this whole test is just a mess of incompatibilities. For HTML5, they're obvious: a lot of browsers just don't have h.264 decoding support, so they can't decode the HTML5 video at all. For Flash, the incompatibilities are more subtle: On Mac, Flash 10.1 doesn't support hardware video acceleration, whereas on PC, it does. In the cases where Flash video is actually more efficient than HTML5, the reason is that it's accelerated by the PC's graphics hardware.

To make it all worse, neither set of incompatibilities will be resolved soon. Adobe claims that Apple's reluctance to give them access to relevant APIs in OS X has made it impossible to implement hardware acceleration, which is why videos require so much less CPU power in Windows than on OS X. And for what it's worth, this is a defensible philosophical choice. Says Gruber:

The Apple way to play H.264 is through the QuickTime APIs (and really, as of Snow Leopard the new QuickTime X APIs), not to write your own H.264 playback code that seeks to directly access hardware accelerators.

Apple could make Flash better on Mac, but it would be a break in tradition, and judging by Steve Jobs apparently disdain for Flash in general, Adobe shouldn't expect any extra help to come from Cupertino.

And as for the terrible browser compatibility problems, these are just as insidious, and much less calculable. Mozilla says they'll never support h.264 video, and even if Microsoft decided to in Internet Explorer 9, for example, the vast masses of people who still use older versions of IE - including IE6, which is still one of the most popular browsers on the internet, despite being originally released in 2001 - will never support it. (See our Giz Explains on the subject for more.) And so there's that!

The moral of the story, weirdly enough, is that we should frame this whole issue in terms of video performance. Flash is widely used for ads and other dynamic content as well - both of which could theoretically be replaced by some combination of HTML5 and JavaScript, but which face the same browser compatibility issues as HTML5 video. In theory, HTML5 video sounds like it ought to be more efficient than plugin-based Flash, but right now, minor differences in CPU utilisation? That's the least of our worries. [Jan Ozer via ReadWriteWeb]