[theora-dev] Keyframe seeking in Ogg and spec

Ralph Giles zen6669 at zen.co.uk
Mon Sep 16 13:27:08 PDT 2002



On Monday, Sep 16, 2002, at 20:43 Europe/London, Tabuleiro wrote:

> One problem I see with your proposed implementation is that it does not
> specify how audio and video would be synchronized, since there are no
> absolute time stamps for the video frames. So it is difficult to 
> account for
> audio latency on different systems, much like when you play an AVI 
> file.
> Ideally it would be wonderful to have timestamps that could be used to
> synchronize audio and video in a meaningful way, and if I understand it
> correctly the proposed granulepos formats do not address this.

The timestamps don't have to be explicit in the file; in all the 
schemes monty proposed the absolute frame number can be calculated from 
the granulepos or the granulepos + some state information in the 
decoder. With the frame rate, you can then infer when the frame should 
be displayed relative to the audio playback or whatever clock you're 
using.

> Of course, it may be that the ogg stream does not need to know anything
> about the duration of each frame in milliseconds and its position in 
> time,
> but I find it difficult to believe.

The ogg layer does not. A multiplexing, streaming or encoding tool 
well. In the xiph model all these things happen above the ogg layer. 
However, conventions for optimum interleave and so on will have to be 
developed and likely spec'd. That's part of what's going on right now.

> As an application writer I would like to
> know things about the file I have just opened, or some high level api 
> should
> be able to provide this info to me.

Yes, of course.

>  The big question is if you want to
> squish this info in the vp3 stream or in the ogg stream, imo. The 
> current
> VP3 stream does not provide this info, it is all provided in the avi 
> or qt
> standard header structures.

For ogg it needs to be provided in a header packet (or three) at the 
start of the stream. The information is handled by the codec however. 
In this respect the ogg bitstream format is much more specific than qt 
or vfw. One might also say it doesn't confuse itself with its api. :)

> Of course these are not "official" ogg files. People have been trying 
> to
> guess a recipe to add video frames to an ogg stream, and each one is 
> using a
> different strategy for the granulepos field, for example, and sometimes
> leveraging the synchronization capabilities of other architectures.. I
> understand that once we have an "official" way to mark video streams 
> this
> problem will be alleviated ...

I'd look at it more that we'd just come up with a better and more 
general and clean solution, worthy of being adopted.

Cheers,
  -r

--- >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