Repository navigation
fix(sdk): scale simulcast layers explicitly for Chrome 154+ (OPTI-4760) - #563
Merged
Merged
Conversation
Co-Authored-By: Brendon Costa <brendon.costa@dolby.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
🦋 Changeset detectedLatest commit: 90327f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
✅ Devin resolved the finding on 90327f9
Fixed by Devin (1)
- Scaling tests bypass publishing integration
Co-Authored-By: Brendon Costa <brendon.costa@dolby.com>
…lcast-scaling Co-Authored-By: Brendon Costa <brendon.costa@dolby.com> # Conflicts: # packages/millicast-sdk/tests/features/Publish.feature # packages/millicast-sdk/tests/unit/Publish.steps.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes OPTI-4760. On Chrome 154 and later,
simulcast: truepublishes three layers that are all at full capture resolution (e.g. 3x 1280x720 at about 0.8 / 0.8 / 3.8 Mbps). Earlier Chrome versions send 1/4, 1/2 and full resolution. We have seen this in production.Cause: WebRTC 341526e2ca "[Interop 2026] Apply simulcast scaling defaults" (chromium:344943229) makes
addTransceiverwritescaleResolutionDownBy: 1on the single encoding.SdpParser.setSimulcast()then adds two more layers by munging the SDP (a=ssrc-group:SIM), and those layers get no scale. AftersetLocalDescription,getParameters().encodingsreports scale[1, undefined, undefined], and Chrome encodes every layer at full size.Fix: add
PeerConnection.setSimulcastScaling(). Once the munged local description is set, it sets the video sender's encodings toscaleResolutionDownBy = 2 ** (n - 1 - i), i.e.[4, 2, 1]for 3 layers:getParametersor fewer than 2 encodings. This covers non-Chromium browsers and codecs wheresetSimulcast()leaves the SDP unchanged.setParametersfailure is logged as a warning and does not break publishing.Testing
SetLocalDescription.feature: 3 encodings are set to[4, 2, 1]; a single encoding is left unchanged;getRTCLocalSDP({simulcast:true})callssetSimulcastScaling.Publish.feature:connect({simulcast:true})callssetSimulcastScalingonce, andconnect()without simulcast does not call it.getRTCLocalSDP({simulcast:true})andsetLocalDescriptionsteps, with a 1280x720 fake camera in Chrome for Testing. Layer sizes are read fromoutbound-rtpstats:[4,2,1]The scaling also still applies after a later
updateBitrate()renegotiation, checked on 153, 154 and 157.Link to Devin session: https://dolby.devinenterprise.com/sessions/00476be9da3b47819e7c35883c75e293
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/00476be9da3b47819e7c35883c75e293?variant=devin
Requested by: @bcostdolby