mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
Add checkFfmpegCommandInit(() to ffmpeg command plugins
This commit is contained in:
parent
0ba6ceb182
commit
69afa93e70
15 changed files with 45 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import {
|
|||
IpluginInputArgs,
|
||||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = () :IpluginDetails => ({
|
||||
|
|
@ -33,6 +34,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||
const stream = args.variables.ffmpegCommand.streams[i];
|
||||
if (stream.codec_type === 'video') {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -33,6 +34,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -54,6 +55,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const inputArguments = String(args.inputs.inputArguments);
|
||||
const outputArguments = String(args.inputs.outputArguments);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IffmpegCommandStream,
|
||||
IpluginDetails,
|
||||
|
|
@ -270,6 +271,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const audioEncoder = String(args.inputs.audioEncoder);
|
||||
const langTag = String(args.inputs.language).toLowerCase();
|
||||
const wantedChannelCount = Number(args.inputs.channels);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -32,6 +33,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||
if (stream.codec_type === 'video') {
|
||||
stream.outputArgs.push('-vf', 'zscale=t=linear:npl=100,format=yuv420p');
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -33,6 +34,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -35,6 +36,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||
if (stream.codec_type === 'data') {
|
||||
stream.removed = true;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -84,6 +85,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
||||
const valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map((item) => item.trim());
|
||||
const condition = String(args.inputs.condition);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -34,6 +35,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||
if (stream.codec_type === 'subtitle') {
|
||||
stream.removed = true;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IffmpegCommandStream,
|
||||
IpluginDetails,
|
||||
|
|
@ -109,6 +110,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
let streams: IffmpegCommandStream[] = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams));
|
||||
|
||||
streams.forEach((stream, index) => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
|
||||
import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -64,6 +65,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const newContainer = String(args.inputs.container);
|
||||
const { forceConform } = args.inputs;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -44,6 +45,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const desiredFrameRate = Number(args.inputs.framerate);
|
||||
|
||||
args.jobLog(`Desired framerate: ${desiredFrameRate}`);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -77,6 +78,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||
const stream = args.variables.ffmpegCommand.streams[i];
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = (): IpluginDetails => ({
|
||||
|
|
@ -120,6 +121,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const { useInputBitrate } = args.inputs;
|
||||
const targetBitratePercent = String(args.inputs.targetBitratePercent);
|
||||
const fallbackBitrate = String(args.inputs.fallbackBitrate);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
|
||||
import { getEncoder } from '../../../../FlowHelpers/1.0.0/hardwareUtils';
|
||||
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
|
|
@ -181,6 +182,8 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
checkFfmpegCommandInit(args);
|
||||
|
||||
const hardwareDecoding = args.inputs.hardwareDecoding === true;
|
||||
const hardwareType = String(args.inputs.hardwareType);
|
||||
args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue