<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-5537325711190185140</atom:id><lastBuildDate>Wed, 10 Mar 2010 02:26:05 +0000</lastBuildDate><title>Thundering Herd</title><description>The more drums we have in our kit, the more jobs we can handle.</description><link>http://blog.pearce.org.nz/</link><managingEditor>noreply@blogger.com (Chris Pearce)</managingEditor><generator>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-274603027516715282</guid><pubDate>Sat, 06 Mar 2010 20:53:00 +0000</pubDate><atom:updated>2010-03-07T10:04:55.036+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>ogg</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Switched blog to custom domain</title><description>I have switched my blog to being on a custom domain hosted at Blogger. The address for my blog is now &lt;a href="http://blog.pearce.org.nz"&gt;blog.pearce.org.nz&lt;/a&gt;. Previously I was using Blogger's publish via FTP to host my blog on my own domain, but they have &lt;a href="http://blogger-ftp.blogspot.com/"&gt;discontinued that service&lt;/a&gt;. I tried running Wordpress on my own domain, but I couldn't get plugins to work, so without &lt;a href="http://wordpress.org/extend/plugins/wp-cache/"&gt;WP-Cache&lt;/a&gt; my blog was slow. I'm glad to have my blog restored to its former snappy look and feel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-274603027516715282?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2010/03/switched-blog-to-custom-domain.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-1920722269149368525</guid><pubDate>Mon, 11 Jan 2010 02:03:00 +0000</pubDate><atom:updated>2010-01-11T15:34:31.026+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>video</category><category domain='http://www.blogger.com/atom/ns#'>ogg</category><category domain='http://www.blogger.com/atom/ns#'>seeking</category><category domain='http://www.blogger.com/atom/ns#'>keyframe index</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Indexing keyframes in Ogg videos for fast seeking</title><description>Seeking in Ogg videos in HTML5 &amp;lt;video&amp;gt; over the network currently can be very slow. This is because when we seek an Ogg/Theora video to a target time, we must perform a bisection search over the file in order to find the target Theora video frame. If this is an interframe (which just records what's changed since its preceding frame), we must then perform another bisection search to find the interframe's keyframe, and then decode forwards to the target frame in order to completely construct it.&lt;br /&gt;&lt;br /&gt;A reasonable bisection search implementation may require half a dozen HTTP requests to complete, so if we need to do two bisection searches per seek (once for the target frame, and once for the target frame's keyframe), we actually need to do about a dozen HTTP requests per seek...&lt;br /&gt;&lt;br /&gt;If we knew in advance where the keyframes were, we wouldn't need to do any bisection searches; we could make just one HTTP request to the last keyframe preceeding the target frame. Clearly making fewer HTTP requests is faster.&lt;br /&gt;&lt;br /&gt;Enter the &lt;a href="http://wiki.xiph.org/Ogg_Index"&gt;Skeleton 3.1 with Keyframe Index track&lt;/a&gt;. This extends the existing &lt;a href="http://www.xiph.org/ogg/doc/skeleton.html"&gt;Skeleton 3.0 metadata track&lt;/a&gt; to provide an index for every Theora video and Vorbis audio track in an Ogg media. This will enable players to make the optimal HTTP request when seeking in media files served over the internet, resulting in as fast seeking as possible when viewing online video.&lt;br /&gt;&lt;br /&gt;It's nice if a video player's UI can display the playback duration of the Ogg media. Unfortunately the raw Ogg format does not store the duration either, so it must be calculated, which requires additional HTTP requests, and slows down the video loading. The Skeleton 3.1 track also includes the playback duration of its Ogg containing file, to eliminate this overhead and speed up loading.&lt;br /&gt;&lt;br /&gt;I developed the Skeleton 3.1 with Keyframe Index track in conjunction with the folks at Xiph.org. See the Xiph.org &lt;a href="http://wiki.xiph.org/Ogg_Index"&gt;Skeleton 3.1 with Keyframe Index wiki page&lt;/a&gt; for the work-in-progress specification. Any comments on the specification would be much appreciated, please send them to the &lt;a href="http://lists.xiph.org/mailman/listinfo/theora"&gt;Theora mailing list&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I have developed a prototype Ogg indexer, &lt;a href="http://github.com/cpearce/OggIndex"&gt;OggIndex&lt;/a&gt;, and also recent &lt;a href="http://v2v.cc/%7Ej/ffmpeg2theora"&gt;ffmpeg2theora&lt;/a&gt; nightlies will encode keyframe indexes if you specify the command line option &lt;tt&gt;-–seek-index&lt;/tt&gt;. &lt;a href="http://firefogg.org/nightly/"&gt;OggIndex and experimental indexing ffmpeg2theora nightlies&lt;/a&gt; are available for download.&lt;br /&gt;&lt;br /&gt;To see how keyframe indexing improves network seeking performance of HTML5 Ogg/Theora &amp;lt;video&amp;gt;, you can download a development version of Firefox which can take advantage of indexes here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pearce.org.nz/video/firefox-indexed-seek-linux.tar.bz2"&gt;http://pearce.org.nz/video/firefox-indexed-seek-linux.tar.bz2&lt;/a&gt;&lt;br /&gt;&lt;a href="http://pearce.org.nz/video/firefox-indexed-seek-macosx.dmg"&gt;http://pearce.org.nz/video/firefox-indexed-seek-macosx.dmg&lt;/a&gt;&lt;br /&gt;&lt;a href="http://pearce.org.nz/video/firefox-indexed-seek-win32.zip"&gt;http://pearce.org.nz/video/firefox-indexed-seek-win32.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you already have a Firefox instance running, you'll need to either close your running Firefox instance before starting the index-capable Firefox, or start the index-capable Firefox with the &lt;tt&gt;--no-remote&lt;/tt&gt; command line parameter.&lt;br /&gt;To compare the network performance of indexed versus non-indexed seeking, point the index-capable Firefox to the &lt;a href="http://pearce.org.nz/video/indexed-seek-demo.html"&gt;indexed seek demo&lt;/a&gt; page.&lt;br /&gt;&lt;br /&gt;You should notice a clear speed difference when seeking to an &lt;i&gt;unbuffered&lt;/i&gt; position in the indexed media.&lt;br /&gt;&lt;br /&gt;The Skeleton 3.1 with Keyframe Index specification is still being developed, but we hope to lock it down soon. We are planning to ship support for keyframe index-assisted seeking in Firefox 3.7.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-1920722269149368525?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2010/01/indexing-keyframes-in-ogg-videos-for.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>10</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-560847036303377701</guid><pubDate>Fri, 20 Nov 2009 02:23:00 +0000</pubDate><atom:updated>2009-11-20T15:52:35.758+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>testing</category><category domain='http://www.blogger.com/atom/ns#'>vmware</category><category domain='http://www.blogger.com/atom/ns#'>debugging</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Replay Debugging mochitest failures with VMWare Workstation 7</title><description>Ever since my last&lt;a href="http://pearce.org.nz/2009/03/setting-up-vmware-to-record-replay-and.html"&gt; escapades with Replay Debugging&lt;/a&gt; in VMWare Workstation 6.5, I've been looking forward to improvements in this awesome technology. Thankfully the guys at VMWare have been hard at work, and now &lt;a href="http://www.vmware.com/products/workstation/"&gt;VMWare Workstation 7&lt;/a&gt; now boasts improved Replay Debugging. I've found it much more robust and reliable, and Roc and I have already used it to debug some &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=529105"&gt;random&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=518659"&gt;orange&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=526323"&gt;bugs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I've documented how to produce a Replay Debugging setup for debugging intermittent test failures in Mozilla mochitests, and put it up on MDC:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://developer.mozilla.org/En/Debugging/Record_and_Replay_Debugging_Firefox"&gt;https://developer.mozilla.org/En/Debugging/Record_and_Replay_Debugging_Firefox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now anyone can setup a machine to record and replay debug intermittent mochitests! A word of warning: you need a modern CPU in order to get good performance. I had poor performance when running on my two-year-old Core2Duo laptop, but replay performance is almost at real-time speeds on my shiny new Intel i7 950 box.&lt;br /&gt;&lt;br /&gt;I still have two patches that need to be refined and then checked in, to facilitate replay debugging. The first enables the mochitest harness to loop forever on a test directory. The second enables you to set break points on specific JavaScript dump() calls, so you can break during replay close to where the action is.&lt;br /&gt;&lt;br /&gt;We're far from having a fully automated record and replay setup, but we've made a start!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-560847036303377701?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2009/11/replay-debugging-mochitest-failures.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-6478392850593668346</guid><pubDate>Sun, 04 Oct 2009 20:37:00 +0000</pubDate><atom:updated>2009-10-05T09:39:55.066+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><category domain='http://www.blogger.com/atom/ns#'>build</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Problems building Firefox with Visual Studio 2005 and Windows 7 SDK</title><description>When I tried to update my 1.9.2 tree this morning on my Windows box I quickly discovered that Ben Hearsum had recently &lt;a href="http://blog.mozilla.com/bhearsum/archives/113"&gt;updated our build system to require the Windows 7 SDK&lt;/a&gt;. However once I installed the new SDK and tried to build (using Visual Studio 2005's compiler), I got the following error:&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-family: courier new;"&gt;shell32.lib(shguid.obj) : fatal error LNK1103: debugging information corrupt; recompile module.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a &lt;a href="http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/771e0f2f-8e2e-48a3-b987-349aabf15e24"&gt;compatibility issue between Visual Studio 2008 and Visual Studio 2005&lt;/a&gt;  which only occurs when you compile in debug mode. There's a &lt;a href="http://support.microsoft.com/kb/949009/"&gt;hotifx&lt;/a&gt; to resolve this issue. Once I installed this, I could magically build again. Thanks to biesi for pointing out the hotfix!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-6478392850593668346?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2009/10/problems-building-firefox-with-visual.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-5275777004627558531</guid><pubDate>Thu, 17 Sep 2009 23:17:00 +0000</pubDate><atom:updated>2009-09-18T11:25:18.085+12:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>video</category><category domain='http://www.blogger.com/atom/ns#'>ogg</category><category domain='http://www.blogger.com/atom/ns#'>seeking</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Ogg video seek performance improvements</title><description>I've recently landed &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=501031"&gt;bug 501031&lt;/a&gt; on mozilla-central and on 1.9.2 which roughly cuts Ogg seeking time in half. In Firefox 3.5, seeking Ogg Internet video was very slow, often taking 20 seconds or more to seek. This patch will make seeking in Ogg media in Firefox 3.6 much faster! This patch should also reduce the likelihood of encountering visual artefacts after a seek.&lt;br /&gt;&lt;br /&gt;Currently the Ogg format doesn't contain any kind of keyframe index, so when you want to seek to a given time you typically do a bisection search over the entire file, reading little chunks as you go to figure out where your bisection has landed. This works fine for files on disk, but when seeking in files served over the Internet this can be slow, especially when viewing media which is hosted half a world away.&lt;br /&gt;&lt;br /&gt;To play Ogg files, Firefox uses liboggplay, which in turn uses liboggz to seek. Unfortunately liboggz's seek bisection is in need of some maintenance (it's currently being rewritten by the maintainer). Its bisection is erratic and it fails to terminate its search appropriately, so it makes many more bisections than required. Most bisections or non-sequential reads result in a new HTTP connection, which is what makes this process slow for Internet video.&lt;br /&gt;&lt;br /&gt;My patch fixes liboggz's seek to bisect sensibly, and to end the bisection search when it lands within 500ms of the seek target. This means that once we land close enough to the seek target, we'll just keep downloading from there. This is typically faster than continuing the bisection search due to the latency in setting up HTTP requests. We subtract 500ms from the seek target before we begin the bisection search, so that we don't finish the seek &lt;i&gt;after&lt;/i&gt; the actual seek target.&lt;br /&gt;&lt;br /&gt;Theora stores its video data as keyframe and interframes. In order to seek to and display a frame at a given time, we need to seek to the previous keyframe and decode forward to the target frame. The suggested approach is to extract the keyframe's position from the frame's granulepos field, and then seek again to the keyframe. This second seek needs to be exactly right, and that's hard due to some &lt;a href="http://lists.xiph.org/pipermail/theora/2009-July/002549.html"&gt;nasty edge cases&lt;/a&gt; with regards to stream muxing. Doing another bisection search in our case is also slow due to the latency in setting up HTTP requests. So now we just calculate the maximum possible time-offset that a frame can be from its keyframe, and subtract that from our seek target. This means we will often download more data than necessary, but for us that's typically faster than doing another bisection search.&lt;br /&gt;&lt;br /&gt;The moral of the story is that if you want your video to seek quickly, include regular keyframes!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-5275777004627558531?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2009/09/ogg-video-seek-performance-improvements.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-7203963365933898669</guid><pubDate>Wed, 05 Aug 2009 00:37:00 +0000</pubDate><atom:updated>2009-08-06T16:28:35.267+12:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>video</category><category domain='http://www.blogger.com/atom/ns#'>ogg</category><category domain='http://www.blogger.com/atom/ns#'>seeking</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Configuring web servers for HTML5 Ogg video and audio</title><description>When serving HTML5 Ogg &amp;lt;video&amp;gt; or &amp;lt;audio&amp;gt; from your web server, there's a number of things you can do to make videos load faster. This post outlines how to configure your web server to improve HTML5 video and audio playback performance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Serve X-Content-Duration headers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Ogg format doesn't encapsulate the duration of the media. So for the progress bar on the video controls to display the duration of the video, we need to somehow determine the duration. You can either support HTTP1.1 Byte-Range requests (see 2. below) or better yet, serve an X-Content-Duration header for your Ogg videos. This provides the duration of the video in seconds (not HH:MM:SS format), as a floating point value. For example, a video which is 1 minute and 32.6 seconds would you'd serve the extra header: "X-Content-Duration: 92.6".&lt;br /&gt;&lt;br /&gt;When an Firefox requests an Ogg media, if you should serve up the X-Content-Duration header with the duration of the media. This means Firefox doesn't need to do any extra HTTP requests to seek to the end of the file to calculate the duration so it can display the progress bar.&lt;br /&gt;&lt;br /&gt;You can get the duration using oggz-info, which comes with oggz-tools. oggz-info gives output like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;nbsp;$&amp;nbsp;oggz-info&amp;nbsp;/g/media/bruce_vs_ironman.ogv&lt;br /&gt;&amp;nbsp;Content-Duration:&amp;nbsp;00:01:00.046&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Skeleton:&amp;nbsp;serialno&amp;nbsp;1976223438&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&amp;nbsp;packets&amp;nbsp;in&amp;nbsp;3&amp;nbsp;pages,&amp;nbsp;1.3&amp;nbsp;packets/page,&amp;nbsp;27.508%&amp;nbsp;Ogg&amp;nbsp;overhead&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Presentation-Time:&amp;nbsp;0.000&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Basetime:&amp;nbsp;0.000&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Theora:&amp;nbsp;serialno&amp;nbsp;0170995062&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1790&amp;nbsp;packets&amp;nbsp;in&amp;nbsp;1068&amp;nbsp;pages,&amp;nbsp;1.7&amp;nbsp;packets/page,&amp;nbsp;1.049%&amp;nbsp;Ogg&amp;nbsp;overhead&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Video-Framerate:&amp;nbsp;29.983&amp;nbsp;fps&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Video-Width:&amp;nbsp;640&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Video-Height:&amp;nbsp;360&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Vorbis:&amp;nbsp;serialno&amp;nbsp;0708996688&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4531&amp;nbsp;packets&amp;nbsp;in&amp;nbsp;167&amp;nbsp;pages,&amp;nbsp;27.1&amp;nbsp;packets/page,&amp;nbsp;1.408%&amp;nbsp;Ogg&amp;nbsp;overhead&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Audio-Samplerate:&amp;nbsp;44100&amp;nbsp;Hz&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Audio-Channels:&amp;nbsp;2&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Note that you can't just serve up the Content-Duration line that oggz-info outputs, it's in HH:MM:SS.ss format, you need to convert it to seconds only, and serve it as X-Content-Duration.&lt;br /&gt;&lt;br /&gt;Be warned, it looks like oggz-info makes one read pass of the media in order to calculate the duration, so it would be wise to store the duration value, and not to calculate it for every HTTP request of every Ogg video.&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;Also be aware that oggz-info does not calculate the duration of videos that start at a non-zero time correctly. oggz-info reports the duration as the time of the last frame, not the time of the last frame, minus the time of the first frame.&lt;/strike&gt; &lt;i&gt;Edit - 6 Aug 2009: Looks like this was only true for old versions of oggz-info, current versions use the presentation time from the &lt;a href="http://www.xiph.org/ogg/doc/skeleton.html"&gt;skeleton track&lt;/a&gt; to calculate the duration correctly.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Handle HTTP1.1 byte range requests correctly&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In order to seek to and play back regions of the media which aren't yet downloaded, Firefox uses HTTP1.1 Byte Range requests to retrieve the media from the seeek target position. Also if you don't serve X-Content-Duration, we use byte-range requests to seek to the end of the media (provided you're serving Content-Length) to determine the duration of the media.&lt;br /&gt;&lt;br /&gt;Your server should serve the "Accept-Ranges: bytes" HTTP header if it can accept byte-range requests. It must return "206: Partial content" to all byte range requests, else Firefox can't be sure you actually support byte range requests. Remember you must return "206: Partial Content" for requests for "Range: bytes=0-" as well.&lt;br /&gt;&lt;br /&gt;If you're curious, see &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=502894#c1"&gt;bug 502894 comment 1&lt;/a&gt; for more details of the HTTP requests Firefox can make and why.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Include regular key frames&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When we seek, we have to seek to the keyframe before the seek target, and then download and decode from there until we reach the actual target time. The further your keyframes are apart, the longer this takes, so include regular keyframes. &lt;a href="http://v2v.cc/%7Ej/ffmpeg2theora/"&gt;ffmpeg2theora&lt;/a&gt;'s default of one keyframe every 64 frames (or about every 2 seconds) seems to work ok, but be aware that the more keyframes you have, the larger your video file will be, so your mileage may vary.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. Serve the correct mime-type&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For *.ogg and *.ogv files containing video (possibly with an audio track as well), serve the video/ogg mime type. For *.oga and *.ogg files which contain only audio, serve the audio/ogg. For *.ogg files with unknown contents, you can serve application/ogg, and we'll treat it as a video file. Most servers don't yet serve the correct mime-type for *.ogv and *.oga files.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5. Consider using autobuffer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have the autobuffer attribute set to true for your video or audio element, Firefox will attempt to download the entire media when the page loads. Otherwise, Firefox only downloads enough of the media to display the first video frame, and to determine the duration. autobuffer is off by default, so for a YouTube style video hosting site, your users may appreciate you setting autobuffer="true" for some video elements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-7203963365933898669?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2009/08/configuring-web-servers-for-html5-ogg.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>6</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-466483371627381690</guid><pubDate>Thu, 21 May 2009 22:28:00 +0000</pubDate><atom:updated>2009-05-22T11:48:48.100+12:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>video</category><category domain='http://www.blogger.com/atom/ns#'>ogg</category><category domain='http://www.blogger.com/atom/ns#'>seeking</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Video seeking improvements</title><description>I've recently been working on improving seeking in the video element in Firefox. Two important bugs have been fixed: &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=469408"&gt;Speeding  up seeking&lt;/a&gt; and &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=463358"&gt;removing  artifacts while seeking&lt;/a&gt;. Combined these make seeking in the video element a vastly improved user experience!&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="https://bugzilla.mozilla.org/show_bug.cgi?id=469408"&gt;Speeding up seeking&lt;/a&gt; - we use liboggplay, which in turn uses liboggz for seeking. Ogg doesn't have any kind of byte-offset to time index for the media it contains, so liboggz basically does something similar to a binary search over the media to implement seeking. This is fine for a file stored on your local disk, but for a file served over the internet we must do a new HTTP byte-range request for every bisection, which is slow. To speed up seeking, we now ask Roc's &lt;a href="http://weblogs.mozillazine.org/roc/archives/2009/04/media_cache.html"&gt;media cache&lt;/a&gt; what byte-ranges of the media are already downloaded, and we try to seek inside those regions first, before falling back to the slower seek over the entire resource. Seeking inside buffered ranges is practically instantaneous, and so seeking to parts of the video which are downloaded is now instantaneous.&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463358"&gt;Removing  artifacts while seeking&lt;/a&gt; - when we seek to a time position, liboggplay returns the next video frame after that time position. But if the frame after the seek time position is an &lt;a href="http://en.wikipedia.org/wiki/Inter_frame"&gt;inter frame&lt;/a&gt;, which only encodes what's different from the previous frame, liboggplay returns a garbage frame. The problem is that when liboggplay decodes the inter frame, it doesn't apply the inter frame to the frame that was actually prior to the inter frame, it applies the inter frame to some other frame (maybe the key frame from the previously playing segment?). For example, if you seek &lt;a href="http://tinyvid.tv/show/jepwm7ewh6ir"&gt;Bruce Lee vs. Iron Man&lt;/a&gt; to 5 seconds, the result is something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://pearce.org.nz/uploaded_images/bruce-746160.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 180px;" src="http://pearce.org.nz/uploaded_images/bruce-746158.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;But that frame should actually look like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://pearce.org.nz/uploaded_images/ironman-794578.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 180px;" src="http://pearce.org.nz/uploaded_images/ironman-794576.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;So the fix is conceptually simple; we need to seek to the key frame before the seek position, and then decode forward to the frame we're looking for. &lt;a href="http://www.xiph.org/vorbis/doc/framing.html"&gt;Ogg encodes its media data in pages&lt;/a&gt;, and each page contains a &lt;a href="http://wiki.xiph.org/index.php/GranulePosAndSeeking"&gt;granulepos&lt;/a&gt;, which encodes the time of the key frame from which the frames in that page are based upon. So during the seek bisection, once we find the page containing the inter frame we want, we then know the time of the key frame we need to decode forward from. We can then seek again to that time to get the key frame and can then decode forward to the desired seek time without visual artifacts! There was one &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=493958"&gt;minor complication with a/v sync&lt;/a&gt;, but apart from that it works pretty well. There's still a bug somewhere, as &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=494305"&gt;sometimes we don't seek back to the keyframe correctly&lt;/a&gt;, but for the majority of cases it works perfectly, and is a vast improvement!&lt;br /&gt;&lt;br /&gt;One issue with this approach is that if a video doesn't have regular key frames, we'll still seek back to the previous key frame and decode forward. If the key frame is several minutes back, performance can be pretty bad. The moral of the story, is that for good seeking performance, you want your encoder to inject regular key frames into your video!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-466483371627381690?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2009/05/video-seeking-improvements.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>6</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-4940760598207637196</guid><pubDate>Thu, 12 Mar 2009 21:55:00 +0000</pubDate><atom:updated>2009-03-24T14:38:35.306+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>testing</category><category domain='http://www.blogger.com/atom/ns#'>vmware</category><category domain='http://www.blogger.com/atom/ns#'>debugging</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Setting up VMware to record, replay and debug intermittent Mochitest failures</title><description>Over the past few days I've been working to get &lt;a href="http://www.replaydebugging.com/"&gt;VMware Workstation's Replay Debugging&lt;/a&gt; to work on Mozilla’s Mochitest suite. It's been a long process, but I've finally got something that records and can be replay-debugged! Replay debugging allows us to record everything that happens in a virtual machine, and then replay it back and step through the execution in a debugger. Often when we have an intermittent test failure, it's hard to reproduce (hence it's intermittent-ness). Now I can record a VM running Mochitests and if I record a test failure, I can replay the execution and step-through and see exactly what code paths where followed and hopefully figure out why. This is powerful, as it means we can deterministically and repeatedly reproduce an intermittent test failure in a debugger, making them a lot easier to debug.&lt;br /&gt;&lt;br /&gt;Using replay debugging to debug intermittent test failures was originally Robert O'Callahan's idea. He had trouble setting this up on Linux, so he suggested I try it on Windows. It took a lot of messing around, but finally it works. The key lessons learned are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create the record-and-replay build on a network drive mapped to the same path on both your host and guest systems. This means that the debug symbols have the same path to source files embedded in them on both systems. Also paths compiled into the executable (e.g.: assertion __FILE__:__LINE__ messages) are valid on both systems.&lt;/li&gt;&lt;li&gt;When creating a recording of Firefox, start the recording before you start Firefox. I suspect that the replay-debugger must observe the DLLs being loaded at program startup in order to load debug symbols and thus allow the debugger to function.&lt;/li&gt;&lt;li&gt;The settings for replay debugging and for remote debugging are totally unrelated.&lt;/li&gt;&lt;li&gt;Project &gt; Properties &gt; Debugging &gt; Command is the path to the executable which ran in the VM recording which the debugger will try to connect to when replaying. &lt;/li&gt;&lt;li&gt;Your build needs to be --enable-libxul --disable-static.&lt;/li&gt;&lt;/ul&gt;It took a lot of messing around, so for my own record, and for the use of anyone who also wants to set up recording and replay-debugging of a Mochitest run, the exact steps I went through are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt; Get a Windows machine with a supported CPU. Originally I had tried to set this up on a boot-camped Mac Mini, but that had a Core Duo processor, which is unsupported. My Vista laptop has a Core 2 Duo processor which is supported, so I've been working on that.&lt;/li&gt;&lt;li&gt; Install Visual Studio Professional on your host system. Microsoft has a free &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=83c3a1ec-ed72-4a79-8961-25635db0192b&amp;amp;displaylang=en"&gt;90 day Trial of Visual Studio 2008 Professional&lt;/a&gt; available for download. &lt;strike&gt;VMware recommend you use 2005 Professional, but&lt;/strike&gt; I've successfully used both 2005 and 2008.  You'll need the &lt;a href="https://developer.mozilla.org/En/Windows_Build_Prerequisites"&gt;build prerequisites&lt;/a&gt; for this installed of course.&lt;/li&gt;&lt;li&gt;Install VMware Workstation 6.5 on your host system. You must install this after Visual Studio, else its debugger plugin won't show up in Visual Studio.&lt;/li&gt;&lt;li&gt;Install a Windows OS in your VM. This is the "guest" system. I installed Windows XP SP3.&lt;/li&gt;&lt;li&gt;&lt;strike&gt;Install Visual Studio Professional on your guest system. You need this because it installs the Remote Debug Monitor. Visual Studio Express versions don't have this.&lt;/strike&gt; &lt;i&gt;Edit: Only required for remote debugging, not replay.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;strike&gt;In your guest Windows OS, disable Windows Firewall. You can do this by running "firewall.cpl" at the command prompt.&lt;/strike&gt; &lt;i&gt;Edit: Only required for remote debugging, not replay.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;strike&gt;In your guest Windows OS, set the security policy for "Network access: Sharing and security model for local accounts" to be "Classic - local users authenticate as themselves". You can access this from Control Panel &gt; Administrative Tools &gt; Local Security Policy &gt; Local Policies. This setting allows the remote debugger to log into the VM system.&lt;/strike&gt; &lt;i&gt;Edit: Only required for remote debugging, not replay.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Create a network drive, and map it in both your host and guest system to the same path. This will store the builds you test, and ensure that the builds have symbols which have valid paths for both the host and guest machines. I created a new drive Z: on my host system. It was stored on an external hard disk, as my laptop's always running very low on space. You'll need lots of disk space.&lt;/li&gt;&lt;li&gt;It's a good idea to create a VM snapshot after setting up everything, so that these settings can't be lost. Every time you replay, the state of the VM is reset to the start of the recording. The state is also reset to the "initial snapshot" if you try to create a recording from inside Visual Studio. The state is saved if you shutdown the VM normally. This can wipe settings if you're not careful.&lt;/li&gt;&lt;li&gt;Check out the appropriate Mozilla source tree to the network drive.&lt;/li&gt;&lt;li&gt;Build your tree on the network drive. Ensure your build is an enable-libxul disable-static build, i.e. add to your .mozconfig: "ac_add_options --enable-libxul --disable-static". Without this I found that some the symbols for some DLLs weren't loaded (gklayout.gll in particular), so I couldn't set breakpoints where I wanted. I found building on a network drive took about 2.5 times longer than a normal build.&lt;/li&gt;&lt;li&gt;Create a new project in Visual Studio. You can't just create a project by opening an EXE file, the VMware menu is greyed out if you do this. You must create a new project file using the File &gt; New &gt; Project &gt; Win32 &gt; Win32 Console Application. I opted to create an empty project, and that works fine for our purposes.&lt;/li&gt;&lt;li&gt;Configure Project &gt; Properties &gt; Debugging and enter the Command as the path to firefox.exe on your network drive.&lt;/li&gt;&lt;li&gt;Boot up your guest operating system in your virtual machine. Start a new recording in your VM. We're going to create a recording from inside the VM, rather than initiating the recording from Visual Studio. This is important, because we can't (at least not easily) launch a Mochitest run in an MSYS shell in the guest operating system from inside the Visual Studio debugger. It's much simpler to just record the virtual machine while it's doing a Mochitest run. You must start the recording before firefox.exe starts up however, else the debugger may not connect to it when you replay.&lt;/li&gt;&lt;li&gt;In the guest operating system, run Mochitests until you reproduce a failure, timeout etc. Stop the recording.&lt;/li&gt;&lt;li&gt;In Visual Studio on the host system, configure VMWare. Open menu item VMWare &gt; Options &gt; Replay Debugging in VM. Set "Virtual Machine" to point to your VMX file for your guest operating system. Set "Recording to Replay" to the name of the recording you just recorded.&lt;/li&gt;&lt;li&gt;In Visual Studio on the host system, open the source files you want to put break points in from your network drive. Set breakpoints in them.&lt;/li&gt;&lt;li&gt;Press the "Debug an application running inside of a recording" button on the toolbar, or VMware &gt; Start Replay Debugging.&lt;/li&gt;&lt;li&gt;The VM will start replaying the recording. It will be slow, and will take a few minutes to start up, but assuming you're configured correctly, it should replay, and execution should break on your break points. If the recording fails to start, check for error messages in the VMware output window in Visual Studio.&lt;/li&gt;&lt;/ol&gt;That's it! All the black magic required should be outlined above. Now, to fix some intermittent test failures...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-4940760598207637196?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2009/03/setting-up-vmware-to-record-replay-and.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>5</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-7108327663529752151</guid><pubDate>Wed, 29 Oct 2008 00:48:00 +0000</pubDate><atom:updated>2008-10-29T14:02:10.490+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>space</category><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Dreams of manned space flight</title><description>I'm in Mountain View this week, for the Mozilla Platform team work week. Matthew and I went up to the NASA Ames Research Center on Sunday, which was awesome. There were some interesting exhibits there, including a moon rock, which was protected by two layers of perspex glass. They also did a cool presentation on the Spirit/Opportunity and Phoenix Mars missions. They detailed the landing sequence and the activities of the robotic landers. They complained about how budgets where always cut, and compared the cost of manned space flight against robotic missions.&lt;br /&gt;&lt;br /&gt;Amongst the NASA scientists, there exists two camps, one whose argument is that it's currently unnecessary and too expensive to send manned missions, the other camp believes that it's human nature to explore, therefore we should go. I used to believe that people should go, if I was offered a ticket I wouldn't hesitate, but I can't agree with the "human nature" agrument. It's also human nature to conquer, fight and steal. It's not justifiable to say that we should do those things just because it's in our nature, so how can we apply that argument to other pursuits?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-7108327663529752151?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2008/10/dreams-of-manned-space-flight.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5537325711190185140.post-1262337859994152098</guid><pubDate>Fri, 24 Oct 2008 01:32:00 +0000</pubDate><atom:updated>2008-10-24T23:56:50.172+13:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>mozilla</category><title>Beware the light at the end of the tunnel. It may be a train.</title><description>I now have a blog! I will mostly cover software engineering stuff, with the odd extra curricular musing as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5537325711190185140-1262337859994152098?l=blog.pearce.org.nz' alt='' /&gt;&lt;/div&gt;</description><link>http://blog.pearce.org.nz/2008/10/beware-light-at-end-of-tunnel-it-may-be.html</link><author>noreply@blogger.com (Chris Pearce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>