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

Scott Hays sdhays at neon.com.tw
Tue Aug 2 17:35:44 PDT 2005


Why are you incrementing your presentation time by 3 seconds for every 
frame?  Are you actually just sending 1 frame every 3 seconds? 
Otherwise the RTCP time, which is generated from gettimeofday(), will 
quickly be FAR behind your presentation times.

Scott

Shixin Zeng wrote:
> 
> 
> On 7/31/05, *Ross Finlayson* <finlayson at live.com 
> <mailto: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
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live.com
> http://lists.live.com/mailman/listinfo/live-devel


More information about the live-devel mailing list