Skip to content

Commit

Permalink
Do not try to manually adjust SVC layers based off target resolution (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hensmi-amazon authored Jul 8, 2024
1 parent 706a3b5 commit e12a7ab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

### Changed
- Do not try to manually adjust SVC layers based off target resolution, as this may lead to an unnecessarily high minimum bitrate to subscribe to all remote videos. Instead rely on browser logic which drops any layers below around 135p.

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions docs/classes/nscalevideouplinkbandwidthpolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h3>set<wbr>Meeting<wbr>Supported<wbr>Video<wbr>Send<wbr>Codecs</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/videouplinkbandwidthpolicy.html">VideoUplinkBandwidthPolicy</a>.<a href="../interfaces/videouplinkbandwidthpolicy.html#setmeetingsupportedvideosendcodecs">setMeetingSupportedVideoSendCodecs</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts#L303">src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts:303</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts#L304">src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts:304</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -622,7 +622,7 @@ <h3>wants<wbr>Video<wbr>Dependency<wbr>Descriptor<wbr>Rtp<wbr>Header<wbr>Extensi
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/videouplinkbandwidthpolicy.html">VideoUplinkBandwidthPolicy</a>.<a href="../interfaces/videouplinkbandwidthpolicy.html#wantsvideodependencydescriptorrtpheaderextension">wantsVideoDependencyDescriptorRtpHeaderExtension</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts#L299">src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts:299</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts#L300">src/videouplinkbandwidthpolicy/NScaleVideoUplinkBandwidthPolicy.ts:300</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ export default class NScaleVideoUplinkBandwidthPolicy implements VideoUplinkBand
if ((this.numParticipants >= 0 && this.numParticipants < 3) || !this.isUsingSVCCodec) {
scalabilityMode = 'L1T1';
} else {
scalabilityMode = targetHeight >= 720 ? 'L3T3' : targetHeight >= 360 ? 'L2T3' : 'L1T3';
// We do not limit the number of layers depending on input resolution, however Chrome will drop anything below around 135p.
scalabilityMode = 'L3T3';
}
this.logger?.info(
`calculateEncodingParameters: SVC: ${this.enableSVC} participants: ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,40 +898,6 @@ describe('NScaleVideoUplinkBandwidthPolicy', () => {
expect(policy.optimalParameters.isSVCEncoding()).to.be.true;
});

it('Degrade to L2T3 scalability mode if target height is between 360 and 720', () => {
policy.setTransceiverController(transceiverController);
// @ts-ignore
policy.isUsingSVCCodec = false;
// @ts-ignore
policy.numParticipants = 10;
// @ts-ignore
policy.numberOfPublishedVideoSources = 8;
policy.setSVCEnabled(true);
policy.setMeetingSupportedVideoSendCodecs(
[VideoCodecCapability.vp9Profile0()],
[VideoCodecCapability.vp9Profile0(), VideoCodecCapability.h264ConstrainedBaselineProfile()]
);
// @ts-ignore
expect(policy.optimalParameters.isSVCEncoding()).to.be.true;
});

it('Degrade to L1T3 scalability mode if target height is below 360', () => {
policy.setTransceiverController(transceiverController);
// @ts-ignore
policy.isUsingSVCCodec = false;
// @ts-ignore
policy.numParticipants = 16;
// @ts-ignore
policy.numberOfPublishedVideoSources = 14;
policy.setSVCEnabled(true);
policy.setMeetingSupportedVideoSendCodecs(
[VideoCodecCapability.vp9Profile0()],
[VideoCodecCapability.vp9Profile0(), VideoCodecCapability.h264ConstrainedBaselineProfile()]
);
// @ts-ignore
expect(policy.optimalParameters.isSVCEncoding()).to.be.true;
});

it('Enables SVC when SVC is enabled, even if logger is not defined', () => {
policy = new NScaleVideoUplinkBandwidthPolicy(selfAttendeeId, true);
policy.setTransceiverController(transceiverController);
Expand Down

0 comments on commit e12a7ab

Please sign in to comment.