Skip to content

E2E Test: select video quality when publish simulcast video track.#646

Open
cloudwebrtc wants to merge 5 commits into
mainfrom
duan/e2e-test-select-video-quality
Open

E2E Test: select video quality when publish simulcast video track.#646
cloudwebrtc wants to merge 5 commits into
mainfrom
duan/e2e-test-select-video-quality

Conversation

@cloudwebrtc
Copy link
Copy Markdown
Contributor

Summary

Adds an end-to-end pytest that verifies LiveKit simulcast layer switching from a Python publisher across both VP8 and H.264 codecs.

The test publishes a 1280×720 video track (rolling colored bars, generated as I420 with numpy) with simulcast=True, subscribes from a second room, and then drives the receiver through RemoteTrackPublication.set_video_quality(HIGH/MEDIUM/LOW). For each layer it asserts the decoded frames converge to roughly the expected dimensions (within ±20% tolerance, requiring 5 consecutive matching frames):

Quality Layer Expected
HIGH f 1280×720
MEDIUM h 640×360
LOW q 320×180

Parameterized over VP8 and H264. A 5-second post-subscription warmup is included so the encoder and bandwidth estimator stabilize at the highest layer before quality switches begin.

Dependency

This test depends on livekit/rust-sdks#1052, which fixes TrackPublication.simulcasted to derive from the non-deprecated TrackInfo.codecs[*].layers field. Without that fix, modern LiveKit servers (1.10+) report info.simulcast=false (deprecated field), so set_video_quality becomes a silent no-op and this test fails on all non-HIGH layers.

This E2E test will only pass after livekit/rust-sdks#1052 is merged and a new livekit-ffi release that includes it is published and consumed by livekit-rtc. Until then, the test should be expected to fail in CI (or be marked xfail / skipped at the workflow level).

Requires

Test plan

  • pytest livekit-rtc/tests/test_change_video_quality.py -v -s passes against a current LiveKit server (verified locally on server 1.10.1 with a patched FFI dylib, both VP8 and H264).
  • Test is skipped cleanly when LiveKit env vars are missing.
  • No regressions in the existing tests/ suite.
  • Re-run after rust-sdks#1052 is released and the FFI binary is updated.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@cloudwebrtc
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

…video-quality

# Conflicts:
#	livekit-rtc/rust-sdks

Co-authored-by: cloudwebrtc <17733746+cloudwebrtc@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented May 12, 2026

@copilot resolve the merge conflicts in this pull request

Resolved and pushed in commit 71ab95e. I merged origin/main into this branch and fixed the livekit-rtc/rust-sdks submodule conflict so the PR is conflict-free now.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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