Page 1 of 1

How to synchronize incoming audio and video rtp streams

Posted: 01 Oct 2009 14:21
by camelstrike
Hi

I have an application which sends out two RTP streams (audio and video) including RTCP for each stream.
I'm not so familiar with VLC and I wonder if its possibly to get vlc to play both streams, synchronizing with the help of RTCP ?
I've tried to play both streams at the same time using the option "Play another media synchronously ..." in the GUI but in those cases only one of the streams gets played (never the extra stream added).
I'm guessing there might be a command line option for this but I haven't found any.

Thanks in advance !

Re: How to synchronize incoming audio and video rtp streams

Posted: 01 Oct 2009 16:34
by Rémi Denis-Courmont
RTCP synchronization is automatically if the streams are part of the same SDP (multiple m-lines).

Re: How to synchronize incoming audio and video rtp streams

Posted: 01 Oct 2009 17:24
by camelstrike
Thanks
(I didn't know I needed to create a SDP file.)

Re: How to synchronize incoming audio and video rtp streams

Posted: 28 Apr 2010 12:45
by Zingaro2002
Hi camelstrike, hi Rémi Denis-Courmont

I have two different rtsp streams (audio and video) coming from different devices to my VLM that broadcasts them to my clients.
I'd like to synchronize both streams so that I can have perfect lip sync on the resulting stream played by clients (with vlc).
I'm using the following configuration file:

Code: Select all

# video channel (connection to an rtsp server) new channel1 broadcast enabled setup channel1 input rtsp://user:password@172.32.0.20:554/path/media.amp setup channel1 output #duplicate{dst=std{dst=rtp{port=6666,mux=ts,name="Stream1",description="Stream1Description",sdp=rtsp://:8081/test.sdp}} # audio channel (receive through rtp stream) new channel2 broadcast enabled setup channel2 input rtp://@196.0.0.5:9999 setup channel2 output #duplicate{dst=rtp{port=5555,mux=ts,name="Stream2",description="Stream2Description",sdp=rtsp://:8082/test.sdp}} control channel1 play control channel2 play
By now my clients connect in this way:
rtsp://[serverip]:8081/test.sdp (for first stream)
rtsp://[serverip]:8082/test.sdp (for second stream)
and they have 2 separate streams (1 for video and 1 for audio)

So what do I have to do to have those streams synchronized into 1 stream on my clients?
Can I receive both streams simultaneously (and synchronized) using a single vlc instance?

Thanks in advance for any hint!

P.S: i'm also able to modify my configuration to have vlm sending rtp streams to my clients (is it better than above to achieve syncronization?)

Re: How to synchronize incoming audio and video rtp streams

Posted: 28 Apr 2010 18:28
by Rémi Denis-Courmont
First, you're going to need RTCP-SR on both input streams, otherwise VLC simply has no way to sync. Then the clients will need to support RTCP-SR as well and do the same as VLC.