How to synchronize incoming audio and video rtp streams

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
camelstrike
New Cone
New Cone
Posts: 4
Joined: 17 Apr 2009 10:10

How to synchronize incoming audio and video rtp streams

Postby camelstrike » 01 Oct 2009 14:21

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 !

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to synchronize incoming audio and video rtp streams

Postby Rémi Denis-Courmont » 01 Oct 2009 16:34

RTCP synchronization is automatically if the streams are part of the same SDP (multiple m-lines).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

camelstrike
New Cone
New Cone
Posts: 4
Joined: 17 Apr 2009 10:10

Re: How to synchronize incoming audio and video rtp streams

Postby camelstrike » 01 Oct 2009 17:24

Thanks
(I didn't know I needed to create a SDP file.)

Zingaro2002
Blank Cone
Blank Cone
Posts: 47
Joined: 30 May 2006 09:58

Re: How to synchronize incoming audio and video rtp streams

Postby Zingaro2002 » 28 Apr 2010 12:45

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?)

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to synchronize incoming audio and video rtp streams

Postby Rémi Denis-Courmont » 28 Apr 2010 18:28

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 19 guests