<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
Back by popular demand, a new version of OggIndex, which encapsulates
the keyframe index in the skeleton track. Available here:
<a class="moz-txt-link-freetext"
 href="http://github.com/cpearce/OggIndex/tree/skeleton-index-per-stream">http://github.com/cpearce/OggIndex/tree/skeleton-index-per-stream</a><br>
<br>
I added a few fields to the skeleton ident header, and added "index"
packets after the "fisbone" packets. I increased the skeleton version
field to 3.1. Below is the skeleton track specification I used.<br>
<br>
<br>
<div class="highlight">
<pre><div class="line" id="LC1">Skeleton 3.1 Spec - Includes one "index" packet per stream.</div><div
 class="line" id="LC2">&nbsp;</div><div class="line" id="LC3">Skeleton header packet:</div><div
 class="line" id="LC4">&nbsp;</div><div class="line" id="LC5">1.  Identifier: 8 bytes, "fishead\0".</div><div
 class="line" id="LC6">2.  Version major: 2 Byte unsigned integer signifying the major (3)</div><div
 class="line" id="LC7">3.  Version minor: 2 Byte unsigned integer signifying the minor (1)</div><div
 class="line" id="LC8">4.  Presentationtime numerator: 8 Byte signed integer</div><div
 class="line" id="LC9">5.  Presentationtime denominator: 8 Byte signed integer</div><div
 class="line" id="LC10">6.  Basetime numerator: 8 Byte signed integer</div><div
 class="line" id="LC11">7.  Basetime denominator: 8 Byte signed integer</div><div
 class="line" id="LC12">8.  UTC [ISO8601]: a 20 Byte string containing a UTC time</div><div
 class="line" id="LC13">9.  [NEW] Start time, the presentation time in milliseconds of the</div><div
 class="line" id="LC14">&nbsp;&nbsp;&nbsp;&nbsp;first sample in the media. 8 byte signed integer, -1 if unknown.</div><div
 class="line" id="LC15">&nbsp;&nbsp;&nbsp;&nbsp;Note that samples between the Start time and the Presentationtime</div><div
 class="line" id="LC16">&nbsp;&nbsp;&nbsp;&nbsp;are not supposed to be shown.</div><div
 class="line" id="LC17">10. [NEW] End time, the end time of the last sample in the media.</div><div
 class="line" id="LC18">&nbsp;&nbsp;&nbsp;&nbsp;8 byte signed integer, -1 if unknown.</div><div
 class="line" id="LC19">11. [NEW] The length of the segment, in bytes: 8 byte signed integer,</div><div
 class="line" id="LC20">&nbsp;&nbsp;&nbsp;&nbsp;-1 if unknown.</div><div class="line"
 id="LC21">&nbsp;</div><div class="line" id="LC22">Skeleton 'fisbone\0' packets as per skeleton track 3.0, one per stream.</div><div
 class="line" id="LC23">&nbsp;</div><div class="line" id="LC24">[NEW] Skeleton index packets. There should be one per content stream,
coming after the fisbone packets, before the skeleton eos packet:</div><div
 class="line" id="LC25">&nbsp;</div><div class="line" id="LC26">1. Identifier 6 bytes: "index\0"</div><div
 class="line" id="LC27">2. The serialno of the stream as a 4 byte field.</div><div
 class="line" id="LC28">3. The number of keypoints in the index packet, 'n' as a 4 byte</div><div
 class="line" id="LC29">&nbsp;&nbsp;&nbsp;unsigned integer. This can be 0.</div><div
 class="line" id="LC30">4. 'n' key points, each of which contain, in the following order:</div><div
 class="line" id="LC31">&nbsp;&nbsp;&nbsp;&nbsp;- the page's byte offset as an 8 byte unsigned integer, followed by</div><div
 class="line" id="LC32">&nbsp;&nbsp;&nbsp;&nbsp;- the checksum of the page found at the offset, as a 4 byte field,</div><div
 class="line" id="LC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;followed by</div><div class="line"
 id="LC34">&nbsp;&nbsp;&nbsp;&nbsp;- the presentation time in milliseconds of the key point, as an 8</div><div
 class="line" id="LC35">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;byte unsigned integer. </div>
</pre>
</div>
Existing player compatibility with index-in-skeleton and
index-in-index-track files:<br>
<ul>
  <li>Firefox 3.5.3 plays the index-in-skeleton files, purely by luck,
whereas it can't get the duration of index-in-index-track files due to
a bug in liboggz. Firefox3.5 uses liboggplay, which assumes any
skeleton packet which doesn't have "fishead" magic bytes is a "fisbone"
packet. It's possible that a skeleton index packet
would break FF3.5 due to being parsed as a fisbone packet. So
regardless
of which approach we took, we'd have to patch Firefox 3.5.x. </li>
  <li>The ogg DirectShow codecs work ok with index-in-skeleton files,
but seeks in index-in-index-track files result in a seek to 0.</li>
  <li>VLC - plays both index-in-skeleton and index-in-index-track
files,&nbsp; but seeks to 0 in index-in-skeleton files result in the video
window disappearing, but the media can still be played again after this
happens.</li>
  <li>XiphQT - plays and seeks (inside buffered ranges) with both types
of files<br>
  </li>
  <li>Totem/gstreamer - with both index-in-skeleton and
index-in-index-track files, Totem/gstreamer prompts for a missing
plugin
on load, but will still
play the file. All seeks just reset playback position to 0. I assume
gstreamer must be checking the skeleton version field, and/or prompting
when
it reads the packets/tracks with unrecognized magic bytes.</li>
</ul>
Firefox index-in-skeleton capable builds available for download here:<br>
<a class="moz-txt-link-freetext"
 href="http://build.mozilla.org/tryserver-builds/cpearce@mozilla.com-try-b7b626658548">http://build.mozilla.org/tryserver-builds/cpearce@mozilla.com-try-b7b626658548</a><br>
<br>
Indexed videos for testing available here:<br>
<a class="moz-txt-link-freetext" href="http://pearce.org.nz/video/">http://pearce.org.nz/video/</a><br>
<br>
<br>
Chris P.<br>
<br>
</body>
</html>