CESNET / UltraGrid

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

Getting output from an ultragrid receiver #269

Closed armelvil closed 1 year ago

armelvil commented 1 year ago

I am currently experiencing some difficulty in getting the video output from Ultragrid into something else.

Right now i can get the system working with no issues with one transmitter encoding HEVC to one receiver with no problem.

My issue is that I need a one-to-many relationship.

Every other method I've tried (FFMPEG, Gstreamer) introduces an unacceptable level of latency (>1000ms) on transcoding anything at all regardless of how aggressive I was on controlling buffering. DASH/HLS worked well but due to segment sizing I couldn't get the latency below 2 seconds. UG works just fine, but the limitations of 1:1 transmitter/receiver are problematic.

I have reviewed the documentation (especially use cases) and I'm also aware the protocol selection may not properly support certain codecs. I have to admit to being somewhat confused at this point, as the documentation for these edge use cases references approaches that the current binary claims are out of date.

Basically, I'd like to run the transmitter independently, point them all at one server machine and then have that perform a blind stream copy into an encapsulation that's less restrictive for distribution to several different clients.

Latency from FFMPEG/GST nonwithstanding I'd had some success with a nonblocking SRT server linked here: https://github.com/Edward-Wu/srt-live-server

This would all function on a local network.

The built-in SDP and RTSP support in the current AppImage restricts encoding to h.264, which will not work for my use case.

Would compiling the SRT fork be a better idea?

alatteri commented 1 year ago

use the reflector that is bundled with UG. This is how we do it. There is no noticeable latency, as there is no transcoding.

                             ___ receiverA
UG encoder --> reflector --/ ----receiverB
                           \____ recevierC

if you want to get fancy and do some scripting, you can encapsulate the output of reflector into SRT. Remember that UG puts audio/video in essentially 2 different streams on 2 different ports, so you basically need to do double SRT encapsulation.

https://github.com/CESNET/UltraGrid/wiki/SRT-encapsulation

Also, this really isn't a code issue (bug), and really should be in a Discussion.

armelvil commented 1 year ago

This suggestion does kind of work, with one issue - it does seem to be introducing a high level of latency somewhere.

The receiver is now dropping frames with errors such as

could not find ref with POC 9

It is probably the fault of the receiver being an ARM SBC board, but it does seem to be able to handle the original T-R model with no issue.

Thank you for your quick response. Can this be moved to Discussions?

alatteri commented 1 year ago

Close this issue, and start a new Discussion with a more relevant subject.