[whatwg] <video> element feedback

Ralph Giles giles at xiph.org
Sat Mar 24 12:11:43 PDT 2007

On Sat, Mar 24, 2007 at 01:57:45AM -0700, Kevin Marks wrote:

> How does one seek a Vorbis file with video in and recover framing?
> It looks like you skip to an arbitrary point and scan for 'OggS' then
> do a 64kB CRC to make sure this isn't a fluke. Then you have some
> packets that correspond to some part of a frame of video or audio.
> You recover a timestamp, and thus you can pick another random point
> and do a binary chop until you hit the timestamp before the one you
> wanted. Then you need to read pages until the timestamp changes and
> you have resynced that stream. Any other interleaved streams are
> presumably being resync'd in parallel so you can then get back to the
> read and skip framing. Try doing that from a CD-ROM.
> Do let me know if that has since been fixed.

Nope. That's still the algorithm. Also add that for a keyframe-based 
codec you need to (conceptually) seek again, after you've found the 
desired start point, to feed the decoder from the nearest previous 
restart point.

In practice, not everyone tries for sample-accurate seeking. I gather
the situation is similar with DVD playback.

Streamability (in the unix pipe sense of an unseekable file stream) was 
a design goal for Ogg. This seek algorithm is a consequence. Decoders 
must handle seeking without an index table, so we have regarded the
use of one, whether cached in the file or not, as an implementation 


More information about the whatwg mailing list