From c75bf0ef8f4c36480b82fbf280e34c3d2be9bdcd Mon Sep 17 00:00:00 2001 From: Sienna Meridian Satterwhite Date: Wed, 25 Mar 2026 22:09:14 +0000 Subject: [PATCH] feat: high-quality video/audio defaults for Sunbeam - VP9 @ 1080p/8Mbps/30fps (was VP8 720p/1.7Mbps) - 320kbps stereo Opus audio (was 48kbps mono) - Screen share @ 1080p/60fps/8Mbps (was 30fps/5Mbps) - VP9 SVC replaces simulcast (single stream with embedded layers) - Auto VP8 fallback for incompatible clients --- Dockerfile.sunbeam | 17 +++++++++++++++++ src/livekit/options.ts | 25 ++++++++++++------------- 2 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 Dockerfile.sunbeam diff --git a/Dockerfile.sunbeam b/Dockerfile.sunbeam new file mode 100644 index 00000000..aeacd199 --- /dev/null +++ b/Dockerfile.sunbeam @@ -0,0 +1,17 @@ +FROM --platform=$BUILDPLATFORM node:24-alpine AS build + +WORKDIR /app +COPY package.json yarn.lock .yarnrc.yml ./ +COPY .yarn .yarn +RUN corepack enable && yarn install --immutable + +COPY . . +RUN yarn build:full + +# Compress assets for nginx gzip_static +WORKDIR /app/dist/assets +RUN gzip -k ../index.html *.js *.map *.css *.wasm *-app-*.json 2>/dev/null || true + +FROM nginxinc/nginx-unprivileged:alpine-slim +COPY --from=build /app/dist /app +COPY config/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/src/livekit/options.ts b/src/livekit/options.ts index 1d4cad77..7bf90e62 100644 --- a/src/livekit/options.ts +++ b/src/livekit/options.ts @@ -6,29 +6,28 @@ Please see LICENSE in the repository root for full details. */ import { - AudioPresets, DefaultReconnectPolicy, type RoomOptions, - ScreenSharePresets, type TrackPublishDefaults, - type VideoPreset, + VideoPreset, VideoPresets, } from "livekit-client"; const defaultLiveKitPublishOptions: TrackPublishDefaults = { - audioPreset: AudioPresets.music, - dtx: true, + audioPreset: { maxBitrate: 320_000 }, + dtx: false, // disable red because the livekit server strips out red packets for clients // that don't support it (firefox) but of course that doesn't work with e2ee. red: false, - forceStereo: false, - simulcast: true, - videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360] as VideoPreset[], - screenShareEncoding: ScreenSharePresets.h1080fps30.encoding, + forceStereo: true, + // VP9 SVC replaces simulcast — one stream with embedded spatial/temporal layers. + simulcast: false, + screenShareEncoding: new VideoPreset(1920, 1080, 8_000_000, 60, "medium") + .encoding, stopMicTrackOnMute: false, - videoCodec: "vp8", - videoEncoding: VideoPresets.h720.encoding, - backupCodec: { codec: "vp8", encoding: VideoPresets.h720.encoding }, + videoCodec: "vp9", + videoEncoding: { maxBitrate: 8_000_000, maxFramerate: 30 }, + backupCodec: true, } as const; export const defaultLiveKitOptions: RoomOptions = { @@ -40,7 +39,7 @@ export const defaultLiveKitOptions: RoomOptions = { // capture settings videoCaptureDefaults: { - resolution: VideoPresets.h720.resolution, + resolution: VideoPresets.h1080.resolution, }, // publish settings