Configurable screen share bitrate ceiling for self-hosted instances

(#3479) Feature Closed: Shipped self-hosting video

Summary

On a self-hosted instance there is currently no way for the operator to raise (or lower) the screen share bitrate, the ceiling is hardcoded in the web client. I'd like the bitrate ceiling to be configurable per instance, ideally through the existing limit configuration.

Current behaviour

The screen share bitrate is computed client-side in fluxer_app/src/features/voice/utils/ScreenShareOptions.ts:
  • SCREEN_SHARE_MAX_VIDEO_BITRATE_BPS = 9_000_000 (hard cap)
  • SCREEN_SHARE_BITS_PER_PIXEL_PER_FRAME = 0.02
  • the BITRATE_KBPS table gives a per-resolution/frame-rate floor
which works out to roughly:
SettingMax bitrate
720p303 Mbps
1080p304.5 Mbps
1080p60 / 1440p60 / 4K306 Mbps
4K609 Mbps
These are sensible defaults for fluxer.app, where the media servers' bandwidth is shared by everyone. On a self-hosted instance the operator controls the LiveKit server and its bandwidth, and may want noticeably higher quality for gaming streams or text-heavy content. For example, 1440p60 at 6 Mbps is quite limiting for fast-moving content.

Proposal

Add a limit key, e.g. max_screen_share_bitrate (bps, user scope), next to feature_higher_video_quality:
  • Default = current behaviour (9 Mbps), so nothing changes for fluxer.app or existing instances.
  • The client uses it in place of SCREEN_SHARE_MAX_VIDEO_BITRATE_BPS.
  • Optionally, scale the BITRATE_KBPS floors (or the bits-per-pixel factor) proportionally, so that common presets like 1080p60/1440p60 actually benefit, not just 4K60.
Since limits are already published to clients through the instance's limit configuration, this needs no new transport. Operators could set it per rule/trait like any other limit, through the admin panel.

Why not just fork

The file changed several times recently (#2381, #2414, #2434, #2840, #3139), so a downstream patch has to be redone often. A config value would make it maintenance-free for self-hosters. It would also carry over automatically once the desktop app can connect to self-hosted instances, since the desktop app loads the instance's web client.

Environment

Self-hosted via the install script, using the web client served by the instance.
  1. The pull request fluxer#3410 mentions this post Merged
  2. The pull request fluxer#3411 mentions this post Merged

4 comments

Sign in with Fluxer to comment and vote.
Comment by Rex
RexSystem 1 vote
Status changed from Under consideration to Shipped
Instances can now set a screen share bitrate ceiling with the max_screen_share_bitrate limit, and the app picks its bitrate up to it.
Comment by _
_ 4 votes
This would also be a good option to have in user settings for P2P screen sharing on all instances.