mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -07:00
Add hardwareType option
This commit is contained in:
parent
4aa7f0cee1
commit
c7349c1c28
8 changed files with 81 additions and 16 deletions
|
|
@ -79,6 +79,22 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tooltip: 'Specify whether to use hardware encoding if available',
|
||||
},
|
||||
{
|
||||
name: 'hardwareType',
|
||||
type: 'string',
|
||||
defaultValue: 'auto',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'auto',
|
||||
'nvenc',
|
||||
'qsv',
|
||||
'vaapi',
|
||||
'videotoolbox',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify codec of the output file',
|
||||
},
|
||||
{
|
||||
name: 'hardwareDecoding',
|
||||
type: 'boolean',
|
||||
|
|
@ -121,6 +137,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
const hardwareDecoding = args.inputs.hardwareDecoding === true;
|
||||
const hardwareType = String(args.inputs.hardwareType);
|
||||
args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding;
|
||||
|
||||
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||
|
|
@ -143,6 +160,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
const encoderProperties = await getEncoder({
|
||||
targetCodec,
|
||||
hardwareEncoding: hardwarEncoding,
|
||||
hardwareType,
|
||||
args,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue