Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vp9 svc encode failed for screenshare #882

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silver-swans-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Fix vp9 svc failed for screenshare
4 changes: 4 additions & 0 deletions src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,10 @@ export default class LocalParticipant extends Participant {
// for svc codecs, disable simulcast and use vp8 for backup codec
if (track instanceof LocalVideoTrack) {
if (isSVCCodec(opts.videoCodec)) {
// vp9 svc with screenshare has problem to encode, always use L1T3 here
if (track.source === Track.Source.ScreenShare && opts.videoCodec === 'vp9') {
opts.scalabilityMode = 'L1T3';
}
// set scalabilityMode to 'L3T3_KEY' by default
opts.scalabilityMode = opts.scalabilityMode ?? 'L3T3_KEY';
}
Expand Down
4 changes: 2 additions & 2 deletions src/room/track/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ export function isCodecEqual(c1: string | undefined, c2: string | undefined): bo
}

/**
* scalability modes for svc, only supprot l3t3 now.
* scalability modes for svc.
*/
export type ScalabilityMode = 'L3T3' | 'L3T3_KEY';
export type ScalabilityMode = 'L1T3' | 'L2T3' | 'L2T3_KEY' | 'L3T3' | 'L3T3_KEY';

export namespace AudioPresets {
export const telephone: AudioPreset = {
Expand Down
Loading