Skip to content

Add FlexFEC support - #975

Draft
cloudwebrtc wants to merge 2 commits into
mainfrom
duan/flexfec
Draft

cloudwebrtc wants to merge 2 commits into
mainfrom
duan/flexfec

Conversation

@cloudwebrtc

Copy link
Copy Markdown
Contributor

Draft: the livekit-rtc/rust-sdks submodule points at an unmerged branch (livekit/rust-sdks#1765, stacked on #1668 and #1424). CI downloads the FFI binary for the version in that checkout (0.16.0), which does not have the new request yet. Once a livekit-ffi release includes these PRs, the submodule moves to that tag and this leaves draft.

Summary

Adds FlexFEC support, matching the Android and Swift SDKs:

  • RemoteTrackPublication.set_fec_protection(protection) asks the server for FlexFEC repair packets on a subscribed video track. It raises ValueError for other kinds, like set_video_quality. The setting changes without renegotiation and is kept across resubscriptions; it can be called before the track is subscribed.
  • FecProtection, FecProtectionMode and FecProtectionLevel are exported, so a published video track can set TrackPublishOptions(fec=...). Publisher FEC only applies with simulcast=False.
  • The local_video publisher and subscriber examples take --fec (none, adaptive, fixed-<level>, minimum-<level>).

The protobuf bindings are regenerated with protoc 25.1 and mypy-protobuf 3.6.0, as in CI. Besides FEC, they pick up the FFI changes from 0.14.0 to 0.16.0.

Testing

Step Frames decoded FEC packets received
Subscribed, no request 139 0
set_fec_protection(fixed high) for 8 s 323 +183, 0 discarded
set_fec_protection(disabled), last 5 s 507 +0
Requested before subscribing, then subscribed 183 182

On the server, the publisher's offer created a FlexFEC decoder (fec pairs found from sdp, flexfec decoder created), so TrackPublishOptions.fec sends repairs upstream.

Point livekit-ffi at the FlexFEC changes (livekit/rust-sdks#1424, #1668,
#1765) and regenerate the protobuf bindings.

- RemoteTrackPublication.set_fec_protection requests repair packets for a
  subscribed video track and raises ValueError for other kinds.
- FecProtection, FecProtectionMode and FecProtectionLevel are exported, so
  TrackPublishOptions.fec can be set when publishing.
- The local_video publisher and subscriber examples take --fec.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

This PR bumps

  • livekit: minor

This branch has not been deployed

No deployments
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.

1 participant