diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-11 16:00:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-11 16:00:39 +0200 |
commit | badacdbb4a3e4a1aae4d324abc496be8e261b2ef (patch) | |
tree | f583a77e978138e72ec77e065856872e44e41682 /server/lib/transcoding/video-transcoding-profiles.ts | |
parent | e5d9877f0640e72653f6d88c743ee331dba6dc5b (diff) | |
parent | 41085b1583ade5ea1bb1d69965a62b98cf012209 (diff) | |
download | PeerTube-badacdbb4a3e4a1aae4d324abc496be8e261b2ef.tar.gz PeerTube-badacdbb4a3e4a1aae4d324abc496be8e261b2ef.tar.zst PeerTube-badacdbb4a3e4a1aae4d324abc496be8e261b2ef.zip |
Merge branch 'release/3.4.0' into develop
Diffstat (limited to 'server/lib/transcoding/video-transcoding-profiles.ts')
-rw-r--r-- | server/lib/transcoding/video-transcoding-profiles.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/transcoding/video-transcoding-profiles.ts b/server/lib/transcoding/video-transcoding-profiles.ts index bf1b8769b..92971210c 100644 --- a/server/lib/transcoding/video-transcoding-profiles.ts +++ b/server/lib/transcoding/video-transcoding-profiles.ts | |||
@@ -237,5 +237,8 @@ export { | |||
237 | function capBitrate (inputBitrate: number, targetBitrate: number) { | 237 | function capBitrate (inputBitrate: number, targetBitrate: number) { |
238 | if (!inputBitrate) return targetBitrate | 238 | if (!inputBitrate) return targetBitrate |
239 | 239 | ||
240 | return Math.min(targetBitrate, inputBitrate) | 240 | // Add 30% margin to input bitrate |
241 | const inputBitrateWithMargin = inputBitrate + (inputBitrate * 0.3) | ||
242 | |||
243 | return Math.min(targetBitrate, inputBitrateWithMargin) | ||
241 | } | 244 | } |