diff --git a/server/lib/live/shared/muxing-session.ts b/server/lib/live/shared/muxing-session.ts index a6907142d..b52363af7 100644 --- a/server/lib/live/shared/muxing-session.ts +++ b/server/lib/live/shared/muxing-session.ts @@ -101,7 +101,7 @@ class MuxingSession extends EventEmitter { this.fps = options.fps this.bitrate = options.bitrate - this.ratio = options.bitrate + this.ratio = options.ratio this.allResolutions = options.allResolutions diff --git a/server/lib/transcoding/video-transcoding-profiles.ts b/server/lib/transcoding/video-transcoding-profiles.ts index a8176dca5..848b823e6 100644 --- a/server/lib/transcoding/video-transcoding-profiles.ts +++ b/server/lib/transcoding/video-transcoding-profiles.ts @@ -237,5 +237,8 @@ export { function capBitrate (inputBitrate: number, targetBitrate: number) { if (!inputBitrate) return targetBitrate - return Math.min(targetBitrate, inputBitrate) + // Add 30% margin to input bitrate + const inputBitrateWithMargin = inputBitrate + (inputBitrate * 0.3) + + return Math.min(targetBitrate, inputBitrateWithMargin) }