Skip to content

Fix initial video quality blurriness for all codecs#1987

Open
xianshijing-lk wants to merge 4 commits into
mainfrom
sxian/CLT-3068/fix-initial-video-quality-blurriness-by-setting-x-google-start-bitrate
Open

Fix initial video quality blurriness for all codecs#1987
xianshijing-lk wants to merge 4 commits into
mainfrom
sxian/CLT-3068/fix-initial-video-quality-blurriness-by-setting-x-google-start-bitrate

Conversation

@xianshijing-lk

@xianshijing-lk xianshijing-lk commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Improve initial video quality by:

  1. Capping x-google-start-bitrate at 1 Mbps to prevent BWE from starting too aggressively on high bitrate tracks
  2. Setting source-based degradationPreference defaults for optimal quality per use case

Changes

PCTransport.ts

  • Added 1 Mbps cap on x-google-start-bitrate: min(target * 0.9, 1000 kbps)
  • Prevents bandwidth estimator from overwhelming the network on high bitrate tracks (e.g., 4K video)

publishUtils.ts

  • Updated getDefaultDegradationPreference() to return defaults based on track source:
    • Camera: maintain-framerate (smoother video for real-time communication)
    • Screen share: maintain-resolution (clarity is critical for text/UI)
    • Other/unknown: balanced

options.ts

  • Updated documentation for degradationPreference option

Behavior
│ Setting │ Before │ After │
│ x-google-start-bitrate │ 90% of target (unbounded) │ min(90% of target, 1 Mbps) │
│ Camera degradationPreference │ maintain-resolution │ maintain-framerate │
│ Screen share degradationPreference │ maintain-resolution │ maintain-resolution │
│ Other degradationPreference │ maintain-resolution │ balanced │

Related

Aligns with rust-sdks PRs:

See Rust PR: livekit/rust-sdks#1197

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d1403cb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 101.45 KB (-0.03% 🔽)
dist/livekit-client.umd.js 110.52 KB (+0.15% 🔺)

Comment thread src/room/PCTransport.ts Outdated
devin-ai-integration[bot]

This comment was marked as resolved.

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.

2 participants