{"id":194,"date":"2010-05-19T16:32:47","date_gmt":"2010-05-19T16:32:47","guid":{"rendered":"http:\/\/lachy.id.au\/log\/?p=194"},"modified":"2013-09-07T16:36:00","modified_gmt":"2013-09-07T16:36:00","slug":"webm","status":"publish","type":"post","link":"https:\/\/lachy.id.au\/log\/2010\/05\/webm","title":{"rendered":"Introducing WebM"},"content":{"rendered":"<p>Today, <a href=\"http:\/\/www.google.com\/\" title=\"\">Google<\/a>, in co-operation witt\r\n<a href=\"http:\/\/www.opera.com\/\">Opera<\/a>,\r\n<a href=\"http:\/\/www.mozilla.org\/\">Mozilla<\/a>,\r\n<a href=\"http:\/\/corecodec.com\/\" title=\"Home | CoreCodec\">CoreCodec<\/a>\r\n(<a href=\"http:\/\/matroska.org\/\" title=\"Matroska Media Container - Homepage | Matroska\">Matroska<\/a> developers)\r\nand a <a href=\"http:\/\/www.webmproject.org\/about\/supporters\/\" title=\"The WebM Project : about : WebM Supporters\">range of other companies<\/a>,\r\nhave announced at <a href=\"http:\/\/code.google.com\/events\/io\/2010\/\" title=\"Google I\/O 2010\">Google I\/O 2010<\/a>\r\nthat <a href=\"http:\/\/www.webmproject.org\/\" title=\"The WebM Project : The WebM Project : Welcome to the WebM Project\">WebM<\/a>\r\nis the new royalty free video codec for the web.<\/p>\r\n\r\n<p>Earlier this year, Google purchased <a href=\"http:\/\/on2.com\/\" title=\"On2 Technologies - Making Video Possible, from Handhelds to HD\">On2<\/a>, the company that developed\r\nof a range of video codecs including VP3, VP6, VP7 and VP8.  VP3 is a\r\nwell known codec that formed the basis of Theora.  VP6 is a codec\r\nsupported by Adobe Flash, VP7 is used by Skype for video conferencing.\r\nTheir latest offering, VP8, now forms the basis of the new WebM video\r\nformat.  <a href=\"http:\/\/www.webmproject.org\/code\/\" title=\"The WebM Project : code : Explore the WebM Source Code\">The code for the VP8 codec<\/a>\r\nhas been released royalty free under the BSD licence.<\/p>\r\n\r\n<p>WebM, which stands for Web Media, is a format based on 3\r\ntechnologies:<\/p>\r\n\r\n<ol>\r\n    <li>Container: A variation of Matroska called WebM.<\/li>\r\n    <li>Video codec: VP8.<\/li>\r\n    <li>Audio codec: Vorbis.<\/li>\r\n<\/ol>\r\n\r\n<h2>The Container Format<\/h2>\r\n\r\n<p><a href=\"http:\/\/www.matroska.org\/technical\/specs\/index.html\" title=\"Specifications | Matroska\">Matroska<\/a>\r\nis a widely supported container format, which is able to\r\ncontain a wide range of codecs, including, among others, h.264, VC-1,\r\nTheora, AAC, AC3 and Vorbis.  This is due to the high degree of\r\nflexibility inherent in the design of Matroska.<\/p>\r\n\r\n<p>Matroska itself if based on a binary markup language called EBML, the\r\ndesign of which was inspired by XML.  In short, EBML files contain a\r\nheader that declares the DocType and version information, followed by a\r\ntree of elements and data, marked up using a special binary notation.\r\nThe Matroska specification defines a range of elements, and their binary\r\nnotation, that can be used for marking up the data in Matroska files.<\/p>\r\n\r\n<p>The WebM format is a subset of Matroska, which has been optimised for\r\nstreaming over HTTP.<\/p>\r\n\r\n<p>WebM, which uses the DocType &#8220;webm&#8221;, can be distinguished from\r\nMatroska, which uses the DocType &#8220;matroska&#8221;.  Technically speaking, a\r\nvalid WebM version 1 file supports a subset of elements from Matroska\r\nversion 1, and WebM version 2 supports those in addition to some of the\r\nadditional elements from Matroska version 2.<\/p>\r\n\r\n<p>To further optimise WebM for use on the WebM, some additional formatting\r\nguidelines are imposed upon WebM files, over and above the Matroska counterpart.\r\nThese guidelines include plaicing the indexing information at the beginning\r\nof the file, and keyframes stored at the beginning of clusters.<\/p>\r\n\r\n<p>The WebM container is only permitted to contain the codecs VP8 and\r\nVorbis, and browsers will not support any other codecs within WebM &#8211; not\r\neven Theora or h.264.  Although there are no technical limitations with\r\nWebM that inherently prevent such codecs from being used, this was an\r\nintentional decision to improve the usability of WebM.<\/p>\r\n\r\n<p>The idea being that if you have a player that supports WebM, you can\r\nbe more confiden that the file will play without having to install\r\nadditional codecs.  This is a problem that has plagued container formats\r\nlike AVI for years.  You can&#8217;t easily determine what it contains until\r\nyou start playing it.  Some AVI files may contain DivX, Xvid, h.264 or a\r\nwide range of other codecs.<\/p>\r\n\r\n\r\n<h2>Benefits of Matroska<\/h2>\r\n\r\n<p>Matroska presented some nice benefits over competing container\r\nformats, sucha s MP4, commonly used with h.264, or even Ogg, which is\r\nsupported by Opera, Firefox and Chrome for Theora and Vorbis.  Like Ogg,\r\nMatroska is publicly specified and available to use freely, unlike, for\r\nexample, MP4.<\/p>\r\n\r\n<p>The main benefit of Matroska over Ogg is that the seeking information\r\ncan be placed at the beginning, making it significantly easier to seek\r\nin a WebM file being transferred over HTTP.  When the user tries to\r\nseek, if that part of the video hasn&#8217;t yet downloaded, then the browser\r\nneeds to request that section from the server.<\/p>\r\n\r\n<p>For Ogg, browsers have to do at least 2 separate requests when a\r\nvideo loads \u2014 one to get the beginning of the file and a range request\r\nto get the end \u2014 before the length of the video can be determined, and\r\nbefore seeking can occur, which then potentially results in additional\r\nrequests.<\/p>\r\n\r\n<p>For WebM, all the information is presented up front, meaning that if\r\na user seeks the video, the browser knows exactly where in the video to\r\ngo, or which part of the file to request from the server.<\/p>\r\n\r\n<p>This is not to say that Ogg itself is a bad format.  Quite the\r\ncontrary, it&#8217;s just optimised for different use cases.  Ogg is very good\r\nto use as a streaming container format where seeking is not required, or\r\nfor storing your Vorbis encoded music collection locally, where the\r\nplayer isn&#8217;t subject to the overhead of HTTP requests.<\/p>\r\n\r\n<p>WebM, on the otherhand, had to be specifically designed for use with\r\nthe HTML video element served over HTTP, and as such, benefited from the\r\ndesign decisions of Matroska.<\/p>\r\n\r\n\r\n<h2>Audio and Video Codecs<\/h2>\r\n\r\n<p>The VP8 codec provides significant quality enhancements over its\r\npredecessors; most notably Theora.  Comparisons between Theora and h.264\r\nhave shown that the quality of Theora is not up to scratch.  Thanks to\r\nGoogle, VP8 has now been released freely.<\/p>\r\n\r\n<p>There haven&#8217;t yet been any serious, independent comparisons between\r\nh.264 and VP8, so it&#8217;s difficult to say which is better.  Although h.264\r\nis certainly more mature than VP8, and has a lot more hardware support\r\nin existing devices, VP8 is likely to continually improve over the\r\ncoming years.<\/p>\r\n\r\n<p>The main limitation with VP8 at the moment is the lack of hardware\r\nacceleration.  Firefox, Opera and Chrome all currently use software\r\ndecoding of VP8, which means that it can increase CPU usage,\r\nparticularly for high definition videos, and watching a lot of video\r\nwill drain your battery more than hardware decoded h.264.<\/p>\r\n\r\n<p>However, Google have announced that they are working with hardware\r\npartners, and its possible that we&#8217;ll see devices shipping with support\r\nwithin a year or two.<\/p>\r\n\r\n<p>Vorbis, of course, has been supported by Firefox, Opera and Chrome\r\nfor a while already, and so it was a natural choice to use in\r\ncombination with VP8 in WebM.<\/p>\r\n\r\n\r\n<h2>YouTube<\/h2>\r\n\r\n<p>Over the past few weeks, YouTube has been working to convert many\r\nexisting videos into WebM.  To try this out using a browser\r\nthat supports WebM, follow the\r\n<a href=\"http:\/\/www.webmproject.org\/users\/\">instructions provided by the WebM Project<\/a>.\r\nWhile not all videos have been re-encoded yet, thousands of videos are already\r\navailable in WebM format, and will work in Opera, Firefox and Chrome.<\/p>\r\n\r\n<h2>Demo Time<\/h2>\r\n\r\n<p>Just so you can see for yourself what VP8 looks like, get yourself a\r\ncopy of the preview releases of Opera, Firefox and Chrome, sit back,\r\nrelax and watch Elephant&#8217;s Dream from the Orange Open Movie Project\r\n(<a href=\"http:\/\/www.elephantsdream.org\/\" title=\"Elephants Dream\">website<\/a>).\r\nI encoded this myself from the lossless source files using a special build of\r\nffmpeg with libvpx_vp8 (the VP8 codec library).<\/p>\r\n\r\n<video preload=\"none\" src=\"http:\/\/lachy.id.au\/lib\/media\/elephantsdream\/Elephants_Dream-360p-Stereo.webm\" width=\"640\" height=\"360\" controls><\/video>\r\n\r\n<h2>Creating Your Own Videos<\/h2>\r\n\r\n<p>The absolute easiest way to create your own WebM video is to upload\r\nyour source video to <a href=\"http:\/\/www.youtube.com\/\">YouTube<\/a> and\r\nwait for it to be encoded.  Other services, including <a href=\"http:\/\/encoding.com\" title=\"On Demand Video Encoding\">encoding.com<\/a>\r\nand <a href=\"http:\/\/www.hdcloud.com\/\" title=\"HD Cloud - Video Encoding and Video Transcoding In The Cloud\">HD Could<\/a> also offer transcoding\r\nservices for a small fee.<\/p>\r\n\r\n<p>If you want to encode the videos yourself, you need to get your hands\r\ndirty with a tool like ffmpeg with libvpx_vp8, or a commercial\r\nalternative.  Google have released the source code for libvpx_vp8, and\r\nbuilds of ffmpeg with it should be available shortly.  More information is\r\navailable on the <a href=\"http:\/\/www.webmproject.org\/tools\/\" title=\"\">The WebM Project tools page<\/a><\/p>\r\n\r\n<p>The Matroska developers have also been working on on updating their\r\nMatroska muxing software to support the WebM profile.  New tools called\r\n<a href=\"http:\/\/www.matroska.org\/downloads\/mkvalidator.html\" title=\"mkvalidator tool | Matroska\">mkvalidator<\/a> and\r\n<a href=\"http:\/\/www.matroska.org\/downloads\/mkclean.html\" title=\"mkclean tool | Matroska\">mkclean<\/a> will help you to validate your WebM files, and to\r\nclean and remux files that aren&#8217;t valid.  mkclean will also remux MKV files containing VP8\/Vorbis to WebM.\r\n\r\n<h2>Browser Support<\/h2>\r\n\r\n<\/p><p>Preview releases have been released for <a href=\"http:\/\/labs.opera.com\/news\/2010\/05\/19\/\" title=\"Welcome, WebM &lt;video&gt;\">Opera<\/a>,\r\n<a href=\"http:\/\/nightly.mozilla.org\/webm\/\">Mozilla Firefox<\/a> and, of course,\r\n<a href=\"http:\/\/build.chromium.org\/buildbot\/snapshots\">Google Chrome<\/a>.\r\n\r\n<\/p><p>More details are available on <a href=\"http:\/\/webmproject.org\/\">WebMProject.org<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":"Today, Google, in co-operation witt Opera, Mozilla, CoreCodec (Matroska developers) and a range of other companies, have announced at Google I\/O 2010 that WebM is the new royalty free video codec for the web. Earlier this year, Google purchased On2, the company that developed of a range of video codecs including VP3, VP6, VP7 and &hellip; <a href=\"https:\/\/lachy.id.au\/log\/2010\/05\/webm\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Introducing WebM<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,2,11,23,19],"tags":[],"_links":{"self":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/194"}],"collection":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/comments?post=194"}],"version-history":[{"count":9,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/194\/revisions\/211"}],"wp:attachment":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/media?parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/categories?post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/tags?post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}