[theora-dev] A/V sync in Theora

David Kuehling dvdkhlng at gmx.de
Thu Jun 12 09:30:12 PDT 2003



Hi,

I've been thinking about how a Theora encoder could be integrated into
mencoder or transcode and I'm not sure whether I understand the A/V sync
strategy of Theora/Vorbis correctly.  

When transcoding from some video format (ie MPEG2 or DivX), at least
some images of the video stream will have time stamps, as well as the
fragments of the audio stream.  Or at least time stamps can be generated
somehow (AVI is said to be somewhat weird...).  

The player would compare those time stamps to get the A-V delay and
adjust playback speed accordingly to not let audio and video drift too
much.  

What I do not understand is, how I could preserve timestamps when
encoding to Theora/Vorbis without dropping frames or resample audio.
>From what I know from Mplayer's Ogg demuxer, Theora's granulepos can
only represent multiples of the frametime.  Vorbis's granulepos is
specified in units of audio samples.

Is ist valid for Vorbis packets to drift the granulepos to compensate
for A/V sync?  That would mean that granulepos does not represent the
number of actually played samples any more.  Seems like an ugly hack.

Any other ideas?

David

-- 
GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40

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