[theora-dev] Keyframe seeking in Ogg and spec

Tabuleiro beta at tabuleiro.com
Mon Sep 16 13:23:08 PDT 2002



> That's true. On the other hand the timing information is handled by the
> codec layer and not on the Ogg layer. So it is sufficient if the codec
> can reconstruct the time information. Anyway it would be more convenient
> to have the same time base.
> In Ogg DSF I convert samples/frames to a reference time to get them in
> sync. Therefore the number of frames/sec is stored in the header as the
> number of samples in "vi.rate"

Great. So what you are saying is that once you know the frame rate for the
default video you just pass it in the header, and each granulepos indicates
a frame number. Then the codec reconstructs the absolute time by multiplying
the frame number by the specified rate. It should work fine, unless you want
to add variable times for each video frame, which we probably don't ( I
don't, at least :) )
And what you do when you want to invoke a seek operation? I assume you seek
on the audio, and starts getting video data (discarded until it reaches a
keyframe.) True?
BTW, I looked at the VP3 code and the codec can tell if a frame is a
keyframe or not without any extra header information. Is it the case to
simply mark each sample incrementally (option 1 as suggested previously by
Monty) and let the higher layers take care of seeking until they find a
keyframe (or cache their position as they pass?)

> There is no need to store the length. If it is just one stream you can
> go to the end of the file, take the last "granulepos". You have just to
> convert it in to a meaningful unit like time.

Of course, thanks! This addresses the problem for file based access (or fast
seeking media), my main concerns. So it looks it can be done with a simple
header page indicating frame rate and video dimensions, assuming we do not
use variable frame rates.

Regards,
Mauricio Piacentini
Tabuleiro

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'theora-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Theora-dev mailing list