PeerTube icon indicating copy to clipboard operation
PeerTube copied to clipboard

Lower low-latency mode

Open Skehmatics opened this issue 3 years ago • 3 comments

Describe the problem to be solved

The live-streaming latency, even when in low-latency mode, leaves a little to be desired when compared to proprietary solutions

A project I'm heading is working on a possible solution in our fork, and wanted to gauge if this should be upstreamed once complete

Describe the solution you would like

  • Implement a dedicated low latency media loader using VHS (as P2P is disabled in low latency mode anyways)
  • Utilize the latency compensation technique from owncast to keep the player as close as possible to the live edge
    • Add a "live segment transmission delay" admin configuration option (to handle cases where a CDN has been configured), and use that to set the targets used in compensation
  • As this may be non-conformant (iirc), pushing closer than the HLS spec minimum buffer could be opt-in for the user (as is done on twitch)

Skehmatics avatar Nov 15 '22 21:11 Skehmatics

Hello,

I think it would be simpler to wait LL-HLS support in hls.js https://github.com/video-dev/hls.js/projects/7 Unfortunately (fortunately?) we're happy with hls.js and don't want to switch on VHS

Chocobozzz avatar Nov 16 '22 08:11 Chocobozzz

Understood! Nothing should theoretically prevent hls.js from doing the same (it even has a similar latency compensation mechanism via maxLiveSyncPlaybackRate), however we were never able to get it to function properly with liveSyncDurationCount under 2, while VHS has little problem with this.

If we can find out how to get this working in hls.js, we'll switch over to that to open a path to upstream

Thanks for all you do Chocobozzz~

Skehmatics avatar Nov 16 '22 09:11 Skehmatics

Does the LL-HLS implementation goes in the right direction for you ? I was worried seeing some updates were refused here : https://github.com/video-dev/hls.js/pull/6975/files

Murazaki avatar Aug 24 '25 08:08 Murazaki