views:

73

answers:

3

What codecs will be supported with the HTML5 video taq? Will it vary by browser, or is there a spec of specific codec that will be supported?

+2  A: 

According to wikipedia:

The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. User agents are free to support any video formats they feel are appropriate.

HTML5 is in draft format though and this may change.

There is an ongoing debate about the suitability of various algorithms and it seems that currently not everyone involved is able to agree on an answer. The three major contenders are Ogg/Theora, H.264 and VP8/WebM. The present state of the various implementations varies between the browsers.

The current HTML5 draft spec states:

It would be helpful for interoperability if all browsers could support the same codecs. However, there are no known codecs that satisfy all the current players: we need a codec that is known to not require per-unit or per-distributor licensing, that is compatible with the open source development model, that is of sufficient quality as to be usable, and that is not an additional submarine patent risk for large companies. This is an ongoing issue and this section will be updated once more information is available.

Simon P Stevens
+1  A: 

The spec does not mandate specific codecs.

For a long time, there was a strong divide between browser vendors. Firefox would not implement H.264 due to patent issues. Apple would not implement Ogg Theora due to concerns about lack of hardware implementation and bandwidth issues, as well as some vague concerns about submarine patents. Google said that they wouldn't encode YouTube video in Ogg Theora, due to quality and bandwidth concerns, though they implemented both H.264 and Ogg Theora in Chrome. I believe that Opera also was concerned about H.264 patents, and Microsoft was in favor of H.264 and against Theora.

Then Google bought On2, and created WebM, a specification including VP8 video and Ogg Vorbis audio in a Matroska container. Firefox, Chrome, and Opera all committed to supporting WebM. Microsoft and Apple have not yet embraced it, though Microsoft has said they will support VP8 video "when the user has installed a VP8 codec." This sounds like a situation similar to that of Safari; you can install QuickTime plugins to support other codecs, like Ogg Theora or VP8/WebM, but it doesn't support it out of the box.

The real question here is what people will support on mobile hardware. Because there is special purpose hardware to accelerate decoding, patents become much more of an issue, and due to limited resources, just supporting a long list of codecs becomes a lot less feasible. Google has promised to support WebM in Android 3, which is due by the end of this year, but I wouldn't bet on Apple or Microsoft implementing it any time soon.

The likely answer is that there won'e be one standard codec for a while. The best approach to get video that will play everywhere would be to encode in Ogg Theora and H.264, and use two <source> elements to refer to them. As browsers increasingly support WebM (Firefox 4, Chrome 6), you will likely want to transition to encoding in both H.264 and WebM. You could start encoding in all 3 now, but that's a bit redundant as most browsers which support WebM also support Ogg Theora.

Brian Campbell
+1  A: 

The most detailed description of the HTML5 video situation I've read is in the Dive Into HTML5 book.

Nickolay