Skip to content

Commit 717bd1c

Browse files
committed
add h264 specific presets and use them as simlucast layers
1 parent 8b3af00 commit 717bd1c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/livekit/options.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ import {
1111
type RoomOptions,
1212
ScreenSharePresets,
1313
type TrackPublishDefaults,
14-
type VideoPreset,
14+
VideoPreset,
1515
VideoPresets,
1616
} from "livekit-client";
1717

18+
const VideoPresetsH264 = {
19+
h144: new VideoPreset(256, 144, 120_000, 20),
20+
h176: new VideoPreset(320, 176, 160_000, 20),
21+
h288: new VideoPreset(512, 288, 180_000, 20),
22+
h360: VideoPresets.h360,
23+
} as const;
24+
1825
const defaultLiveKitPublishOptions: TrackPublishDefaults = {
1926
audioPreset: AudioPresets.music,
2027
dtx: true,
@@ -23,7 +30,10 @@ const defaultLiveKitPublishOptions: TrackPublishDefaults = {
2330
red: false,
2431
forceStereo: false,
2532
simulcast: true,
26-
videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360] as VideoPreset[],
33+
videoSimulcastLayers: [
34+
VideoPresetsH264.h176,
35+
VideoPresetsH264.h360,
36+
] as VideoPreset[],
2737
screenShareEncoding: ScreenSharePresets.h1080fps30.encoding,
2838
stopMicTrackOnMute: false,
2939
videoCodec: "h264",

0 commit comments

Comments
 (0)