"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.plugin = exports.details = void 0; var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ var details = function () { return ({ name: 'Set Video Bitrate', description: 'Set Video Bitrate', style: { borderColor: '#6efefc', }, tags: 'video', isStartPlugin: false, pType: '', requiresVersion: '2.11.01', sidebarPosition: -1, icon: '', inputs: [ { label: 'Bitrate', name: 'bitrate', type: 'string', defaultValue: '5000', inputUI: { type: 'text', }, tooltip: 'Specify bitrate in kbps', }, ], outputs: [ { number: 1, tooltip: 'Continue to next plugin', }, ], }); }; exports.details = details; // eslint-disable-next-line @typescript-eslint/no-unused-vars var plugin = function (args) { var lib = require('../../../../../methods/lib')(); // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); args.variables.ffmpegCommand.streams.forEach(function (stream) { if (stream.codec_type === 'video') { var ffType = (0, fileUtils_1.getFfType)(stream.codec_type); stream.outputArgs.push("-b:".concat(ffType, ":{outputTypeIndex}"), "".concat(String(args.inputs.bitrate), "k")); } }); return { outputFileObj: args.inputFileObj, outputNumber: 1, variables: args.variables, }; }; exports.plugin = plugin;