[Live-devel] rtsp with a/v synchronization

mp lt mp_ca2005 at yahoo.ca
Fri Aug 24 06:21:59 PDT 2007


Thanks for your fast reply, Ross.
   
  Yes, I created "RTCPInstance" for each of video and audio RTPSink(subclass).
  However, the first timestamp for video and audio is a little different since each of framesources of video and audio use gettimeofday() to get the time for the first time. In my situation, the videoRTP sink start first, so the timestamp for the first video frame is a little earlier than the timestamp of first audio frame. 
Will this affect sync? 
  
Ross Finlayson <finlayson at live555.com> wrote:
  >Hi Ross,
>
>Thank you for offering us this nice library to learn more about streaming.
>
>I am just writing a test application for H.264 and AAC multicast streaming
>with the help of FAQ and previous discussions. After some tests, I found some
>problem with a/v synchronization that I can not understand.
>I use the frame rate and sampling rate to put the right timestamps 
>and time duration for every frame video and audio ( I can stream 
>them seperately and receive them normally). However, when I stream 
>them together(which include a rtsp server). I use rtsp protocol to 
>get the a/v stream by VLC, I found the a/v is a bit of out of sync. 
>The audio is always a little bit of behind video.
>I am not sure whether this is related to I put the different 
>timestamps for the first frame of video and audio since I use the 
>gettimeofday for the first time.

Yes, if you give accurate - wall-clock synchronized - presentation 
times to the data that you feed to your "RTPSink" (subclass), *and* 
if you have a "RTCPInstance" for each "RTPSink" (subclass), then 
these presentation times will be returned - at the client end - when 
it reads from the corresponding "RTPSource" (subclass).


>Another interesting thing I found is that if the VLC can receive the 
>first frame audio and video, the sync effect become much better(I 
>did this by open the client VLC first, then start stream server), so 
>I am guessing if there is some place in rtsp protocol to help the 
>client synchronize the audio and video. I checked the rtsp protocol, 
>it said In PLAY method, the Range header may help synchronization 
>the media from different source. I can not understand how this works.

No, A/V synchronization is ensured by using RTCP. Please read the FAQ.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel


       
---------------------------------
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20070824/d48bc446/attachment.html 


More information about the live-devel mailing list