Skip to content

Commit

Permalink
Fix vp9 svc encode failed for screenshare (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnderrauber authored Sep 28, 2023
1 parent 3069fa9 commit 4e4e80a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
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

0 comments on commit 4e4e80a

Please sign in to comment.