
You may or may not have heard about the disagreement over HTML 5′s video codec support. Let’s ignore the patent arguments completely, and the licensing fees (which I’m sympathetic to) — I’m not a lawyer, so I can’t bring anything useful to the table.
Basically, the choice is between H.264 and Ogg/Theora, and both Google and Apple think Theora sucks — for hardware support, and in general. (By the way, I’ll apologise now for my inconsistent references to Ogg and Theora; for reference, Ogg is the umbrella project, Theora is the video codec, and Vorbis is the audio codec.)
Let’s examine video quality. Noses were put out of joint by this comment from a Google guy:
If yt were to switch to theora and maintain even a semblance of the current youtube quality it would take up most available bandwidth across the internet.
Clearly, that’s hyperbole. Equally clearly, he doesn’t think much of Theora’s video quality. (Bear in mind, this is coming from the side that’s shipping support for both H.264 and Theora in Chrome; he has fewer reasons for bias than, say, an Apple guy who has some investment in H.264′s success.) This prompted a comparison from Greg Maxwell at Xiph, the people behind Ogg. I’ll summarise my criticisms of that comparison in Handy List Format:
- Only the first pictures compare H.264 and Theora. The second set compare H.263, the legacy YouTube codec, and Theora, which is not even slightly relevant to HTML 5 (and only relevant to the quotation above if we’re being slightly pedantic).
- YouTube’s H.264 files aren’t anywhere near the best quality that H.264 can deliver. They’re designed for mobile playback, and as such are designed to be playable by common, low-cost mobile hardware. Files designed for desktop playback — even GPU-accelerated playback — can have much more complex features enabled, and deliver vastly better quality at the same file size. The Ogg files, to my knowledge, are the best that the codec can deliver, without regard for the power of the hardware needed to play it back.
- Even this H.264 file clearly clearly beats Theora. Note especially the grainy banding around the water lilies, which is often indicative of a codec that’s struggling slightly at the specified bitrate.
- The Theora files were encoded by an expert, but the H.264 files were encoded with catch-all settings by an automated process. Anyone vaguely serious about video will tell you that different clips need different treatment, and a human who knows what he’s doing will totally outclass a machine which applies the same settings to every clip.
- H.264 is famously useful at all kinds of bitrates and resolutions. Most codecs are only suitable for a limited range of values, so even if H.264 can be outclassed under specific circumstances (and, again, I see no evidence here that Theora’s going to do that), it wins for its versatility.
So, you’ll gather I’m not a giant fan of Ogg either. From my lengthy use of H.264, my (admittedly limited) exposure to Theora, and considering the opinions of those I trust, I can’t convince myself that Ogg is anything other than inferior. This is not to say that it’s irrelevant, or unimpressive; just less desirable in this context.
The lack of hardware support, though, is inescapable. Lots of video cards have H.264 decoding capabilities, which allow the playback of compatible video without stressing the computer. This is a Good Thing™. There aren’t any such decoder chips for Theora (or if there are, they’re extremely rare), which means decoding would have to be done on the CPU. While that’s generally fine for desktops (if inefficient, even a possible problem for HD video), it completely rules out mobile devices; iPods, iPhones et al rely on hardware decoding to play back video, as their CPUs are about an order of magnitude too weak. So, this alone is probably a deal-killer for anyone interested in mobile video… as both Google and Apple are.
Think of the situation with Flash video. That is largely CPU-grunt-based, and runs bearably on the desktop. When it comes to mobiles, it’s like running through treacle, and really not a viable option. Apple and Google even went to the trouble of creating an H.264-based alternative — which can utilise hardware acceleration — to YouTube for the iPhone. We’ve got essentially the same choice here: either go with Ogg/Theora, which will exclude mobile browsers completely and perpetuate exactly the same bloody mess of incompatibility that HTML 5 is supposed to help resolve, or go with a solution which can easily be supported on a wide gamut of platforms.
So why don’t Apple follow Google, preferring H.264 but implementing both? They’ve actually, of course, taken a quintessentially Jobsian position: a crappy implementation is worse than none at all. (Especially if Theora’s adoption might harm the chances of something better coming along.)
So, what to do? Ian Hickson wrote a remarkably even-handed review of the situation and concluded that any requirement for codec compatibility had to be dropped, to prevent an unworkable specification.
His conclusion rather surprises me though. What’s wrong with requiring at least Ogg or H.264 support of compatible browsers? Sure, it’s just codifying the status quo, and it means that there’s no single file that can be guaranteed to play in every HTML 5-capable browser. It does, though, protect against any further fragmentation in support.
Needing two files might be inconvenient. But it beats 3. Or 4. Or 5…
Recent Comments