Adjust bframes options

make-only-subtitle-default
HaveAGitGat 2 years ago
parent abfa9af5aa
commit d8a86dc6d5

@ -90,7 +90,7 @@ const details = () => ({
false`, false`,
}, },
{ {
name: 'enable_bframes', name: 'bframes_enabled',
type: 'boolean', type: 'boolean',
defaultValue: false, defaultValue: false,
inputUI: { inputUI: {
@ -109,6 +109,15 @@ const details = () => ({
\\nExample:\\n \\nExample:\\n
false`, false`,
}, },
{
name: 'bframes_value',
type: 'number',
defaultValue: 5,
inputUI: {
type: 'text',
},
tooltip: 'Specify number of bframes to use.',
},
{ {
name: 'force_conform', name: 'force_conform',
type: 'boolean', type: 'boolean',
@ -133,6 +142,11 @@ const details = () => ({
], ],
}); });
const bframeSupport = [
'hevc_nvenc',
'h264_nvenc',
];
const hasEncoder = async ({ const hasEncoder = async ({
ffmpegPath, ffmpegPath,
encoder, encoder,
@ -358,9 +372,9 @@ const plugin = async (file, librarySettings, inputs, otherArguments) => {
} }
// Check if b frame variable is true. // Check if b frame variable is true.
if (encoder === 'hevc_nvenc' && inputs.enable_bframes === true) { if (bframeSupport.includes(encoder) && inputs.bframes_enabled === true) {
// If set to true then add b frames argument // If set to true then add b frames argument
extraArguments += '-bf 5 '; extraArguments += `-bf ${inputs.bframes_value} `;
} }
// Go through each stream in the file. // Go through each stream in the file.

Loading…
Cancel
Save