Haivision / srt

Secure, Reliable, Transport
https://www.srtalliance.org
Mozilla Public License 2.0
3.07k stars 840 forks source link

receiving multi srt streaming with srt-live-transmit #1758

Closed aniltonf closed 3 years ago

aniltonf commented 3 years ago

Hi there.

I'm really new on this, but facing a major challenge of receiving multiples SRT straming and output them to a specific IP:port

Can srt-live-transmit do this. I already have it configured, and it's working with one streaming, but having issues adding more streaming on INPUT, but specially on OUTPUT.

Help please...

System: Ubuntu-server 20:04

Thanks

ethouris commented 3 years ago

The srt-live-transmit application can only serve one stream at a time.

What you want is generally possible in SRT, just not with this application. Among testing applications (you need to --enable-testing to allow this to be compiled - not sure if this is distributed by default) there's srt-test-multiplex, which can be used to demonstrate the solution for sending multiple streams over one UDP link (not exactly over one SRT connection, but from the system perspective it will be seen like utilizing one link for all streams).

aniltonf commented 3 years ago

Great... thanks

So, in my case, I'm only using SRT for streaming INPUT, and do OUTPUT with UDP... The issue here is that I don't really know how to receive multiple streaming with SRT...

This is my SRT link config for INPUT...

srt://ip:port?rcvlatency=3000&sndlatency=3000&peeridletimeo=10000&oheadbw=100&nakreport=1 udp://ip:port?sndbuf=67108864 -logfile:/var/log/srt-live-transmit.log -statsout:/var/log/srt-live-transmit-SRT.log -f -ll:debug -lfa:all -pf:csv -s:1000

Can you help more?

Regards

ethouris commented 3 years ago

What do you mean by "multiple streaming"?

aniltonf commented 3 years ago

SRT_receiving_diagram

Please, check this diagram... each streaming with own IP and PORT

ethouris commented 3 years ago

So, the source passes to some intermediate application each one with its distinct SRT connection. That's ok. Then some processing happens there and it results with a one stream to be sent next over UDP (only one, as I understand, although some unusual processing should happen as through a bare UDP connection you can send only one stream).

So, yes, this is possible - in the SRT library in general - if you set up a listener in this application on the intermediate device. Then connect every source separately to it. Of course in result this application would need to accept every connection separately and separately read the data from each one.

We don't have anything among the applications that could do that. You'd have to write your own. All of our applications can process only one stream at a time.

aniltonf commented 3 years ago

that server in the middle is the srt-live-transmit....

The situation is exactly that, all the streaming reach the server with srt on the same ethernet connection... via public IP

Is there any other solution?

can I use 2 streaming INPUT/OUTPUT in the same srt config file...

like: str://ip1:port1 udp://ip11:port11 str://ip2:port2 udp://ip22:port22

Seems to work for INPUT but not for OUTPUT...

I've tried lot's of things, eheheheh

ethouris commented 3 years ago

If you want to connect every stream to a different listener port on this intermediate device, simply run multiple instances of srt-live-transmit, each one with SRT source in listener mode, just with different port. They will just work independently.

aniltonf commented 3 years ago

That's the question... how can I do that. My srt INPUT and OUTPUT is on srt-live-transmit.config... should I put in the same file, multiples srt like this...?

str://ip1:port1 udp://ip11:port11 str://ip2:port2 udp://ip22:port22

If so, it must be in different ports?

Thanks

ethouris commented 3 years ago

Exactly. One port can be shared (by various ways) within one application, but there's no way to share the port between application instances. Still, there's no problem in running srt-live-transmit in multiple instances.

J-Rogmann commented 3 years ago

Hi @aniltonf

just to clarify: this is a limitation by srt-live-transmit. This executable is meant for demo purposes to help beginners to familiarize with the SRT protocol and the implementation of SRT into their own application. It is not really optimized for production purposes, although it runs stable. srt-live-transmit can only handle one input & output at a time. To realize multiple SRT streams, you would need to run srt-live-transmit multiple times in parallel or build your own application.

Please let me know, if that solved your problem or if you have more questions.

best regards, Justus

mbakholdina commented 3 years ago

Closing the ticket due to inactivity. Please feel free to reopen in case of further questions.

johnnyreina commented 3 years ago

Hi @aniltonf I need to ask you some questions about SRT please send me your email to contact you

kyanzad commented 1 month ago

Hi. How can I change this code to reach that goal? I mean servicing more than one SRT destination with one stream. Thanks.