Init flow plugins

This commit is contained in:
HaveAGitGat 2023-08-20 18:02:17 +01:00
parent 92f97a8c81
commit 7521d7eef0
67 changed files with 4765 additions and 0 deletions

View file

@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
name: 'Check Video Codec',
description: 'Check if a file has a specific video codec',
style: {
borderColor: 'orange',
},
tags: 'video',
isStartPlugin: false,
sidebarPosition: -1,
icon: 'faQuestion',
inputs: [
{
name: 'codec',
type: 'string',
defaultValue: 'hevc',
inputUI: {
type: 'dropdown',
options: [
'hevc',
'vp9',
'h264',
'vp8',
],
},
tooltip: 'Specify the codec check for',
},
],
outputs: [
{
number: 1,
tooltip: 'File has codec',
},
{
number: 2,
tooltip: 'File does not have codec',
},
],
}); };
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);
var hasCodec = false;
// @ts-expect-error type
args.inputFileObj.ffProbeData.streams.forEach(function (stream) {
if (stream.codec_type === 'video' && stream.codec_name === args.inputs.codec) {
hasCodec = true;
}
});
return {
outputFileObj: args.inputFileObj,
outputNumber: hasCodec ? 1 : 2,
variables: args.variables,
};
};
exports.plugin = plugin;

View file

@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
name: 'Check Video Resolution',
description: 'Check is video is 480p,576p,720p,1080p,1440p,4KUHD,DCI4K,8KUHD,Other',
style: {
borderColor: 'orange',
},
tags: 'video',
isStartPlugin: false,
sidebarPosition: -1,
icon: 'faQuestion',
inputs: [],
outputs: [
{
number: 1,
tooltip: 'File is 480p',
},
{
number: 2,
tooltip: 'File is 576p',
},
{
number: 3,
tooltip: 'File is 720p',
},
{
number: 4,
tooltip: 'File is 1080p',
},
{
number: 5,
tooltip: 'File is 1440p',
},
{
number: 6,
tooltip: 'File is 4KUHD',
},
{
number: 7,
tooltip: 'File is DCI4K',
},
{
number: 8,
tooltip: 'File is 8KUHD',
},
{
number: 9,
tooltip: 'File is Other',
},
],
}); };
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);
return {
outputFileObj: args.inputFileObj,
outputNumber: 1,
variables: args.variables,
};
};
exports.plugin = plugin;

View file

@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
name: 'Transcode Video File',
description: 'Transcode a video file using ffmpeg. GPU transcoding will be used if possible.',
style: {
borderColor: '#6efefc',
opacity: 0.5,
},
tags: '',
isStartPlugin: false,
sidebarPosition: -1,
icon: '',
inputs: [
{
name: 'target_codec',
type: 'string',
defaultValue: 'hevc',
inputUI: {
type: 'dropdown',
options: [
'hevc',
// 'vp9',
'h264',
// 'vp8',
],
},
tooltip: 'Specify the codec to use',
},
],
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);
var fs = require('fs');
var oldFile = args.inputFileObj._id;
var newFile = "".concat(args.inputFileObj._id, ".tmp");
if (fs.existsSync(newFile)) {
fs.unlinkSync(newFile);
}
fs.copyFileSync(oldFile, newFile);
return {
outputFileObj: { _id: newFile },
outputNumber: 1,
variables: args.variables,
};
};
exports.plugin = plugin;

View file

@ -0,0 +1 @@
"use strict";