CESNET / UltraGrid

UltraGrid low-latency audio and video network transmission system
http://www.ultragrid.cz
Other
484 stars 55 forks source link

Multiple destinations with multiple setups. FEC/Local/SRT #379

Open TheSashmo opened 3 months ago

TheSashmo commented 3 months ago

I have two networks. Multicast and Unicast. These are two separate networks that one encoder can be connected to.

Ideally I would like to output multicast of my ultragrid encoded video with FEC, which this can be done now with just by using the multicast output and setting my TTL value. But if I want to send that same signal to another device on the network, but to the unicast side of the network, what would be the logical setup? Use hdrum?

So something like this:

               -> unicast with fec(local path)
Encoder-> multicast with fec (multicast path)
               -> multicast with fec -> SRT (externally)
alatteri commented 3 months ago

This is the basics of how we do it.

                         /-----> srt-> internet -> receiverA -> srt -> UG           
UG encoder --> hd-rum --
                         \-----> srt-> internet -> receiverB -> srt -> UG
TheSashmo commented 3 months ago

Yeah, Thats pretty much what I figured, but I have this obsession with multicast and we use FEC as well. I am not sure how SRT handles the FEC portion and still needs to have a SRT receiver on the other side.

Ideally its multicast with fec output for all local network stuff with two network ports. Unicast with FEC on the same network to devices that don't have multicast network interfaces, and then a unicast to SRT to go out to the rest of the world. We have our own transmission solution so it wouldn't be SRT but essentially its the same sort of stuff.

I was testing hd-rum-transcode or hd-rum, and it wont bind to the multicast source on the same machine, so I think thats a bug.

./UltraGrid-1.9.1-x86_64.AppImage -t decklink:0 -s embedded -c libavcodec:encoder=libx264:bitrate=15000k:depth=8 --audio-codec=opus:sample_rate=48000:bitrate=256k --audio-capture-format channels=16 -m 1316 239.34.34.34 -T 64 -P 10000 --control-port 1234

./UltraGrid-1.9.1-x86_64.AppImage -o hd-rum-transcode 200k 10000 -P 5004 192.168.99.100 -P 5004 127.0.0.1

using UDP send and receive buffer size of 204800 bytes initializing packet queue for 25 items listening on *:10000

It says :10000 but I don't think its actually doing that, its expecting on local host. would mean all, wouldn't it?

Also wondering why it would need that run twice for both audio and video, wouldn't be easier to put that all into one?

alatteri commented 3 months ago

I don't know about multicast, but here is our syntax. ./hd-rum-transcode 40M 8000 -P 8100 127.0.0.1 -P 8102 127.0.0.1 -P 8104 127.0.0.1

and the corresponding log:

[2024-04-02 06:25:34] UltraGrid 1.8+ (tags/continuous~7 rev c4fbc09 built Sep 19 2023 10:24:41)
[2024-04-02 06:25:34] 
[2024-04-02 06:25:34] using UDP send and receive buffer size of 41943040 bytes
[2024-04-02 06:25:34] initializing packet queue for 5242 items
[2024-04-02 06:25:34] listening on *:8000
[2024-04-02 06:26:28] [2024-04-02 06:26:28] Received 117 bytes in 54.7865 seconds = 16.0 bps
[2024-04-02 06:26:33] [2024-04-02 06:26:33] Received 41770 bytes in 5.04161 seconds = 66.2 kbps
[2024-04-02 06:26:38] [2024-04-02 06:26:38] Received 39377 bytes in 5.0039 seconds = 62.9 kbps
MartinPulec commented 1 month ago

Hi, in case that your are still interested.

I am not sure if entirely understand the scheme, but if I take it from the end:

It says :10000 but I don't think its actually doing that, its expecting on local host. would mean all, wouldn't it?

I've just checked with iproute2's ss (ss -lp | grep hd-rum) that it really listens on * (all interfaces + both IP protocols).

From the context I think you'd like the reflector to receive the multicast, right In this case, the mcast address to bind (join) to is needed to add. That is currently not possible , but I believe that it is quite easy to add, so I'll perhaps do this.

Also wondering why it would need that run twice for both audio and video, wouldn't be easier to put that all into one?

388

I've separated it into a discussion if you don't mind. Will answer soon.