Breaking Eggs And Making Omelettes

Topics On Multimedia Technology and Reverse Engineering


Archives:

Researching The HTML 5 Video Tag

February 1st, 2009 by Multimedia Mike

Discussions of the proposed <video> tag in HTML5 invariably make my ears perk up, maybe because it could be perceived — under the right circumstances — as alleged competition against what I do at my day job. But I’m still interested in all topics concerning multimedia technology, and this sounds like a big one. Plus, Mozilla recently announced that it would donate 100 grand to Wikimedia to help improve Ogg and Theora.


100 Grand candy bar

Quick glossary/refresher on key terminology: Vorbis = audio codec; Theora = video codec; Ogg = container format that wraps and delivers Vorbis, Theora and several other types of media.

So, the video tag is supposed to be the promised land of video on the web (just like SVG is supposed to be the open answer to Flash). I’m looking at this from a purely pragmatic perspective. Here are 2 big questions about media meant for delivery via the media tag:

  1. How do people create the media?
  2. How do people consume the media?

I want to ponder these questions.

How do people create the media?

I admit, I’m extremely weak when it comes to content creation. If you were to ask me how to create an Ogg/Vorbis/Theora multimedia file for distribution — as I am asking myself right now — I would draw quite a blank. So I go straight to the source — Theora.org FAQ #41: How can I encode videos to Theora? The answer has 2 links, one of which is broken, and some other example command lines in the body. All of the examples seem to assume that the video production specialist creating this content will be working entirely from a Unix-like command line. True, a lot of pros use Mac OS X which has a Unix foundation. But I have this stereotype that they would prefer something more graphical.

Staying in the realm of command line tools, what about the master multimedia program, the one relied upon my open and closed projects alike? I refer of course to FFmpeg. While the program decodes Theora video, it still does not feature a native Theora encoder. Ironically, I have been the biggest champion of such a project, but the effort has never really gotten off the ground. FFmpeg does, however, allow a user to compile in support for Xiph’s libraries. Plus, there is the ffmpeg2theora as another solution.

So the command line approach, on Unix platforms, is pretty well covered. What about GUI-based editors that can encode Theora? I didn’t bother checking the feature lists for Adobe’s and Apple’s current offerings since I take it as a foregone conclusion that neither’s tools exports Ogg as of yet. I did a little digging and it seems that such a beast actually does exist. LiVES is out there, and purports to run on Win/Mac/Linux. Nice. I can’t make any statements about how the tool stacks up to proprietary ones since I can barely figure out how to run any video editor at all. I just wanted to learn if a Windows or Mac content creator could actually find a GUI-based video editing tool that could output Theora, should they feel the urge to jump on the free video bandwagon.

Per my understanding, Ogg/Theora/Vorbis is not necessarily the standard for the video tag. In fact, the spec states, “However, there are no known codecs that satisfy all the current players… This is an ongoing issue and this section will be updated once more information is available.” Indeed, I have read that, while Apple’s Safari supports the video tag, it doesn’t support the Ogg/Theora/Vorbis open standard, opting instead for the more popular and widespread QT-MP4/H.264/AAC open standard.

So this brings me to my next question:

How do people consume the media?

Well, via the HTML video tag, ideally. I have been wanting to take a survey of video tag support in various browsers to see how widely supported this feature is, and to see what it even looks like. All I hear is that the video tag is totally gonna be supported everywhere RSN. Let’s see how things are shaping up so far.

As advertised, Mozilla Firefox 3.0.5 (current as of this writing) does not support the video tag, while 3.1 (beta 2 as of this writing) does. I pulled this Ogg video from Wikipedia, put it on a local webserver along with an HTML file wrapping the Ogg filename in a video tag and observed the results:


Firefox Video Tag

As suspected, Apple Safari (3.2.1) on Mac OS X can play a QuickTime file — any QuickTime file — via the video tag. Although weird things happen with the position bar if you contain the video in a center tag:


Hey! Where are you going, little seek bubble?

Hey! Where are you going, little seek bubble?


But Safari does not support the Ogg/Theora/Vorbis suite.

I thought I had read that Apple Safari running on the iPod Touch supported the video tag, same as desktop Safari. How wrong I was.

Further, I thought I had read that Opera now included support for the video tag. But I tried my test page on Opera 9.63 on Linux to no avail. The fallback text is displayed rather than any trace of video.

Internet Explorer 7 on Windows: What’s your best guess? Of course it doesn’t have any video tag support.

Finally, I looked at the dark horse contender — Google Chrome running under Windows. No video tag support

Final Thoughts
I wouldn’t put much stock in this video tag stuff except for the fact that certain major players like Wikipedia and the Internet Archive are keenly interested. Wikipedia has been hosting Ogg/Theora/Vorbis media for some time now. When I was doing my MOOBEX survey, I observed that different distros either used the Java-based player method or used a plugin that connected to a native media player, usually Totem. I suspect that the release of Firefox 3.1 will simply see the introduction of a new method for playing back the Ogg files in an embedded manner.

Posted in HTML5 | 11 Comments »

11 Responses

  1. Peter Says:

    The bigger picture is interactive web-multimedia. HTML5+CSS+SVG+Javascript is being pitched as the alternative to Flash.

    IMHO, having to download a third-party plugin to experience web-multimedia doesn’t cut the mustard in 2009.

  2. Peter Says:

    HTML5/Video enabled Opera: http://dev.opera.com/articles/view/a-call-for-video-on-the-web-opera-vid/

  3. Multimedia Mike Says:

    So Opera has preview releases that contain video tag support, and they’re from a year ago. I wonder why the support has not gone into the current version?

  4. Peter Says:

    That much should be obvious Mike: There are submarines lurking in the oceans of Theora…

  5. n Says:

    >HTML5+CSS+SVG+Javascript is being pitched as the alternative to Flash.
    It looks like lost IE’s DHTML+HTML+TIME+CSS+VML+JScript :P

    DHTML http://msdn.microsoft.com/en-us/library/aa155110.aspx
    HTML+TIME http://msdn.microsoft.com/en-us/library/ms533112%28VS.85%29.aspx
    VML http://msdn.microsoft.com/en-us/library/bb264280%28VS.85%29.aspx

  6. Denver Gingerich Says:

    It’s more than just the Wikimedia Foundation and the Internet Archive that want the video element. Anyone who dislikes Flash (like me; see http://ossguy.com/?p=145) is excited about its opportunities, too.

    Unfortunately, adoption will be limited (as you mentioned) by the refusal of big companies like Microsoft and Apple to support royalty-free codecs, which will force video hosting sites to provide content in at least two formats if they choose to use the video element. I describe this problem in “The codec dilemma”: http://ossguy.com/?p=233. See the “Business motives” section in particular.

    In addition to the codec problem, it’s not even clear that IE8 will support the video element (http://stackoverflow.com/questions/289225/does-ie-8-support-html-5) so widespread adoption will take some time.

    The tests your performed of the video element could have just as easily been implemented with the object element, which has been supported in all browsers for a while. The key part of the video element that the object element lacks is the ability to interact with the video through JavaScript or other mechanisms, including seeking, starting, and stopping the video. For a demo of these features, see the first 5 minutes of http://youtube.com/watch?v=xIxDJof7xxQ (use http://userscripts.org/scripts/show/34765 if you don’t like Flash).

    The issues you reported with converting videos to Theora/Vorbis have largely been solved with Firefogg (http://firefogg.org/). This browser plugin for Firefox 3.1 will re-encode your video into Theora and Vorbis during the upload process, transparently to the user. Wikimedia Commons already supports this (see the second half of http://brianna.modernthings.org/article/180/media-handling-on-wikimedia-preview-the-future-part-2).

  7. mat Says:

    And ATM most browser support the html object tag for embedding video : http://joliclic.free.fr/html/object-tag/en/object-video.html
    I wonder how fast will be the video tag switch …

  8. Multimedia Mike Says:

    @mat: It all sort of depends on how fast video providers want to make the switch. See also: Why the video tag won’t save us.

    Also, all of those videos rely on external plugins which may not be present. Not saying whether that’s good or bad, though it is at odds with Peter’s (above) assertion that plugins are outmoded.

  9. Jonathan Wilson Says:

    One reason why a number of companies arent interested in Theora or other open codecs is because they already have big investment in a MPEG ecosystem. Apple for example has MPEG support in its OS, MPEG playback on its Apple TV set top box and MPEG support (likely including hardware decoding chips) on its iPods and iPhone. Nokia has support for it (possibly including hardware acceleration) on a number of their devices.
    Plus, there are already existing mechanisms for DRM on MPEG audio and video (which the media companies will accept) which is what those companies want and need.

    I dont think you could ever produce a video codec that would be acceptable to both the Free Software folks (GNU, Firefox, Mozilla etc) and the proprietary companies (Apple, Nokia etc).

    Then of course you have Microsoft that would rather people use Silverlight for video (and if they ever supported the video tag, would only support windows media)

  10. Ben Says:

    “Apple Safari (3.2.1) on Mac OS X can play a QuickTime file — any QuickTime file — via the video tag”

    Yep, and it’s easy enough to get Quicktime support for Theora+Vorbis:
    http://xiph.org/quicktime/

    Install that, and boom!, Safari plays Theora in a video tag.

    As for Internet Explorer… take a look at http://www.celt-codec.org/presentations/ . That page uses the tag, with sequential fallbacks to Cortado (a pure-Java-applet implementation of a Theora player), application/ogg download (if the browser advertises support and Java is not installed), and the VLC browser plugin (if the application/ogg MIME type is not supported).

    (The VLC browser plugin is just like the Flash plugin, but easier to install because it’s freely redistributable.)

    In other words, any existing browser can easily be made to support Theora+Vorbis streaming. Want that all wrapped up in a heavily tested, clean-interface javascript library? http://metavid.org/w/index.php/Mv_embed

    And as for patents: http://www.xiph.org/press/2007/w3c/ says it well enough. In fact, Theora is just a bitstream variant of On2 VP3, a predecessor of the On2 VP6 codec used by Adobe in FLV. If there were patent problems with On2’s codecs, Adobe would already have been hit by them!

  11. Multimedia Mike Says:

    @Ben: Awesome. I guess the playback side is covered. All that is left is to convince the content providers to switch their production pipelines to Theora, as Jonathan described above. And pay for extra bandwidth since Theora doesn’t quite perform at the same quality per bitrate as H.264. And sacrifice the whizzy features above and beyond basic video playback that make Flash so attractive.

    And hopefully, there will be a streamlined download & install process in case the user’s browser is not already capable of playback.

    As for your amateur lawyer bit, that’s an interesting concept– jurisprudence by mathematical induction. “Your honor, we intend to demonstrate that this patent infringement suit brought against Theora’s basis algorithm of VP3 is invalid. VP3 is a predecessor of VP6 (they have similar names, see). And no patent infringement suits have been brought against any licensees of VP6. Ergo, by induction, we prove that VP3 can not be infringing on patents.”

    At the very least, Xiph’s legal statement you linked doesn’t seem to be enough to satisfy Opera, as Peter intimated above.