diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-09 13:59:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-09 13:59:51 +0200 |
commit | 7f529402d17a918136af7a1291e61a94c2e16f6d (patch) | |
tree | 3511cd5bab75951a93ac4f0c0f1b75acb442e5e0 /server/lib | |
parent | 51335c72cf1119a92901edeaa5c7dfc1feef3ca4 (diff) | |
download | PeerTube-7f529402d17a918136af7a1291e61a94c2e16f6d.tar.gz PeerTube-7f529402d17a918136af7a1291e61a94c2e16f6d.tar.zst PeerTube-7f529402d17a918136af7a1291e61a94c2e16f6d.zip |
Fix live max rate
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/transcoding/default-transcoding-profiles.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/transcoding/default-transcoding-profiles.ts b/server/lib/transcoding/default-transcoding-profiles.ts index ba98a11ca..8f01f57a5 100644 --- a/server/lib/transcoding/default-transcoding-profiles.ts +++ b/server/lib/transcoding/default-transcoding-profiles.ts | |||
@@ -49,7 +49,7 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = (options: EncoderOp | |||
49 | 49 | ||
50 | return { | 50 | return { |
51 | outputOptions: [ | 51 | outputOptions: [ |
52 | ...getCommonOutputOptions(targetBitrate), | 52 | ...getCommonOutputOptions(targetBitrate, streamNum), |
53 | 53 | ||
54 | `${buildStreamSuffix('-r:v', streamNum)} ${fps}`, | 54 | `${buildStreamSuffix('-r:v', streamNum)} ${fps}`, |
55 | `${buildStreamSuffix('-b:v', streamNum)} ${targetBitrate}` | 55 | `${buildStreamSuffix('-b:v', streamNum)} ${targetBitrate}` |
@@ -271,11 +271,11 @@ function capBitrate (inputBitrate: number, targetBitrate: number) { | |||
271 | return Math.min(targetBitrate, inputBitrateWithMargin) | 271 | return Math.min(targetBitrate, inputBitrateWithMargin) |
272 | } | 272 | } |
273 | 273 | ||
274 | function getCommonOutputOptions (targetBitrate: number) { | 274 | function getCommonOutputOptions (targetBitrate: number, streamNum?: number) { |
275 | return [ | 275 | return [ |
276 | `-preset veryfast`, | 276 | `-preset veryfast`, |
277 | `-maxrate ${targetBitrate}`, | 277 | `${buildStreamSuffix('-maxrate:v', streamNum)} ${targetBitrate}`, |
278 | `-bufsize ${targetBitrate * 2}`, | 278 | `${buildStreamSuffix('-bufsize:v', streamNum)} ${targetBitrate * 2}`, |
279 | 279 | ||
280 | // NOTE: b-strategy 1 - heuristic algorithm, 16 is optimal B-frames for it | 280 | // NOTE: b-strategy 1 - heuristic algorithm, 16 is optimal B-frames for it |
281 | `-b_strategy 1`, | 281 | `-b_strategy 1`, |