17 Commits

Author SHA1 Message Date
2ef8b2deec cq 21 2024-04-13 23:54:50 -04:00
6a150618b9 change to cq 20 rather than 22 2024-04-13 22:13:37 -04:00
6640ba5c25 bump version 2024-04-13 20:33:17 -04:00
6a47bd9e77 keep -cq within bitrate limits, we'll see how it goes 2024-04-13 20:32:58 -04:00
bdcdb2e8e5 cq 24 again, no bitrate 2024-04-13 19:53:49 -04:00
356caf37fd rely on -cq rather than bitrate, remove bufsize 2024-04-13 19:48:34 -04:00
8483a37bae fuck it, cq 24 2024-04-13 19:45:24 -04:00
940ca6d751 back to -cq 22 2024-04-13 19:45:00 -04:00
9848e0de9f test -cq 18 from -cq 24 2024-04-13 19:32:34 -04:00
de17b72171 add rc:v vbr and -bf 4 2024-04-13 19:18:32 -04:00
c92e017680 bump version 2024-04-13 19:05:23 -04:00
4b8b0e4888 fuck it, just go with input bitrate 2024-04-13 19:04:47 -04:00
b24c0e4ef7 restore target bitrate settings 2024-04-13 18:55:32 -04:00
ae2c910f20 remove erroneous stuff 2024-04-13 18:14:56 -04:00
ee56666c33 fix syntax error 2024-04-13 18:08:01 -04:00
35ffb74383 cq 22, re-add bufsize and bitrate shit 2024-04-13 18:02:09 -04:00
84cc3a58cd replace -cq 21 with -cq 23 2024-04-13 17:35:51 -04:00
2 changed files with 21 additions and 16 deletions

35
dist/main.js vendored
View File

@ -146,12 +146,12 @@ function buildInitOptions() {
async function vodBuilder(params) { async function vodBuilder(params) {
const { resolution, fps, streamNum, inputBitrate } = params; const { resolution, fps, streamNum, inputBitrate } = params;
const streamSuffix = streamNum == undefined ? '' : `:${streamNum}`; const streamSuffix = streamNum == undefined ? '' : `:${streamNum}`;
// let targetBitrate = getTargetBitrate(resolution, fps); //let targetBitrate = getTargetBitrate(resolution, fps);
let targetBitrate = inputBitrate; let targetBitrate = inputBitrate;
let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum); let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum);
// if (targetBitrate > inputBitrate) { //if (targetBitrate > inputBitrate) {
// targetBitrate = inputBitrate; // targetBitrate = inputBitrate;
// } //}
logger.info(`Building encoder options, received ${JSON.stringify(params)}`); logger.info(`Building encoder options, received ${JSON.stringify(params)}`);
if (shouldInitVaapi && streamNum != undefined) { if (shouldInitVaapi && streamNum != undefined) {
latestStreamNum = streamNum; latestStreamNum = streamNum;
@ -163,12 +163,14 @@ async function vodBuilder(params) {
inputOptions: shouldInitVaapi ? buildInitOptions() : [], inputOptions: shouldInitVaapi ? buildInitOptions() : [],
outputOptions: [ outputOptions: [
`-preset ${pluginSettings.vodQuality}`, `-preset ${pluginSettings.vodQuality}`,
// `-b:v${streamSuffix} ${targetBitrate}`, `-b:v${streamSuffix} ${targetBitrate}`,
// `-bufsize ${targetBitrate * 2}`, //`-b:v${streamSuffix} 0`,
//`-crf 21`, // increased 19 to 21, file size massive `-bufsize ${targetBitrate * 2}`,
`-profile:v${streamSuffix} high`, `-profile:v${streamSuffix} high`,
`-cq 21`, `-cq 21`,
`-c:v${streamSuffix} h264_nvenc` `-rc:v vbr`,
`-c:v${streamSuffix} h264_nvenc`,
`-bf 4`
] ]
}; };
logger.info(`EncoderOptions: ${JSON.stringify(options)}`); logger.info(`EncoderOptions: ${JSON.stringify(options)}`);
@ -180,9 +182,9 @@ async function liveBuilder(params) {
// let targetBitrate = getTargetBitrate(resolution, fps); // let targetBitrate = getTargetBitrate(resolution, fps);
let targetBitrate = inputBitrate; let targetBitrate = inputBitrate;
let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum); let shouldInitVaapi = (streamNum == undefined || streamNum <= latestStreamNum);
// if (targetBitrate > inputBitrate) { //if (targetBitrate > inputBitrate) {
// targetBitrate = inputBitrate; // targetBitrate = inputBitrate;
// } //}
logger.info(`Building encoder options, received ${JSON.stringify(params)}`); logger.info(`Building encoder options, received ${JSON.stringify(params)}`);
if (shouldInitVaapi && streamNum != undefined) { if (shouldInitVaapi && streamNum != undefined) {
latestStreamNum = streamNum; latestStreamNum = streamNum;
@ -194,13 +196,16 @@ async function liveBuilder(params) {
inputOptions: shouldInitVaapi ? buildInitOptions() : [], inputOptions: shouldInitVaapi ? buildInitOptions() : [],
outputOptions: [ outputOptions: [
`-tune ${pluginSettings.liveQuality}`, `-tune ${pluginSettings.liveQuality}`,
// `-r:v${streamSuffix} ${fps}`, `-r:v${streamSuffix} ${fps}`,
`-profile:v${streamSuffix} high`, `-profile:v${streamSuffix} high`,
`-c:v${streamSuffix} h264_nvenc`, `-c:v${streamSuffix} h264_nvenc`,
`-cq 21` `-cq 21`,
// `-g:v${streamSuffix} ${fps * 2}`, `-g:v${streamSuffix} ${fps * 2}`,
// `-b:v${streamSuffix} ${targetBitrate}`, `-b:v${streamSuffix} ${targetBitrate}`,
// `-bufsize ${targetBitrate * 2}`, //`-b:v${streamSuffix} 0`,
`-bufsize ${targetBitrate * 2}`,
`-rc:v vbr`,
`-bf 4`
] ]
}; };
logger.info(`EncoderOptions: ${JSON.stringify(options)}`); logger.info(`EncoderOptions: ${JSON.stringify(options)}`);

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-plugin-nctv-nvenc-transcode", "name": "peertube-plugin-nctv-nvenc-transcode",
"version": "1.0.7", "version": "1.1.1",
"license": "MIT", "license": "MIT",
"description": "Plugin that adds transcode profiles which use NVIDIA NVENC for hardware acceleration", "description": "Plugin that adds transcode profiles which use NVIDIA NVENC for hardware acceleration",
"engine": { "engine": {