[Live-devel] How to synchronize audio and video[already read FAQ]

Shixin Zeng shixinzeng at gmail.com
Mon Aug 1 16:38:41 PDT 2005


On 7/31/05, Ross Finlayson <finlayson at live.com> wrote:
> 
> 
> >What's wrong with my codes?
> 
> I don't know. (In general, I don't have time to debug people's
> custom code - except for our consulting clients.) However, in your
> receiver, you can try calling
> "RTPSource::hasBeenSynchronizedUsingRTCP()" for each received packet,
> to check if/when RTCP "Sender Reports" (from the server) ever get
> used to compute a synchronized presentation time. (Until the first
> RTCP "Sender Report" is received, the receiving code uses 'wall
> clock' time as the presentation time.)


Yes, I've tried HasBeenSynchronizedUsingRTCP().
when this function return true, the presentation time would be adjusted, but 
there are still some problems.
In my case:
On the server peer, I created my own MediaSource, and send it via 
SimpleRTPSink, an RTCPInstance is asocciated with the source and the sink.
On the client peer, I created my Own MediaSink, and receive the data via 
SimpleRTPSource. An RTCPInstance is asocciated with the source and the sink, 
too.

In my own MediaSource::doGetNextFrame: for the first frame, I set the 
fPresentationTime with the result of gettimeofday(), and increase it by 3 
seconds for each following frame.

The problem prompted to me is:

If I launch the client immediately after the server start, so that the 
client could receive the first frame, the presentation the client received 
would be correct for some time(about 300~700 frames, a frame per packet). At 
some point, the presentation time would jump suddently(I guess another RTCP 
SR was received), it wouldn't be correct, and never be correct again.

if I launch the client some time later than the server, so that the first 
frame is lost, the presentation time would never be correct from the 
beginning.


Thanks for your help


-- 
Best regards

Shixin Zeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live.com/pipermail/live-devel/attachments/20050801/316fa4c8/attachment.html


More information about the live-devel mailing list