Home > Articles > Web Development > HTML/CSS

  • Print
  • + Share This
Like this article? We recommend Video, Audio, and Patents

Video, Audio, and Patents

One of the most controversial parts of HTML 5 has been the inclusion of <video> and <audio> tags. There are several reasons for this. The first comes from people who feel that these are presentational and should be replaced with the <object> tag. This was originally intended to replace the <img> and <applet> tags, but this never really happened.

The <object> tag is not great for embedding video or audio. Most browsers play these with plugins, such as QuickTime or Windows Media Player, and these plugins do not have a well-defined interface for scripting. That means you can't easily request that a player displays no controls and starts playing immediately, for example, without embedding a load of plugin-specific <param> tags. You can't provide a consistent, cross-platform user interface by providing buttons in your web page that control the playback, again, unless you write a lot of plugin-specific JavaScript.

The new tags solve this problem by providing standard interfaces for scripting. If you display something in a <video> tag, then you can control it from JavaScript in the same way irrespective of how the browser is rendering it.

This also helps slightly with layout. Most browsers will try to lay out the page as accurately as they can before the referenced resources are downloaded. With the new tags, it's easier for the browser to work out how much space is going to be needed for the content.

The other part of the controversy came from proposals to define standard codecs for use by these tags. The Mozilla Foundation wanted the Ogg Vorbis and Theora codecs made mandatory. These are provided for free, under a BSD-style license, by the Xiph.org Foundation, and are believed to be patent-free, meaning that anyone can implement them without issues.

This seems like an obvious choice, but Apple objected on the basis that the codecs are not exactly state-of-the-art these days, and they have not been proven to be patent-free (although doing this is very difficult to do). Instead, they wanted the H.264 video codec to be made standard, because it is currently the best codec for general use available. Unfortunately, H.264 is patent-encumbered, and the licensing requirements are such that it would not be possible to include it in Mozilla browsers.

This led to something of an impasse, and generated a lot of largely irrelevant publicity. The current drafts do not contain any required codecs. This might seem like a problem, but consider the situation when HTML 4 was standardized. Back when it was being drafted, MPEG-1 was the only codec that was widely available and could produce content that could be played back on a reasonable computer. Now imagine if they had mandated it for the specification.

Most modern browsers have a plugin that can play MPEG-1, and back around 2000, people were advocating it as the most sensible choice if you wanted video to play anywhere. Now? I can't remember the last time I saw an MPEG-1 video online (although my browser could still play it if I did see one), and HTML 4 is still the current version of the standard.

HTML 5 is not going to be finalized for another two or three years. In that time, available processing power will have doubled again at least once, and research into compression algorithms will be a bit further ahead. Things like Dirac are now at the same sort of state that MPEG-4 was in when HTML 4 was under development—implemented, not fully optimized, not yet supported in hardware, and needing a fast CPU to decode. By a year or two after HTML 4 was released, mobile phones could play back MPEG-4, so requiring a specific codec at this point seems premature.

  • + Share This
  • 🔖 Save To Your Account