Discussion:
[libav-tools] RTSP multiple streams
Pete Kelly
2017-07-03 18:23:34 UTC
Permalink
Hi

I've been using avconv on the command line to stream (RECORD) local files
to an RTSP server that I am hosting.

Part of the RTSP spec involves an SDP being sent from the client (libav) to
the RTSP server to describe the audio that will be sent.

All works well, apart from the fact that I would like to record multiple
RTP streams to the RTSP server, which it looks like libav can deal with
according to the loop in the code here inserting multiple a=control lines:

https://github.com/libav/libav/blob/master/libavformat/sdp.c#L777

Does anyone know how I can specify multiple streams on the command line?
I've tried with libav 9.2 (possibly too old) however no matter how many
input streams I specify there is only ever a single stream in the SDP
generated by avconv.

Many thanks for any advice or pointers.

Pete
Luca Barbato
2017-07-04 13:16:44 UTC
Permalink
Post by Pete Kelly
Does anyone know how I can specify multiple streams on the command line?
I've tried with libav 9.2 (possibly too old) however no matter how many
input streams I specify there is only ever a single stream in the SDP
generated by avconv.
Many thanks for any advice or pointers.
recent Libav should be able to just connect to the server and send the
data w/out problems.

(see rtspenc.c)

which is the command line you are using?
Pete Kelly
2017-07-04 14:31:02 UTC
Permalink
I'm using something along the lines of:

avconv -re -i /tmp/file.wav -f rtsp -muxdelay 0.1 -codec:a pcm_mulaw rtsp://
192.168.86.224:5545/abc

I was hoping that simply by providing 2 input streams that the generated
SDP would have 2 input streams (i.e. 2x a=control lines), however this
isn't the case at least in 9.2:

avconv -re -i /tmp/file.wav -re -i /tmp/file2.wav -f rtsp -muxdelay 0.1
-codec:a pcm_mulaw rtsp://192.168.86.224:5545/abc
Post by Luca Barbato
Post by Pete Kelly
Does anyone know how I can specify multiple streams on the command line?
I've tried with libav 9.2 (possibly too old) however no matter how many
input streams I specify there is only ever a single stream in the SDP
generated by avconv.
Many thanks for any advice or pointers.
recent Libav should be able to just connect to the server and send the
data w/out problems.
(see rtspenc.c)
which is the command line you are using?
_______________________________________________
libav-tools mailing list
https://lists.libav.org/mailman/listinfo/libav-tools
Pete Kelly
2017-07-06 09:44:34 UTC
Permalink
I've confirmed this is also the case in version 11.9.

Am I trying to do something which is simply not supported as yet?
Post by Pete Kelly
avconv -re -i /tmp/file.wav -f rtsp -muxdelay 0.1 -codec:a pcm_mulaw
rtsp://192.168.86.224:5545/abc
I was hoping that simply by providing 2 input streams that the generated
SDP would have 2 input streams (i.e. 2x a=control lines), however this
avconv -re -i /tmp/file.wav -re -i /tmp/file2.wav -f rtsp -muxdelay 0.1
-codec:a pcm_mulaw rtsp://192.168.86.224:5545/abc
Post by Luca Barbato
Post by Pete Kelly
Does anyone know how I can specify multiple streams on the command line?
I've tried with libav 9.2 (possibly too old) however no matter how many
input streams I specify there is only ever a single stream in the SDP
generated by avconv.
Many thanks for any advice or pointers.
recent Libav should be able to just connect to the server and send the
data w/out problems.
(see rtspenc.c)
which is the command line you are using?
_______________________________________________
libav-tools mailing list
https://lists.libav.org/mailman/listinfo/libav-tools
Pete Kelly
2017-07-06 15:55:31 UTC
Permalink
For reference, I managed to work this one out by using the channelsplit
filter:

avconv -re -i /tmp/testcall101.wav -filter_complex channelsplit -f rtsp
-muxdelay 0.1 -codec:a pcm_mulaw rtsp://172.16.6.125:5545/testcall101

It auto detects the 2 channels in testcall101.wav and that is converted
into 2 streams within the RTSP filter.

Pete
Post by Pete Kelly
I've confirmed this is also the case in version 11.9.
Am I trying to do something which is simply not supported as yet?
Post by Pete Kelly
avconv -re -i /tmp/file.wav -f rtsp -muxdelay 0.1 -codec:a pcm_mulaw
rtsp://192.168.86.224:5545/abc
I was hoping that simply by providing 2 input streams that the generated
SDP would have 2 input streams (i.e. 2x a=control lines), however this
avconv -re -i /tmp/file.wav -re -i /tmp/file2.wav -f rtsp -muxdelay 0.1
-codec:a pcm_mulaw rtsp://192.168.86.224:5545/abc
Post by Luca Barbato
Post by Pete Kelly
Does anyone know how I can specify multiple streams on the command
line?
Post by Pete Kelly
I've tried with libav 9.2 (possibly too old) however no matter how
many
Post by Pete Kelly
input streams I specify there is only ever a single stream in the SDP
generated by avconv.
Many thanks for any advice or pointers.
recent Libav should be able to just connect to the server and send the
data w/out problems.
(see rtspenc.c)
which is the command line you are using?
_______________________________________________
libav-tools mailing list
https://lists.libav.org/mailman/listinfo/libav-tools
Luca Barbato
2017-07-09 23:13:07 UTC
Permalink
Post by Pete Kelly
For reference, I managed to work this one out by using the channelsplit
avconv -re -i /tmp/testcall101.wav -filter_complex channelsplit -f rtsp
-muxdelay 0.1 -codec:a pcm_mulaw rtsp://172.16.6.125:5545/testcall101
It auto detects the 2 channels in testcall101.wav and that is converted
into 2 streams within the RTSP filter.
you are missing an explicit -map probably, e.g. -map 0.

Loading...