mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 02:35:54 -07:00
commit
81d79efa8f
37 changed files with 117 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
var os_1 = __importDefault(require("os"));
|
var os_1 = __importDefault(require("os"));
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: '10 Bit Video',
|
name: '10 Bit Video',
|
||||||
|
|
@ -32,6 +33,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||||
var stream = args.variables.ffmpegCommand.streams[i];
|
var stream = args.variables.ffmpegCommand.streams[i];
|
||||||
if (stream.codec_type === 'video') {
|
if (stream.codec_type === 'video') {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Crop Black Bars',
|
name: 'Crop Black Bars',
|
||||||
|
|
@ -29,6 +30,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
return {
|
return {
|
||||||
outputFileObj: args.inputFileObj,
|
outputFileObj: args.inputFileObj,
|
||||||
outputNumber: 1,
|
outputNumber: 1,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Custom Arguments',
|
name: 'Custom Arguments',
|
||||||
|
|
@ -50,6 +51,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var inputArguments = String(args.inputs.inputArguments);
|
var inputArguments = String(args.inputs.inputArguments);
|
||||||
var outputArguments = String(args.inputs.outputArguments);
|
var outputArguments = String(args.inputs.outputArguments);
|
||||||
if (inputArguments) {
|
if (inputArguments) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Ensure Audio Stream',
|
name: 'Ensure Audio Stream',
|
||||||
|
|
@ -224,6 +225,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var audioEncoder = String(args.inputs.audioEncoder);
|
var audioEncoder = String(args.inputs.audioEncoder);
|
||||||
var langTag = String(args.inputs.language).toLowerCase();
|
var langTag = String(args.inputs.language).toLowerCase();
|
||||||
var wantedChannelCount = Number(args.inputs.channels);
|
var wantedChannelCount = Number(args.inputs.channels);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
var cliUtils_1 = require("../../../../FlowHelpers/1.0.0/cliUtils");
|
var cliUtils_1 = require("../../../../FlowHelpers/1.0.0/cliUtils");
|
||||||
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Execute',
|
name: 'Execute',
|
||||||
|
|
@ -103,6 +104,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
lib = require('../../../../../methods/lib')();
|
lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
cliArgs = [];
|
cliArgs = [];
|
||||||
cliArgs.push('-y');
|
cliArgs.push('-y');
|
||||||
cliArgs.push('-i');
|
cliArgs.push('-i');
|
||||||
|
|
@ -193,6 +195,8 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
throw new Error('FFmpeg failed');
|
throw new Error('FFmpeg failed');
|
||||||
}
|
}
|
||||||
args.logOutcome('tSuc');
|
args.logOutcome('tSuc');
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
args.variables.ffmpegCommand.init = false;
|
||||||
return [2 /*return*/, {
|
return [2 /*return*/, {
|
||||||
outputFileObj: {
|
outputFileObj: {
|
||||||
_id: outputFilePath,
|
_id: outputFilePath,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'HDR to SDR',
|
name: 'HDR to SDR',
|
||||||
|
|
@ -28,6 +29,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||||
if (stream.codec_type === 'video') {
|
if (stream.codec_type === 'video') {
|
||||||
stream.outputArgs.push('-vf', 'zscale=t=linear:npl=100,format=yuv420p');
|
stream.outputArgs.push('-vf', 'zscale=t=linear:npl=100,format=yuv420p');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Normalize Audio',
|
name: 'Normalize Audio',
|
||||||
|
|
@ -29,6 +30,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
return {
|
return {
|
||||||
outputFileObj: args.inputFileObj,
|
outputFileObj: args.inputFileObj,
|
||||||
outputNumber: 1,
|
outputNumber: 1,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Remove Data Streams',
|
name: 'Remove Data Streams',
|
||||||
|
|
@ -29,6 +30,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||||
if (stream.codec_type === 'data') {
|
if (stream.codec_type === 'data') {
|
||||||
stream.removed = true;
|
stream.removed = true;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Remove Stream By Property',
|
name: 'Remove Stream By Property',
|
||||||
|
|
@ -63,6 +64,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
var propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
||||||
var valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map(function (item) { return item.trim(); });
|
var valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map(function (item) { return item.trim(); });
|
||||||
var condition = String(args.inputs.condition);
|
var condition = String(args.inputs.condition);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Remove Subtitles',
|
name: 'Remove Subtitles',
|
||||||
|
|
@ -29,6 +30,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||||
if (stream.codec_type === 'subtitle') {
|
if (stream.codec_type === 'subtitle') {
|
||||||
stream.removed = true;
|
stream.removed = true;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Reorder Streams',
|
name: 'Reorder Streams',
|
||||||
|
|
@ -79,6 +80,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var streams = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams));
|
var streams = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams));
|
||||||
streams.forEach(function (stream, index) {
|
streams.forEach(function (stream, index) {
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Set Container',
|
name: 'Set Container',
|
||||||
|
|
@ -55,6 +56,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var newContainer = String(args.inputs.container);
|
var newContainer = String(args.inputs.container);
|
||||||
var forceConform = args.inputs.forceConform;
|
var forceConform = args.inputs.forceConform;
|
||||||
if ((0, fileUtils_1.getContainer)(args.inputFileObj._id) !== newContainer) {
|
if ((0, fileUtils_1.getContainer)(args.inputFileObj._id) !== newContainer) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Set Video Framerate',
|
name: 'Set Video Framerate',
|
||||||
|
|
@ -40,6 +41,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var desiredFrameRate = Number(args.inputs.framerate);
|
var desiredFrameRate = Number(args.inputs.framerate);
|
||||||
args.jobLog("Desired framerate: ".concat(desiredFrameRate));
|
args.jobLog("Desired framerate: ".concat(desiredFrameRate));
|
||||||
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
args.variables.ffmpegCommand.streams.forEach(function (stream) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Set Video Resolution',
|
name: 'Set Video Resolution',
|
||||||
|
|
@ -65,6 +66,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||||
var stream = args.variables.ffmpegCommand.streams[i];
|
var stream = args.variables.ffmpegCommand.streams[i];
|
||||||
if (stream.codec_type === 'video') {
|
if (stream.codec_type === 'video') {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Set Video Bitrate',
|
name: 'Set Video Bitrate',
|
||||||
|
|
@ -115,6 +116,7 @@ var plugin = function (args) {
|
||||||
var lib = require('../../../../../methods/lib')();
|
var lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
var useInputBitrate = args.inputs.useInputBitrate;
|
var useInputBitrate = args.inputs.useInputBitrate;
|
||||||
var targetBitratePercent = String(args.inputs.targetBitratePercent);
|
var targetBitratePercent = String(args.inputs.targetBitratePercent);
|
||||||
var fallbackBitrate = String(args.inputs.fallbackBitrate);
|
var fallbackBitrate = String(args.inputs.fallbackBitrate);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.plugin = exports.details = void 0;
|
exports.plugin = exports.details = void 0;
|
||||||
var hardwareUtils_1 = require("../../../../FlowHelpers/1.0.0/hardwareUtils");
|
var hardwareUtils_1 = require("../../../../FlowHelpers/1.0.0/hardwareUtils");
|
||||||
|
var flowUtils_1 = require("../../../../FlowHelpers/1.0.0/interfaces/flowUtils");
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
var details = function () { return ({
|
var details = function () { return ({
|
||||||
name: 'Set Video Encoder',
|
name: 'Set Video Encoder',
|
||||||
|
|
@ -217,6 +218,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
lib = require('../../../../../methods/lib')();
|
lib = require('../../../../../methods/lib')();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
(0, flowUtils_1.checkFfmpegCommandInit)(args);
|
||||||
hardwareDecoding = args.inputs.hardwareDecoding === true;
|
hardwareDecoding = args.inputs.hardwareDecoding === true;
|
||||||
hardwareType = String(args.inputs.hardwareType);
|
hardwareType = String(args.inputs.hardwareType);
|
||||||
args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding;
|
args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding;
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ var plugin = function (args) {
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
var container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
var container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
||||||
var ffmpegCommand = {
|
var ffmpegCommand = {
|
||||||
|
init: true,
|
||||||
inputFiles: [],
|
inputFiles: [],
|
||||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [
|
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [
|
||||||
'-map',
|
'-map',
|
||||||
|
|
|
||||||
15
FlowPlugins/FlowHelpers/1.0.0/interfaces/flowUtils.js
Normal file
15
FlowPlugins/FlowHelpers/1.0.0/interfaces/flowUtils.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.checkFfmpegCommandInit = void 0;
|
||||||
|
// eslint-disable-next-line import/prefer-default-export
|
||||||
|
var checkFfmpegCommandInit = function (args) {
|
||||||
|
var _a, _b;
|
||||||
|
if (!((_b = (_a = args === null || args === void 0 ? void 0 : args.variables) === null || _a === void 0 ? void 0 : _a.ffmpegCommand) === null || _b === void 0 ? void 0 : _b.init)) {
|
||||||
|
throw new Error('FFmpeg command plugins not used correctly.'
|
||||||
|
+ ' Please use the "Begin Command" plugin before using this plugin.'
|
||||||
|
+ ' Afterwards, use the "Execute" plugin to execute the built FFmpeg command.'
|
||||||
|
+ ' Once the "Execute" plugin has been used, you need to use a new "Begin Command"'
|
||||||
|
+ ' plugin to start a new FFmpeg command.');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.checkFfmpegCommandInit = checkFfmpegCommandInit;
|
||||||
|
|
@ -4,6 +4,7 @@ import {
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
IpluginOutputArgs,
|
IpluginOutputArgs,
|
||||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
|
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
const details = () :IpluginDetails => ({
|
const details = () :IpluginDetails => ({
|
||||||
|
|
@ -33,6 +34,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||||
const stream = args.variables.ffmpegCommand.streams[i];
|
const stream = args.variables.ffmpegCommand.streams[i];
|
||||||
if (stream.codec_type === 'video') {
|
if (stream.codec_type === 'video') {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -33,6 +34,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
outputFileObj: args.inputFileObj,
|
outputFileObj: args.inputFileObj,
|
||||||
outputNumber: 1,
|
outputNumber: 1,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -54,6 +55,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const inputArguments = String(args.inputs.inputArguments);
|
const inputArguments = String(args.inputs.inputArguments);
|
||||||
const outputArguments = String(args.inputs.outputArguments);
|
const outputArguments = String(args.inputs.outputArguments);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IffmpegCommandStream,
|
IffmpegCommandStream,
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
|
|
@ -270,6 +271,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const audioEncoder = String(args.inputs.audioEncoder);
|
const audioEncoder = String(args.inputs.audioEncoder);
|
||||||
const langTag = String(args.inputs.language).toLowerCase();
|
const langTag = String(args.inputs.language).toLowerCase();
|
||||||
const wantedChannelCount = Number(args.inputs.channels);
|
const wantedChannelCount = Number(args.inputs.channels);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import {
|
||||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||||
import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils';
|
import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils';
|
||||||
import { getFileName, getPluginWorkDir } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
import { getFileName, getPluginWorkDir } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
|
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
const details = (): IpluginDetails => ({
|
const details = (): IpluginDetails => ({
|
||||||
|
|
@ -68,6 +69,8 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const cliArgs: string[] = [];
|
const cliArgs: string[] = [];
|
||||||
|
|
||||||
cliArgs.push('-y');
|
cliArgs.push('-y');
|
||||||
|
|
@ -180,6 +183,9 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
|
|
||||||
args.logOutcome('tSuc');
|
args.logOutcome('tSuc');
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
args.variables.ffmpegCommand.init = false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
outputFileObj: {
|
outputFileObj: {
|
||||||
_id: outputFilePath,
|
_id: outputFilePath,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -32,6 +33,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||||
if (stream.codec_type === 'video') {
|
if (stream.codec_type === 'video') {
|
||||||
stream.outputArgs.push('-vf', 'zscale=t=linear:npl=100,format=yuv420p');
|
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 {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -33,6 +34,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
outputFileObj: args.inputFileObj,
|
outputFileObj: args.inputFileObj,
|
||||||
outputNumber: 1,
|
outputNumber: 1,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
|
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -35,6 +36,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||||
if (stream.codec_type === 'data') {
|
if (stream.codec_type === 'data') {
|
||||||
stream.removed = true;
|
stream.removed = true;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -84,6 +85,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
const propertyToCheck = String(args.inputs.propertyToCheck).trim();
|
||||||
const valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map((item) => item.trim());
|
const valuesToRemove = String(args.inputs.valuesToRemove).trim().split(',').map((item) => item.trim());
|
||||||
const condition = String(args.inputs.condition);
|
const condition = String(args.inputs.condition);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
|
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -34,6 +35,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
args.variables.ffmpegCommand.streams.forEach((stream) => {
|
||||||
if (stream.codec_type === 'subtitle') {
|
if (stream.codec_type === 'subtitle') {
|
||||||
stream.removed = true;
|
stream.removed = true;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IffmpegCommandStream,
|
IffmpegCommandStream,
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
|
|
@ -109,6 +110,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
let streams: IffmpegCommandStream[] = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams));
|
let streams: IffmpegCommandStream[] = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams));
|
||||||
|
|
||||||
streams.forEach((stream, index) => {
|
streams.forEach((stream, index) => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
|
|
||||||
import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -64,6 +65,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const newContainer = String(args.inputs.container);
|
const newContainer = String(args.inputs.container);
|
||||||
const { forceConform } = args.inputs;
|
const { forceConform } = args.inputs;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -44,6 +45,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const desiredFrameRate = Number(args.inputs.framerate);
|
const desiredFrameRate = Number(args.inputs.framerate);
|
||||||
|
|
||||||
args.jobLog(`Desired framerate: ${desiredFrameRate}`);
|
args.jobLog(`Desired framerate: ${desiredFrameRate}`);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -77,6 +78,8 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) {
|
||||||
const stream = args.variables.ffmpegCommand.streams[i];
|
const stream = args.variables.ffmpegCommand.streams[i];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import {
|
||||||
IpluginOutputArgs,
|
IpluginOutputArgs,
|
||||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||||
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
|
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
const details = (): IpluginDetails => ({
|
const details = (): IpluginDetails => ({
|
||||||
|
|
@ -120,6 +121,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const { useInputBitrate } = args.inputs;
|
const { useInputBitrate } = args.inputs;
|
||||||
const targetBitratePercent = String(args.inputs.targetBitratePercent);
|
const targetBitratePercent = String(args.inputs.targetBitratePercent);
|
||||||
const fallbackBitrate = String(args.inputs.fallbackBitrate);
|
const fallbackBitrate = String(args.inputs.fallbackBitrate);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||||
|
|
||||||
import { getEncoder } from '../../../../FlowHelpers/1.0.0/hardwareUtils';
|
import { getEncoder } from '../../../../FlowHelpers/1.0.0/hardwareUtils';
|
||||||
|
import { checkFfmpegCommandInit } from '../../../../FlowHelpers/1.0.0/interfaces/flowUtils';
|
||||||
import {
|
import {
|
||||||
IpluginDetails,
|
IpluginDetails,
|
||||||
IpluginInputArgs,
|
IpluginInputArgs,
|
||||||
|
|
@ -181,6 +182,8 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
|
checkFfmpegCommandInit(args);
|
||||||
|
|
||||||
const hardwareDecoding = args.inputs.hardwareDecoding === true;
|
const hardwareDecoding = args.inputs.hardwareDecoding === true;
|
||||||
const hardwareType = String(args.inputs.hardwareType);
|
const hardwareType = String(args.inputs.hardwareType);
|
||||||
args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding;
|
args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding;
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
const container = getContainer(args.inputFileObj._id);
|
const container = getContainer(args.inputFileObj._id);
|
||||||
|
|
||||||
const ffmpegCommand = {
|
const ffmpegCommand = {
|
||||||
|
init: true,
|
||||||
inputFiles: [],
|
inputFiles: [],
|
||||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
|
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
|
||||||
...stream,
|
...stream,
|
||||||
|
|
|
||||||
14
FlowPluginsTs/FlowHelpers/1.0.0/interfaces/flowUtils.ts
Normal file
14
FlowPluginsTs/FlowHelpers/1.0.0/interfaces/flowUtils.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { IpluginInputArgs } from './interfaces';
|
||||||
|
|
||||||
|
// eslint-disable-next-line import/prefer-default-export
|
||||||
|
export const checkFfmpegCommandInit = (args: IpluginInputArgs): void => {
|
||||||
|
if (!args?.variables?.ffmpegCommand?.init) {
|
||||||
|
throw new Error(
|
||||||
|
'FFmpeg command plugins not used correctly.'
|
||||||
|
+ ' Please use the "Begin Command" plugin before using this plugin.'
|
||||||
|
+ ' Afterwards, use the "Execute" plugin to execute the built FFmpeg command.'
|
||||||
|
+ ' Once the "Execute" plugin has been used, you need to use a new "Begin Command"'
|
||||||
|
+ ' plugin to start a new FFmpeg command.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -87,6 +87,7 @@ export interface IffmpegCommandStream extends Istreams {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IffmpegCommand {
|
export interface IffmpegCommand {
|
||||||
|
init: boolean,
|
||||||
inputFiles: string[],
|
inputFiles: string[],
|
||||||
streams: IffmpegCommandStream[]
|
streams: IffmpegCommandStream[]
|
||||||
container: string,
|
container: string,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue