diff --git a/dist/main.js b/dist/main.js index eee9c1a..5d8b1ef 100644 --- a/dist/main.js +++ b/dist/main.js @@ -146,12 +146,12 @@ function buildInitOptions() { async function vodBuilder(params) { const { resolution, fps, streamNum, inputBitrate } = params; const streamSuffix = streamNum == undefined ? '' : `:${streamNum}`; - //let targetBitrate = getTargetBitrate(resolution, fps); - let targetBitrate = inputBitrate; + let targetBitrate = getTargetBitrate(resolution, fps); + // let targetBitrate = inputBitrate; let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum); - //if (targetBitrate > inputBitrate) { - // targetBitrate = inputBitrate; - //} + if (targetBitrate > inputBitrate) { + targetBitrate = inputBitrate; + } logger.info(`Building encoder options, received ${JSON.stringify(params)}`); if (shouldInitVaapi && streamNum != undefined) { latestStreamNum = streamNum; @@ -179,12 +179,12 @@ async function vodBuilder(params) { async function liveBuilder(params) { const { resolution, fps, streamNum, inputBitrate } = params; const streamSuffix = streamNum == undefined ? '' : `:${streamNum}`; - // let targetBitrate = getTargetBitrate(resolution, fps); - let targetBitrate = inputBitrate; + let targetBitrate = getTargetBitrate(resolution, fps); + // let targetBitrate = inputBitrate; let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum); - //if (targetBitrate > inputBitrate) { - // targetBitrate = inputBitrate; - //} + if (targetBitrate > inputBitrate) { + targetBitrate = inputBitrate; + } logger.info(`Building encoder options, received ${JSON.stringify(params)}`); if (shouldInitVaapi && streamNum != undefined) { latestStreamNum = streamNum;