mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -07:00
Update flows
This commit is contained in:
parent
658857fdf4
commit
25c4fab8d9
73 changed files with 4295 additions and 839 deletions
|
|
@ -3,20 +3,30 @@ import {
|
|||
IpluginInputArgs,
|
||||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = () :IpluginDetails => ({
|
||||
name: 'Reorder Streams',
|
||||
description: 'Reorder Streams',
|
||||
name: 'Set Video Bitrate',
|
||||
description: 'Set Video Bitrate',
|
||||
style: {
|
||||
borderColor: '#6efefc',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
inputs: [
|
||||
{
|
||||
name: 'bitrate',
|
||||
type: 'string',
|
||||
defaultValue: '5000',
|
||||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
tooltip: 'Specify bitrate in kbps',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
|
|
@ -31,6 +41,13 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||
if (stream.codec_type === 'video') {
|
||||
const ffType = getFfType(stream.codec_type);
|
||||
stream.outputArgs.push(`-b:${ffType}:{outputTypeIndex}`, `${String(args.inputs.bitrate)}k`);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue