re-add target bitrate get, rather than input stream
This commit is contained in:
parent
3339d58a93
commit
1e39ac631d
20
dist/main.js
vendored
20
dist/main.js
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user