[Live-devel] AV Sync for live input

Ross Finlayson finlayson at live555.com
Mon Jun 11 13:18:33 PDT 2012


> I have RTSP ServerMediaSession with one audio subsession and one video subsession. 
> The sources for audio and video are live and coming as RTP streams whose timestamps are derived from same source. 
> ( I subclassed OnDemandServerMediaSubsession to take live RTP input)
> 
> The RTSP client is able to receive both audio and video data , but there is no AV-Sync.
> When i checked,  the  RTP source timestamps and timestamps of packets sent to client are different. 

You should not concern yourself with RTP timestamps at all.   They are used only internally, by the RTP/RTCP implementation.

Instead, the only values that you need to concern yourself with are "presentation times" (which are computed automatically to/from RTP timestamps by our code).

In summary, to get proper audio/video synchronization, all of the following must be true:
1/ Each media source (audio and video) needs to have proper presentation times for each frame, and these presentation times need to be aligned with 'wall clock' time (i.e., the time that you would get by calling "gettimeofday()").
2/ Each "RTPSource" (subclass) object needs to have an associated "RTCPInstance" object.  (Because you are using a subclass of "OnDemandServerMediaSubsession", then this happens automatically for you.)
3/ RTCP "SR" packets from the server need to be received by the client, and the client needs to properly use these to compute the presentation times (and thereby do a/v sync).  If you are using our RTSP/RTP client code (including VLC or MPlayer, which uses our client code), then this should happen automatically.

Therefore, I would focus on point 1/.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120611/9ee041b8/attachment-0001.html>


More information about the live-devel mailing list