Glimesh / janus-ftl-plugin

A plugin for the Janus WebRTC gateway to enable relaying of audio/video streams utilizing Mixer's FTL (Faster-Than-Light) protocol.
https://hayden.fyi/posts/2020-08-03-Faster-Than-Light-protocol-engineering-notes.html
GNU Affero General Public License v3.0
44 stars 11 forks source link

Add config for rolling bitrate ms value #131

Closed clone1018 closed 3 years ago

clone1018 commented 3 years ago

I'm almost certain this is the wrong way to do it :)

clone1018 commented 3 years ago

@haydenmc I wanted to get some code in for tweaking the default ms bitrate window we use. I copied the existing configuration code & used the feature flagging setup that nacks use. The latter was done so I could avoid accessing the configuration directly inside the FtlMediaConnection.cpp. However I feel that this is entirely too much code for a simple feature, and it blows up the constructors of FtlServer, FtlStream, and JanusFtl. Let me know how it should be done better, and I will make the adjustments.

haydenmc commented 3 years ago

Yo - to be honest this is probably the best way we've got with our current architecture. It is a bummerino that we've got to plumb the configuration values down through so many classes, but given how the classes relate to one another I think it's okay. Publish and I'll approve!

Looks like we've got to fix the CI too... 👀

Did you modify the submodules in this PR?

clone1018 commented 3 years ago

Did you modify the submodules in this PR?

Only by accident :). Will test locally, revert those changes, and then mark it ready!

clone1018 commented 3 years ago

Tested using:

FTL_MAX_ALLOWED_BITS_PER_SECOND=4000000
FTL_ROLLING_SIZE_AVG_MS=10000 # Also tested 30000

and

OBS Video Bitrate: 3840 Kbps
OBS Audio Bitrate: 160 bps

and the stream was successful indefinitely. In production I suggest we use about 20-30 seconds as the rolling size, as the only real purpose of this is to prevent actual abuse.