Skip to content

adding ability to control local video track encode parameters#1136

Open
chenosaurus wants to merge 5 commits into
mainfrom
dc/exp/local_video_bitrate_control
Open

adding ability to control local video track encode parameters#1136
chenosaurus wants to merge 5 commits into
mainfrom
dc/exp/local_video_bitrate_control

Conversation

@chenosaurus

@chenosaurus chenosaurus commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
  • Add hooks into local video track to set encoding limits
  • Add to local_video subscriber example to demonstrate controlling encoding parameters on publisher

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Changeset

The following package versions will be affected by this PR:

Package Bump
libwebrtc patch
livekit patch

@chenosaurus chenosaurus marked this pull request as ready for review June 5, 2026 17:50
Comment thread examples/local_video/src/subscriber.rs Outdated
}

#[derive(Debug, Deserialize, Serialize)]
struct SetEncodingLimitsRequest {

@ladvoc ladvoc Jun 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider putting common structs in a module and share between the two binaries.

@xianshijing-lk xianshijing-lk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

two questions

self.sys_handle
.set_parameters(parameters.into())
.set_parameters(native_parameters)
.map_err(|e| unsafe { sys_err::ffi::RtcError::from(e.what()).into() })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what do these params mean for simulcast, adaptive streaming, and dynacast ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added support for setting encoding config for individual simulcast layers. This will not have any effect on adaptive streaming and dynacast as they only dynamically turn on/off individual layers to be streamed based on subscriber demand.

Comment thread examples/local_video/src/publisher.rs Outdated
const SET_VIDEO_ENCODING_LIMITS_METHOD: &str = "set-video-encoding-limits";

#[derive(Debug, Deserialize, Serialize)]
struct SetEncodingLimitsRequest {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this designed to cap this track overall ? or we should consider per encoding / layer limits due to simulcast ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This still need a bit of work to support simulcast as currently it would apply the same limits to each layer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@xianshijing-lk after thinking about simulcast more, it only makes sense for the encoding limits to control the high layer and for the publisher to automatically generate the medium and low layers.

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.

4 participants