3 ms·
A wonderful write-up, thank you very much. However, it needs to be said that with currently available technologies, there is no need to have a 5 seconds buffer
by Fischgericht 3y ago
A wonderful write-up, thank you very much.
However, it needs to be said that with currently available technologies, there is no need to have a 5 seconds buffer.
Have a look at the amazing work of the OvenMedia team (not affiliated). Using their stack, and using Low-Latency HLS (LLHLS) I have been able to easily reach an end-to-end latency between the camera on site to the end-user viewing it in the browser of <500ms. At 20 MBit/s, and using either SRT or RTMP for stream upload.
I understand that most likely your huge buffers come from you expecting your streamers to be using RTMP over crappy links, and therefore you already need to buffer THEIR data. Twitch really should invest in supporting SRT. It's supported in OBS.
Anyway:
Once you have the stream in your backend, the technology to have sub-second latency live streaming using existing web standards is there.
https://airensoft.gitbook.io/ovenmediaengine/ https://airensoft.gitbook.io/ovenmediaengine/
But all of this being said: What you are doing there is looking amazing, so keep up the good work!
- kixelated 3y agoGlad you liked it! It's really difficult to compare the latency of different protocols because it depends on the network conditions. If you assume flawless connectivity, then real-time latency is trivial to achieve. Pipe frames over TCP like RTMP and bam, you've done it. It's almost meaningless to compare the best-case latency. The important part is determining how a protocol behaves during congestion. LL-HLS doesn't do great in that regard; frankly it will perform worse than RTMP if that's our yardstick because of head-of-line blocking, large fragments, and the playlist in the hot path. Twitch uses a fork of HLS called LHLS which should have lower latency, but we were still seeing 3-5s in some parts of the world. But yeah, P90 matters more than P10 when it comes to latency. One late frame ruins the broth. A real-time protocol needs a plan to avoid queues at all costs and that's just difficult with TCP.