From 19bdd3fbead888fbdbf759322151be2ffbdcdcf4 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Thu, 17 Aug 2023 12:01:57 +0800 Subject: [PATCH 1/2] Force enable dynacast if backupCodec is used --- .changeset/four-seals-flash.md | 5 +++++ src/room/participant/LocalParticipant.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/four-seals-flash.md diff --git a/.changeset/four-seals-flash.md b/.changeset/four-seals-flash.md new file mode 100644 index 0000000000..0569f73139 --- /dev/null +++ b/.changeset/four-seals-flash.md @@ -0,0 +1,5 @@ +--- +'livekit-client': patch +--- + +Force enable dynacast when backupCodec is enabled diff --git a/src/room/participant/LocalParticipant.ts b/src/room/participant/LocalParticipant.ts index f9493434fb..671b442950 100644 --- a/src/room/participant/LocalParticipant.ts +++ b/src/room/participant/LocalParticipant.ts @@ -682,6 +682,9 @@ export default class LocalParticipant extends Participant { // set up backup if (opts.videoCodec && opts.backupCodec && opts.videoCodec !== opts.backupCodec.codec) { + if (!this.roomOptions.dynacast) { + this.roomOptions.dynacast = true; + } const simOpts = { ...opts }; simOpts.simulcast = true; simEncodings = computeTrackBackupEncodings(track, opts.backupCodec.codec, simOpts); From 524e2d9e864d4999278d8e3fdcaacb2a6e70883a Mon Sep 17 00:00:00 2001 From: David Zhao Date: Wed, 16 Aug 2023 22:08:00 -0700 Subject: [PATCH 2/2] add comment --- src/options.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/options.ts b/src/options.ts index 080595bf23..cb0d648744 100644 --- a/src/options.ts +++ b/src/options.ts @@ -31,6 +31,9 @@ export interface InternalRoomOptions { * enable Dynacast, off by default. With Dynacast dynamically pauses * video layers that are not being consumed by any subscribers, significantly * reducing publishing CPU and bandwidth usage. + * + * Dynacast will be enabled if SVC codecs (VP9/AV1) are used. Multi-codec simulcast + * requires dynacast */ dynacast: boolean;