Page 1 of 1

Playing audio from multiple sources (RTSP/SDP)

Posted: 20 Mar 2011 01:53
by SimFox3
Hi guys,
My first post here =). I'm having difficulties trying to make VLC play audio from multiple audio sources. Though honestly I'm not sure if VLC even supports it?

SDP:

Code: Select all

v=0 s=Test1 i=Playing around yayy t=0 0 a=range:npt=now- m=audio 0 RTP/AVP 99 a=control:setup/audio/aa0cool a=rtpmap:99 AMR/8000/1 a=fmtp:99 octet-align=1 m=audio 0 RTP/AVP 99 a=control:setup/audio/aa1cool a=rtpmap:99 AMR/8000/1 a=fmtp:99 octet-align=1
Notice how there are two audio sources in the SDP, both of them have the same format BUT they are in essence two different files. When I try to play using 'vlc -vvvv rtsp://myserver.com/play', I see two 'SETUP' commands to the rtsp server, one for each audio source WITH different port numbers. Unfortunately, ONLY the FIRST audio source is played. The second audio source is never 'mixed'.

I did a small test, where I blocked the FIRST audio source from streaming for 30 seconds, then I see that VLC buffers the second source, hangs for 30 seconds, and then plays the first source as soon as it starts streaming.

(buffering second source)

Code: Select all

.... [0285f4e4] main input debug: Buffering 96% [0285f4e4] main input debug: Buffering 98% [0285f4e4] main input debug: Stream buffering done (1202 ms in 960 ms) [0285f4e4] main input debug: Decoder buffering done in 0 ms
(waits for 30 seconds... then plays only first audio source when it begins to stream)

One thing to note is that the RTCP packets are NOT being forwarded to the client (VLC). Does that matter? If not, is it possible to mix the sources using VLC somehow?

Thanks!

Re: Playing audio from multiple sources (RTSP/SDP)

Posted: 20 Mar 2011 08:26
by Rémi Denis-Courmont
As far as I know, it will play whichever audio track you select in the audio menu.

Re: Playing audio from multiple sources (RTSP/SDP)

Posted: 20 Mar 2011 08:42
by SimFox3
Rémi,
Ah, I do see the 'Audio Track' menu, and it does allow me to *select the other track. Is it possible to select ALL tracks, and have VLC mix them instead of selecting them one-by-one? What other options do I have on the client (VLC), or is my only option to 'mix' the audio streams on the server before sending them out?

* Even though I can select the other audio track, VLC debug logs shows the following error messages: 'PTS is out of range, dropping buffer' error messages. I'm pretty sure this is because my RTP Timestamps are WAYYY off between the two sources. That's something that I'm sure I can quickly fix on the server side.

Re: Playing audio from multiple sources (RTSP/SDP)

Posted: 20 Mar 2011 12:46
by Rémi Denis-Courmont
It's possible to hack, but that's really not the way it's supposed to work. You really should mix on the server side:
vlc --sout-all --sout '#display'