Skip to content

add is_screencast to VideoSource#896

Merged
theomonnom merged 5 commits intomainfrom
theo/is_screencast
Feb 15, 2026
Merged

add is_screencast to VideoSource#896
theomonnom merged 5 commits intomainfrom
theo/is_screencast

Conversation

@theomonnom
Copy link
Member

@theomonnom theomonnom commented Feb 15, 2026

When is_screencast() == true, WebRTC:

  1. Maintains resolution, drops frames instead — uses MAINTAIN_RESOLUTION degradation preference, so under congestion it reduces framerate rather than downscaling (keeps text crisp)
  2. Disables quality scaling — won't automatically resize the video to save bandwidth
  3. Disables denoising — avoids blurring that damages text/UI readability
  4. Guarantees minimum 1200 kbps bitrate floor
  5. Enables zero hertz mode — stops sending frames when the screen is static (saves bandwidth)
  6. Sets content type to kScreen — which changes encoder config throughout the pipeline (VP9 inter-layer prediction, simulcast layer allocation, etc.)

@theomonnom theomonnom requested review from a team and davidzhao February 15, 2026 01:56
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg


impl NativeVideoSource {
pub fn new(resolution: VideoResolution) -> NativeVideoSource {
pub fn new(resolution: VideoResolution, is_screencast: bool) -> NativeVideoSource {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a mode param for future proofing? if there are other presets that we'd want to define. maybe:

  • camera
  • avatar
  • screencast

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's closely tied to libwebrtc, so it's very unlikely.

But maybe this should be an option inside our TrackPublishOptions API

@theomonnom theomonnom merged commit 9f15dcd into main Feb 15, 2026
5 checks passed
@theomonnom theomonnom deleted the theo/is_screencast branch February 15, 2026 02:46
Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@theomonnom
Copy link
Member Author

ahaha this timing

@github-actions github-actions bot mentioned this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments