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

Shixin Zeng shixinzeng at gmail.com
Tue Aug 2 23:02:44 PDT 2005


On 8/2/05, Scott Hays <sdhays at neon.com.tw> wrote:
> 
> 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.


I'm just learning how presentation time works, so I generate pseudo frames 
and pseudo presentation time.

yes, it's the root of the problem, I've found it this morning. The 
frequency(48000) was too high and presention time increased too fast, so the 
rtpTimestamp overflowed quickly. This resulting in the problem.

Thanks for your kind help.

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
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live.com
> http://lists.live.com/mailman/listinfo/live-devel
> 



-- 
Best regards

Shixin Zeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live.com/pipermail/live-devel/attachments/20050802/46b24fc3/attachment.html


More information about the live-devel mailing list