add logging, refactor

This commit is contained in:
matty 2024-04-14 15:00:59 -04:00
parent d2bacfdb9c
commit a91b8b2a9a

10
dist/main.js vendored
View File

@ -47,7 +47,7 @@ async function register({ settingsManager, peertubeHelpers, transcodingManager:
private: false
});
registerSetting({
name: 'hevc-encode',
name: 'hevc-enabled',
label: 'Enable H265 NVENC',
type: 'input-checkbox',
descriptionHTML: 'Enables H265 NVENC (experimental)',
@ -132,7 +132,7 @@ async function loadSettings(settingsManager) {
pluginSettings.vodQuality = parseInt(await settingsManager.getSetting('vod-quality')) || DEFAULT_VOD_QUALITY;
pluginSettings.liveQuality = parseInt(await settingsManager.getSetting('live-quality')) || DEFAULT_LIVE_QUALITY;
pluginSettings.hevcProfile = parseInt(await settingsManager.getSetting('hevc-profile')) || DEFAULT_HEVC_PROFILE;
pluginSettings.hevcEnabled = await settingsManager.getSetting('hevc-encode') == "true";
pluginSettings.hevcEnabled = await settingsManager.getSetting('hevc-enabled') == "true";
for (const [resolution, bitrate] of DEFAULT_BITRATES) {
const key = `base-bitrate-${resolution}`;
const storedValue = await settingsManager.getSetting(key);
@ -142,7 +142,7 @@ async function loadSettings(settingsManager) {
logger.info(`Hardware decode: ${pluginSettings.hardwareDecode}`);
logger.info(`VOD Quality: ${pluginSettings.vodQuality}`);
logger.info(`Live Quality: ${pluginSettings.liveQuality}`);
logger.info(`HEVC encode: ${pluginSettings.hevcEnabled}`);
logger.info(`HEVC enabled: ${pluginSettings.hevcEnabled}`);
logger.info(`HEVC profile: ${pluginSettings.hevcProfile}`);
}
function printResolution(resolution) {
@ -181,7 +181,7 @@ async function vodBuilder(params) {
if (targetBitrate > inputBitrate) {
targetBitrate = inputBitrate;
}
logger.info(`Building encoder options, received ${JSON.stringify(params)}`);
logger.info(`Building encoder options, received ${JSON.stringify(params)}, HEVC: ${pluginSettings.hevcEnabled}`);
if (shouldInitVaapi && streamNum != undefined) {
latestStreamNum = streamNum;
}
@ -238,7 +238,7 @@ async function liveBuilder(params) {
if (targetBitrate > inputBitrate) {
targetBitrate = inputBitrate;
}
logger.info(`Building encoder options, received ${JSON.stringify(params)}`);
logger.info(`Building encoder options, received ${JSON.stringify(params)}, HEVC: ${pluginSettings.hevcEnabled}`);
if (shouldInitVaapi && streamNum != undefined) {
latestStreamNum = streamNum;
}