[Theora] ogg + theora + seeking

Ralph Giles giles at xiph.org
Tue Apr 4 12:39:47 PDT 2006


On Tue, Apr 04, 2006 at 08:20:34PM +0200, Tom wrote:

> And I wrote a small program to print out all ogg-packet-headers in a file. 
> (Output at the end).
> There I don't see any key-frame or "not key-frame" from the position 
> information.

The division point between the two parts of the granulepos field is 
variable per-logical-stream. It is stored as a 5 bit integer in the 
first theora header packet (the KFGSHIFT field in the spec). So you
need to parse that before you can correctly interpret the numbers.

If you don't know the "keyframe shift" as it's called, a keyframe
will show up (usually; there's an edge case) as a discontinuous 
jump in the granulepos, which normally increments once per data
packet. 

BTW, the oggzdump utility included with Conrad's excellent liboggz 
package already produces this kind of output for theora if you'd like
something to debug against.

HTH and keep us posted. A stream splicer for Ogg Theora is an 
oft-requested tool. :)

 -r


More information about the Theora mailing list