restore target bitrate settings

This commit is contained in:
matty 2024-04-13 18:55:32 -04:00
parent ae2c910f20
commit b24c0e4ef7

20
dist/main.js vendored
View File

@ -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;
@ -176,12 +176,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;