[Live-devel] fPresentationTime calculation for ogg streaming?

Derk-Jan Hartman hartman at videolan.org
Fri Oct 1 13:14:35 PDT 2004


On 01 okt 2004, at 06:52, Ross Finlayson wrote:
>> I am trying to add ogg streaming support into
>> livemedia library. I have written a simple multiplexer
>> to seprate audio data and video data. My problem is
>> when I send them  I don't know how to calculate the
>> presentationTime for audio and video frames. (I use
>> vorbis codec for audio and vp3 codec for video). To
>> stream them successfuly, the synchronization is most
>> important. Otherwise, either audio or video will be
>> displayed incorrectly.
>>
>> Who can help me to give me a method? Assuming we have
>> known frame size, sampling rate.  and what else? we
>> can calculate the presentation time for this vorbis
>> frame.
>
> Unfortunately I'm not very familiar with the 'ogg' file format, so I 
> can't help you much here.  But try to imagine how a media player is 
> able to play an 'ogg' file.  It has to be able to know exactly when to 
> play each audio and video frame in the file.  So, if you can figure 
> this out, this will tell you what presentation times to give each 
> frame.

ogm fileformat is a hell if you want to support it all.
Try looking at the ogm demux in VLC (modules/demux/ogg.c). It has the 
info you will need.

DJ

---
Universiteit Twente
Derk-Jan Hartman (d.hartman at student.utwente dot nl)
http://home.student.utwente.nl/d.hartman



More information about the live-devel mailing list