[Theora] ogg + theora + seeking

Tom th.tom at gmx.de
Wed Apr 5 01:27:55 PDT 2006


Hey Ralph,

many thanks for your information. I will further work on this and let you know 
about the progress ;-) (ok ... I think, i will have some more questions soon)

Best regard

PS: thanks to the hint of oggzdump - very useful ;-). However, I did my debug 
output just for my own understanding of the ogg stream and how I could handle 
it in my program. 

Am Dienstag, 4. April 2006 22:14 schrieb Ralph Giles:
> On Tue, Apr 04, 2006 at 08:20:34PM +0200, Tom wrote:
> > I read the following for seeking in ogg for a theora key-frame:
>
> I should probably also mention that it's possible to identify theora
> keyframes just by examining the first byte of the packet. See the source
> for theora_packet_iskeyframe() in libtheora.
>
> That's only helpful if you're doing a linear scan, of course. The idea
> with seeking is that (a) you need to know the keyframe granule shift so
> you can convert the theora page granulepos fields to a time value, and
> thus use them to inform a bisection search for the target seek point.
> Once you are there you can (b) use the odd two-part granulepos at the
> seek point to calculate the time offset to the previous keyframe and
> thus seek *again* for a point where you can actually begin decoding.
>
> HTH,
>  -r


More information about the Theora mailing list