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
This commit is contained in:
17
Dockerfile.sunbeam
Normal file
17
Dockerfile.sunbeam
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user