Update flows

This commit is contained in:
HaveAGitGat 2023-08-26 17:53:07 +01:00
parent 658857fdf4
commit 25c4fab8d9
73 changed files with 4295 additions and 839 deletions

View file

@ -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,