switch targetBitrate to inputBitrate

This commit is contained in:
matty 2024-06-27 23:33:19 -04:00
parent 11c0799ad0
commit 22b624d738

13
dist/main.js vendored
View File

@ -215,12 +215,13 @@ function buildInitOptions() {
async function vodBuilder(params) {
const { resolution, fps, streamNum, inputBitrate } = params;
const streamSuffix = streamNum == undefined ? '' : `:${streamNum}`;
let targetBitrate = getTargetBitrate(resolution, fps);
// let targetBitrate = getTargetBitrate(resolution, fps);
// let targetBitrate = inputBitrate;
let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum);
if (targetBitrate > inputBitrate) {
targetBitrate = inputBitrate;
}
// if (targetBitrate > inputBitrate) {
// targetBitrate = inputBitrate;
// }
let targetBitrate = inputBitrate;
logger.info(`Building encoder options, received ${JSON.stringify(params)}`);
if (shouldInitVaapi && streamNum != undefined) {
latestStreamNum = streamNum;
@ -249,8 +250,8 @@ 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;