mirror of https://github.com/Chocobozzz/PeerTube
Fix live max rate
parent
51335c72cf
commit
7f529402d1
|
@ -49,7 +49,7 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = (options: EncoderOp
|
||||||
|
|
||||||
return {
|
return {
|
||||||
outputOptions: [
|
outputOptions: [
|
||||||
...getCommonOutputOptions(targetBitrate),
|
...getCommonOutputOptions(targetBitrate, streamNum),
|
||||||
|
|
||||||
`${buildStreamSuffix('-r:v', streamNum)} ${fps}`,
|
`${buildStreamSuffix('-r:v', streamNum)} ${fps}`,
|
||||||
`${buildStreamSuffix('-b:v', streamNum)} ${targetBitrate}`
|
`${buildStreamSuffix('-b:v', streamNum)} ${targetBitrate}`
|
||||||
|
@ -271,11 +271,11 @@ function capBitrate (inputBitrate: number, targetBitrate: number) {
|
||||||
return Math.min(targetBitrate, inputBitrateWithMargin)
|
return Math.min(targetBitrate, inputBitrateWithMargin)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCommonOutputOptions (targetBitrate: number) {
|
function getCommonOutputOptions (targetBitrate: number, streamNum?: number) {
|
||||||
return [
|
return [
|
||||||
`-preset veryfast`,
|
`-preset veryfast`,
|
||||||
`-maxrate ${targetBitrate}`,
|
`${buildStreamSuffix('-maxrate:v', streamNum)} ${targetBitrate}`,
|
||||||
`-bufsize ${targetBitrate * 2}`,
|
`${buildStreamSuffix('-bufsize:v', streamNum)} ${targetBitrate * 2}`,
|
||||||
|
|
||||||
// NOTE: b-strategy 1 - heuristic algorithm, 16 is optimal B-frames for it
|
// NOTE: b-strategy 1 - heuristic algorithm, 16 is optimal B-frames for it
|
||||||
`-b_strategy 1`,
|
`-b_strategy 1`,
|
||||||
|
|
Loading…
Reference in New Issue