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 {
|
import {
|
||||||
AudioPresets,
|
|
||||||
DefaultReconnectPolicy,
|
DefaultReconnectPolicy,
|
||||||
type RoomOptions,
|
type RoomOptions,
|
||||||
ScreenSharePresets,
|
|
||||||
type TrackPublishDefaults,
|
type TrackPublishDefaults,
|
||||||
type VideoPreset,
|
VideoPreset,
|
||||||
VideoPresets,
|
VideoPresets,
|
||||||
} from "livekit-client";
|
} from "livekit-client";
|
||||||
|
|
||||||
const defaultLiveKitPublishOptions: TrackPublishDefaults = {
|
const defaultLiveKitPublishOptions: TrackPublishDefaults = {
|
||||||
audioPreset: AudioPresets.music,
|
audioPreset: { maxBitrate: 320_000 },
|
||||||
dtx: true,
|
dtx: false,
|
||||||
// disable red because the livekit server strips out red packets for clients
|
// 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.
|
// that don't support it (firefox) but of course that doesn't work with e2ee.
|
||||||
red: false,
|
red: false,
|
||||||
forceStereo: false,
|
forceStereo: true,
|
||||||
simulcast: true,
|
// VP9 SVC replaces simulcast — one stream with embedded spatial/temporal layers.
|
||||||
videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360] as VideoPreset[],
|
simulcast: false,
|
||||||
screenShareEncoding: ScreenSharePresets.h1080fps30.encoding,
|
screenShareEncoding: new VideoPreset(1920, 1080, 8_000_000, 60, "medium")
|
||||||
|
.encoding,
|
||||||
stopMicTrackOnMute: false,
|
stopMicTrackOnMute: false,
|
||||||
videoCodec: "vp8",
|
videoCodec: "vp9",
|
||||||
videoEncoding: VideoPresets.h720.encoding,
|
videoEncoding: { maxBitrate: 8_000_000, maxFramerate: 30 },
|
||||||
backupCodec: { codec: "vp8", encoding: VideoPresets.h720.encoding },
|
backupCodec: true,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const defaultLiveKitOptions: RoomOptions = {
|
export const defaultLiveKitOptions: RoomOptions = {
|
||||||
@@ -40,7 +39,7 @@ export const defaultLiveKitOptions: RoomOptions = {
|
|||||||
|
|
||||||
// capture settings
|
// capture settings
|
||||||
videoCaptureDefaults: {
|
videoCaptureDefaults: {
|
||||||
resolution: VideoPresets.h720.resolution,
|
resolution: VideoPresets.h1080.resolution,
|
||||||
},
|
},
|
||||||
|
|
||||||
// publish settings
|
// publish settings
|
||||||
|
|||||||
Reference in New Issue
Block a user