<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML5 Doctor &#187; multimedia</title>
	<atom:link href="http://html5doctor.com/category/multimedia/feed/" rel="self" type="application/rss+xml" />
	<link>http://html5doctor.com</link>
	<description>helping you implement HTML5 today</description>
	<lastBuildDate>Wed, 01 Feb 2012 09:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Video Subtitling and WebVTT</title>
		<link>http://html5doctor.com/video-subtitling-and-webvtt/</link>
		<comments>http://html5doctor.com/video-subtitling-and-webvtt/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 15:33:59 +0000</pubDate>
		<dc:creator>Tom Leadbetter</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[subtitles]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webvtt]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=4084</guid>
		<description><![CDATA[<p>We’ve been able to play video in the browser without a plugin for a couple of years now, and whilst there are still some codec annoyances, things appear to have settled down on the video front. The next step is adding resources to the video to make it more accessible and provide more options to the viewer.</p>]]></description>
			<content:encoded><![CDATA[<p>We’ve been able to play video in the browser without a plugin for a couple of years now, and whilst there are still some codec annoyances, things appear to have settled down on the video front. The next step is adding resources to the video to make it more accessible and provide more options to the viewer.</p>
<p>We currently have no means to provide information about what’s happening or being said in the video, which means the video isn’t very accessible and the user can’t easily navigate to a particular section of the video. Thankfully, there’s a new format specification in the works called <a href="http://www.whatwg.org/specs/web-apps/current-work/webvtt.html">WebVTT (Web Video Text Tracks)</a>. As of now, it’s only in the WHATWG spec, but the recently established <a href="http://www.w3.org/community/texttracks/">W3C Web Media Text Tracks Community Group</a> should introduce a WebVTT spec to the W3C soon.</p>
<p class="callout">You may recall a similar format called WebSRT (Web Subtitle Resource Tracks) that was recently under discussion. WebSRT was renamed to, and has been replaced by, WebVTT.</p>
<p>A WebVTT (.vtt) file is simply plain text containing several types of information about the video:</p>
<dl>
<dt>Subtitles</dt>
<dd>The transcription or translation of the dialogue.</dd>
<dt>Captions</dt>
<dd>Similar to subtitles, but may also include sound effects and other audio information.</dd>
<dt>Descriptions</dt>
<dd>Intended to be a separate text file that describes the video through a screenreader.</dd>
<dt>Chapters</dt>
<dd>Intended to help the user navigate through the video.</dd>
<dt>Metadata</dt>
<dd>Information and content about the video, which isn’t intended to be displayed to the viewer by default, though you may wish to do so using JavaScript.</dd>
</dl>
<p>This article will mostly be talking about <a href="#contents">subtitles and captions</a>, but it will briefly touch on <a href="#chapters">chapters</a> too.</p>
<p class="callout">Beyond the scope of this article but worth mentioning is the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#text-track-api">text track API</a>, which, amongst other things, denotes how many text tracks there are and which ones have loaded and are ready for use. If you have used this API, <a href="http://html5doctor.com/ask-the-doctor/">let us know</a>.</p>
<section id="how">
<h2>How to Make and Link to a WebVTT file <a href="#how" class="permalink">#</a></h2>
<p>All you need to make a WebVTT file is a simple text editor. Type <code>WEBVTT</code> as the first line of the file and save it as a .vtt file. In the future, we expect existing captioning tools such as <a href="http://www.universalsubtitles.org/">Universal Subtitles</a> to export to WebVTT format.</p>
<figure>
<pre><code>WEBVTT</code></pre>
<figcaption>The simplest possible valid WebVTT file</figcaption>
</figure>
<p>That’s all you need to get started. Next, we have to link to the file in the HTML document. We do this via the <a href="http://html5doctor.com/video-the-track-element-and-webm-codec/"><code>&lt;track&gt;</code> element</a>, which is a child of the video element. The <code>&lt;track&gt;</code> element has several optional attributes:</p>
<ul>
<li>the source WebVTT file (<code>src</code>),</li>
<li>the language of the track (<code>srclang</code>),</li>
<li>a user-readable <code>label</code>, and</li>
<li>what <code>kind</code> of track it is. The values of the <code>kind</code> attribute come from the list above (i.e., <code>subtitles</code>, <code>captions</code>, etc.).</li>
</ul>
<p>In the following example, we’re using a <code>&lt;track&gt;</code> element for subtitles:</p>
<pre><code>&lt;video width=&quot;640&quot; height=&quot;480&quot; controls&gt;
  &lt;source src=&quot;video.mp4&quot; type=&quot;video/mp4&quot; /&gt;
  &lt;source src=&quot;video.webm&quot; type=&quot;video/webm&quot; /&gt;
  &lt;track src=&quot;subtitles.vtt&quot; kind=&quot;subtitles&quot; srclang=&quot;en&quot; label=&quot;English&quot; /&gt;
  &lt;!-- fallback for rubbish browsers --&gt;
&lt;/video&gt;</code></pre>
<p>A few notes about the attributes:</p>
<ul>
<li>If no <code>kind</code> is specified, the default is <code>subtitles</code>.</li>
<li>If the <code>kind</code> is <code>subtitles</code>, then <code>srclang</code> is required.</li>
<li>There should not be two tracks of the same <code>kind</code> with the same <code>label</code>.</li>
</ul>
<p>In the above example, we use a <code>&lt;video&gt;</code> element with two different <code>&lt;src&gt;</code> elements (for cross-browser loveliness). After the sources comes the <code>&lt;track&gt;</code> element. You can have several <code>&lt;track&gt;</code> elements as you might have subtitles, captions, and descriptions all in different languages.</p>
<p class="callout"><code>&lt;track&gt;</code> doesn’t presuppose a particular file format. <a href="http://html5labs.interoperabilitybridges.com/prototypes/video-captioning/video-captioning/info">Microsoft supports</a> the <a href="http://www.w3.org/TR/ttaf1-dfxp/"><abbr title="Timed Text Markup Language">TTML</abbr></a> format, but this format will not be implemented by other browser vendors.</p>
</section>
<section id="contents">
<h2>WebVTT Contents <a href="#contents" class="permalink">#</a></h2>
<p>We now know how to make a WebVTT file and how to reference it in an HTML document, but what goes inside it? Within the file, we list what are known as “cues”. The WebVTT file might only have one cue, but it can contain as many as you want. Each cue starts with an ID, followed by the time settings, followed by the text. Each cue is separated by a blank line. Here’s an example of captions:</p>
<figure>
<pre><code>WEBVTT

1
00:00:01.000 --&gt; 00:00:10.000
This is the first line of text, displaying from 1-10 seconds

2
00:00:15.000 --&gt; 00:00:20.000
And the second line of text
separated over two lines</code></pre>
<figcaption>WebVTT example content</figcaption>
</figure>
<p>The above example has two cues. Times must be written in <code>hh:mm:ss.mmm</code> format, so the timings in this example occur in the first twenty seconds. The second cue will split the text over two lines automatically.</p>
<p>If you have a segment of text that needs to appear in a karaoke/paint-on caption style, then you can place timers inline with text:</p>
<figure>
<pre><code>1
00:00:01.000 --&gt; 00:00:10.000
Never gonna give you up &lt;00:00:01.000&gt; Never gonna let you down &lt;00:00:05.000&gt; Never gonna run around and desert you</code></pre>
<figcaption>Karaoke-style captioning</figcaption>
</figure>
</section>
<section id="styling">
<h2>Styling Options <a href="#styling" class="permalink">#</a></h2>
<p>The previous examples specify the minimum configuration you need for subtitling and captioning, but you can style your captions too. Let’s start with the cue settings, which are done on the same line as the time settings:</p>
<dl>
<dt><code>D:vertical / D:vertical-lr</code></dt>
<dd>Display the text vertically rather than horizontally. This also specifies whether the text grows to the left (<code>vertical</code>) or to the right (<code>vertical-lr</code>).</dd>
<dt><code>L:X / L:X%</code></dt>
<dd>Either a number or a percentage. If a percentage, then it is the position from the top of the frame. If a number, this represents what line number it will be.</dd>
<dt><code>T:X%</code></dt>
<dd>The position of the text horizontally on the video. <code>T:100%</code> would place the text on the right side of the video.</dd>
<dt><code>A:start / A:middle / A:end</code></dt>
<dd>The alignment of the text within its box – <code>start</code> is left-aligned, <code>middle</code> is centre-aligned, and <code>end</code> is right-aligned.</dd>
<dt><code>S:X%</code></dt>
<dd>The width of the text box as a percentage of the video width.</dd>
</dl>
<p>To make use of these settings, put them alongside the time settings, like this:</p>
<pre><code>00:00:01.000 --&gt; 00:00:10.000 A:middle T:50%
00:00:01.000 --&gt; 00:00:10.000 A:end D:vertical
00:00:01.000 --&gt; 00:00:10.000 A:start T:100% L:0%</code></pre>
<p>which would result in something like the following:</p>
<figure>
    <img src="http://html5doctor.com/wp-content/uploads/2011/11/video-subtitles-demo1.png" alt="Examples of subtitle display" width="354" height="109" /></p>
<figcaption>Examples of subtitle display and alignment</figcaption>
</figure>
<p>Along with the above cue settings, you can use inline styles for text:</p>
<dl>
<dt>Bold text</dt>
<dd><code>&lt;b&gt;Lorem ipsum&lt;/b&gt;</code></dd>
<dt>Italic text</dt>
<dd><code>&lt;i&gt;dolor sit amet&lt;/i&gt;</code></dd>
<dt>Underlined text</dt>
<dd><code>&lt;u&gt;consectetuer adipiscing&lt;/u&gt;</code></dd>
<dt>Ruby text</dt>
<dd><code>&lt;ruby&gt;見&lt;rt&gt;み&lt;/rt&gt;&lt;/ruby&gt;</code></dd>
</dl>
<p>You can even apply a CSS class to a section of text using <code>&lt;c.myClass&gt;Lorem ipsum&lt;/c&gt;</code>, giving us many more styling options.</p>
<p>Finally, you can add a declaration representing the name of the voice: <code>&lt;v Tom&gt;Hello world&lt;/v&gt;</code>. This declaration accomplishes three things:</p>
<ol>
<li>The caption will display the voice (Tom) in addition to the caption text.</li>
<li>The name of the voice can be read by a screenreader, possibly event using a different voice for male or female names.</li>
<li>It offers a hook for styling so that, for example, all captions for Tom could be in blue.</li>
</ol>
<section id="chapters">
<h3>Chapters</h3>
<p>You can provide a chapter list for the video the same way you would provide subtitles or captions. Start with the same <code>WEBVTT</code> declaration, and then for each cue, declare the chapter number, the start and stop times, and the chapter title:</p>
<figure>
<pre><code>&lt;track src=&quot;chapters.vtt&quot; kind=&quot;chapters&quot; srclang=&quot;en&quot; /&gt;</code></pre>
<figcaption>HTML <code>&lt;track&gt;</code> element for providing chapters to a video</figcaption>
</figure>
<figure>
<pre><code>WEBVTT

Chapter 1
00:00:01.000 --&gt; 00:00:10.000>
Introduction to HTML5</code></pre>
<figcaption>WebVTT file containing video chapter markers</figcaption>
</figure>
</section>
</section>
<section id="browsers">
<h2>Browser Support <a href="#browsers" class="permalink">#</a></h2>
<p>One slight glitch with WebVTT: not a single browser currently supports it. All major browsers have started working on implementations, so we should see some results soon. Thankfully, in the meantime, there are several JavaScript polyfills available:</p>
<ul>
<li><a href="http://www.storiesinflight.com/js_videosub/">js_videosub</a></li>
<li><a href="http://www.delphiki.com/html5/playr/">Playr</a></li>
<li><a href="http://mediaelementjs.com/">MediaElementJS</a></li>
<li><a href="http://dev.mennerich.name/showroom/html5_video/">LeanBack player</a> (and upcoming <a href="http://leanbackplayer.com/test/webvtt.html">new version</a>)</li>
<li><a href="https://github.com/cgiffard/Captionator">Captionator</a>&nbsp;</li>
</ul>
</section>
<section id="demo">
<h2>Demo <a href="#demo" class="permalink">#</a></h2>
<p>We&#8217;ve put together a <a href="http://html5doctor.com/demos/webvtt/">quick demo</a> which uses the <a href="http://www.delphiki.com/html5/playr/">Playr</a> polyfill. We started using <a href="http://mediaelementjs.com/">MediaElementJS</a>, but it doesn’t sport as many features as <a href="http://www.delphiki.com/html5/playr/">Playr</a>, such as separate lines of text and CSS classes. In the <a href="http://html5doctor.com/demos/webvtt/">demo</a>, the subtitles start at 2 seconds and 15 seconds and use bold, underline, and custom styles. Here’s the <a href="http://html5doctor.com/demos/webvtt/subtitles.vtt">associated WebVTT file</a>.</p>
</section>
<section id="conclusion">
<h2>Conclusion <a href="#conclusion" class="permalink">#</a></h2>
<p>This article covers the basics of creating a WebVTT file suitable for subtitles or captions for a video. We know how to add cues and chapters and how to add styles and change how the text appears on the video. Although no browser yet supports it, there’s a lot more to come for accessible video, so stay tuned to the <a href="http://www.w3.org/community/texttracks/">W3C Web Media Text Tracks Community Group</a>.</p>
<p>What are your thoughts on WebVTT? Are any of you using it now? How can it be improved?</p>
<p>Finally, let’s thank <a href="http://twitter.com/#!/silviapfeiffer">@silviapfeiffer</a> for taking the time to answer some questions about WebVTT and for her tremendous work in this field.</p>
</section>
<section id="reading">
<h2>Reading <a href="#reading" class="permalink">#</a></h2>
<ul>
<li>Follow <a href="http://twitter.com/#!/silviapfeiffer">@silviapfeiffer</a></li>
<li><a href="http://www.w3.org/community/texttracks/">W3C Web Media Text Tracks Community Group</a></li>
<li><a href="http://blog.gingertech.net/2011/06/27/recent-developments-around-webvtt/">Recent developments around WebVTT</a></li>
<li><a href="http://html5videoguide.net/presentations/WebVTT/">Presentation: HTML5 video accessibility and the WebVTT file format</a></li>
<li><a href="http://www.youtube.com/watch?v=gK72pcu3cpk">HTML5 video accessibility and the WebVTT file format &#8211; Audio Described</a></li>
<li><a href="http://leanbackplayer.com/other/webvtt.html">A review with notes and thoughts for LeanBack Player</a></li>
<li><a href="http://quuz.org/webvtt/">WebVTT validator</a></li>
<li><a href="http://www.iandevlin.com/blog/2011/05/html5/webvtt-and-video-subtitles">WebVTT and Video Subtitles</a></li>
<li><a href="http://www.openmediadevelopers.org/pmwiki.php/Main/OVC2011VidA11y">The Open Video Alliance</a></li>
<li><a href="http://www.delphiki.com/webvtt/">Understanding WebVTT file format (draft)</a></li>
<li><a href="http://scottbw.wordpress.com/2011/06/28/creating-subtitles-and-audio-descriptions-with-html5-video/">Creating subtitles and audio descriptions with HTML5 video</a></li>
</ul>
</section>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li>
<li><a href="http://html5doctor.com/the-video-element/" rel="bookmark" class="crp_title">The video element</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
<li><a href="http://html5doctor.com/html5-for-web-developers/" rel="bookmark" class="crp_title">HTML5 for Web Developers</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/video-subtitling-and-webvtt/" rel="bookmark">Video Subtitling and WebVTT</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on November 29, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/video-subtitling-and-webvtt/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>HTML5 Simplequiz #3: how to mute a video</title>
		<link>http://html5doctor.com/html5-simplequiz-3-how-to-mute-a-video/</link>
		<comments>http://html5doctor.com/html5-simplequiz-3-how-to-mute-a-video/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 08:35:16 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[JavaScript APIs]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[Simplequiz]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[muted]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2628</guid>
		<description><![CDATA[This is a bit of a special Simplequiz this week. Simon Pieters, who works on multimedia QA for Opera and is one of those working on the HTML5 spec, asked us to run a quiz that would help the spec writers decide on a new aspect of the language. ]]></description>
			<content:encoded><![CDATA[<p>This is a bit of a special Simplequiz this week. Simon Pieters (<a href="http://twitter.com/zcorpan">@zcorpan</a>), who works on multimedia QA for Opera and is one of those working on the HTML5 spec, asked us to run a quiz that would help the spec writers decide on a new aspect of the language. What power you wield, gentle reader! Over to Simon&hellip;</p>
<p>This SimpleQuiz is a bit different to previous SimpleQuizzes, since we&#8217;d like to use the result of this quiz to inform a design decision in the HTML5 spec. The question concerns how to mute a video in markup, and how this should be reflected in the DOM.</p>
<p>The use case is wanting to have multiple videos playing at once, but with all but one being muted at a time. This can be done today by setting <code>.muted = true</code> with script, but it would be more convenient to be able to mute with markup.</p>
<p>The <code>.muted</code> IDL attribute reflects the user setting of muted for the video element &#8212; if the user clicks &#8220;mute&#8221; in the native video controls, then the value of <code>.muted</code> changes, and vice versa. It would make sense for the browser to remember the mute setting for individual video elements on page reload (or later visit), so that the user doesn&#8217;t have to re-mute them.</p>
<p>This is where it starts to get hairy if we introduce a content attribute for muting. (Note that code fragments below aren&#8217;t real code, just suggestions.)</p>
<p>We could introduce <code>muted=""</code> which is reflected by <code>.muted</code> (i.e. if one changes, so does the other), but this would cause the DOM to mutate during parsing if the remembered setting doesn&#8217;t match the markup, i.e. you would get <code>muted=""</code> to appear in the DOM if the video is muted by the user even though there was no such attribute in the markup, which could confuse your scripts or style sheets if it&#8217;s not what you expected to happen.</p>
<p>We could introduce <code>defaultmuted=""</code> which is reflected by <code>.defaultMuted</code>, and just let the user setting change <code>.muted</code>, but <code>defaultmuted=""</code> is a bit long and ugly in markup.</p>
<p>We could have <code>muted=""</code> which is reflected by <code>.defaultMuted</code> and let the user setting change <code>.muted</code>, but it might be confusing for some people. On the other hand it is consistent with <code>&lt;input value&gt;</code> and <code>.defaultValue</code>.</p>
<p>What do you think? Which is the best option? Is there another option that is better than any of the above?
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/the-nsfw-element/" rel="bookmark" class="crp_title">The nsfw element</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</a></li>
<li><a href="http://html5doctor.com/the-video-element/" rel="bookmark" class="crp_title">The video element</a></li>
<li><a href="http://html5doctor.com/html5-custom-data-attributes/" rel="bookmark" class="crp_title">HTML5 Custom Data Attributes (data-*)</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-2-citing-people/" rel="bookmark" class="crp_title">HTML5 Simplequiz #2: citing people</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/html5-simplequiz-3-how-to-mute-a-video/" rel="bookmark">HTML5 Simplequiz #3: how to mute a video</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on October 15, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-simplequiz-3-how-to-mute-a-video/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Video: the track element and webM codec</title>
		<link>http://html5doctor.com/video-the-track-element-and-webm-codec/</link>
		<comments>http://html5doctor.com/video-the-track-element-and-webm-codec/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 13:45:42 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[track]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webm]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2089</guid>
		<description><![CDATA[There are a couple of interesting developments in the world of HTML5 multimedia that you'll be interested in&#8212;the webM video format, and a proposed solution to HTML5 multimedia accessibility.]]></description>
			<content:encoded><![CDATA[<p>There are a couple of interesting developments in the world of <abbr>HTML</abbr>5 multimedia that you&#8217;ll be interested in. The first is the new <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-track-element"><code>&lt;track&gt;</code> element</a> (currently only in the WHAT-WG spec due to political stuff).</p>

<p><code>&lt;track&gt;</code> is a child of a <code>&lt;video&gt;</code> or <code>&lt;audio&gt;</code> element that links to a <b>timed track</b>, or time-based data. The kind of data is set via a <code>kind</code> attribute, which can take values of <code>subtitles</code>, <code>captions</code>, <code>descriptions</code>, <code>chapters</code> or <code>metadata</code>, depending on the type of information you&#8217;re adding to your media. These point to a source file containing timed text that the browser will expose via some kind of user interface, if the visitor requires additional data.</p>

<p>This will allow for &#8220;write once, use everywhere&#8221; accessibility; anyone linking to that file with a <code>&lt;video&gt;</code> or <code>&lt;audio&gt;</code> element that includes the element can access your information.</p>

<pre><code>&lt;track kind=captions src=blah.srt&gt;</code></pre>

<p>The file format is a new format called <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#websrt">WebSRT</a>, which competes with about <a href="http://wiki.whatwg.org/wiki/Timed_track_formats">50 other timed formats</a>, including some W3C formats (hence the omission of <code>&lt;track&gt;</code> from the W3C spec).</p><p>Added 9 July 2010: Here&#8217;s a readable <a href="http://www.delphiki.com/websrt/">overview of the SRT format</a>.</p>

<p>Given that the format itself isn&#8217;t fully specified yet, it will be a while until we see implementation in browsers. But it&#8217;s good to know that there will be an official way to add accessibility information to media. Until then, I have a <a href="http://dev.opera.com/articles/view/accessible-html5-video-with-javascripted-captions/">JavaScript hack</a> to take timed <code>&lt;span&gt;</code>s out of an in-page transcript to superimpose over a video.</p>

<h2>WebM video format</h2>
<p>The big news of the last month is that Google open-sourced the VP8 video codec that it acquired when it <a href="http://investor.google.com/releases/2010/0219.html">took over On2 Technologies</a>. When combined with the Vorbis audio codec (that Spotify uses) and wrapped in a subset of the <a href="http://en.wikipedia.org/wiki/Matroska">Matroska container format</a>, it&#8217;s collectively known as <a href="http://www.webmproject.org/">WebM</a>.</p>

<p>All YouTube videos are being transcoded to WebM, and Adobe have also announced they will include it in their Flash player. It&#8217;s available in an <a href="http://www.opera.com/browser/next">Opera 10.60 beta</a>, a <a href="http://nightly.mozilla.org/webm/">Firefox testing build</a>, and a <a href="http://www.chromium.org/getting-involved/dev-channel">Chromium dev channel</a>. Even Microsoft have said that IE9 will support it if the codec is installed on the computer.</p>

<p>The <a href="http://www.streamingmedia.com/Articles/Editorial/Featured-Articles/First-Look-H.264-and-VP8-Compared-67266.aspx">VP8 video codec itself is high-quality</a> (Google had said that Ogg Theora wasn&#8217;t good enough compression-to-quality for YouTube, but Theora was based on the VP3 precursor to VP8). It&#8217;s available for <a href="http://zaheer.merali.org/articles/2010/06/02/webm-and-vp8-streaming-live-from-flumotion/">streaming</a> too.</p>

<p>If you want to encode to WebM, you can try the <a href="http://www.mirovideoconverter.com/">Miro Video Converter</a> utility. Although it doesn&#8217;t allow you to optimise settings, it&#8217;s very easy to use. As the codec becomes more widespread, expect to see many more tools for content creation, editing, and transcoding.</p>

<p>Once production versions of the browsers are available, you should encode your videos with WebM as the first option, Ogg for older versions of Opera, Firefox and Chrome, falling back to royalty-encumbered H.264 for Safari and links to downloads or a Flash player for legacy browsers:</p>

<pre><code>&lt;video controls&gt;
&lt;source src=video.webm type='video/webm; codecs="vorbis,vp8"'&gt;
&lt;source src=video.mp4 type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'&gt;
&lt;source src=video.ogv type='video/ogg; codecs="theora, vorbis"'&gt;
&lt;!-- embed Flash here --&gt;
&lt;p&gt;Your browser does not support video; download the &lt;a href=&quot;video.webm&quot;&gt;WebM&lt;/a&gt;, &lt;a href=&quot;video.mp4&quot;&gt;mp4&lt;/a&gt; or &lt;a href=&quot;video.ogg&quot;&gt;Ogg&lt;/a&gt; video for off-line viewing.&lt;/p&gt;
&lt;/video&gt;</code>
</pre>

<p>If, however, you&#8217;re having problems with the iPad, put the MP4 version first in the <code>&lt;source&gt;</code> element; apparently there&#8217;s a bug that causes the iPad only to see the first <code>&lt;source&gt;</code> element.</p>

<p>It’s a long haul, and it’s not over yet, but <code>&lt;track&gt;</code> and .webM show significant progress towards our goal of accessible, open, and royalty-free video playing natively in the browser.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/video-subtitling-and-webvtt/" rel="bookmark" class="crp_title">Video Subtitling and WebVTT</a></li><li><a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/" rel="bookmark" class="crp_title">YouTube and Vimeo support HTML5 Video</a></li><li><a href="http://html5doctor.com/the-video-element/" rel="bookmark" class="crp_title">The video element</a></li><li><a href="http://html5doctor.com/native-audio-in-the-browser/" rel="bookmark" class="crp_title">Native Audio in the browser</a></li><li><a href="http://html5doctor.com/review-html5-now-dvd/" rel="bookmark" class="crp_title">Review: HTML5 Now (DVD)</a></li></ul></div><p><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark">Video: the track element and webM codec</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on June 24, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/video-the-track-element-and-webm-codec/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>

