Add ffmpegCommand.init to ensure "Begin" command has been used

This commit is contained in:
HaveAGitGat 2024-06-25 06:57:04 +03:00
parent a8b0fd3c60
commit 0ba6ceb182
4 changed files with 19 additions and 0 deletions

View 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.',
);
}
};

View file

@ -87,6 +87,7 @@ export interface IffmpegCommandStream extends Istreams {
}
export interface IffmpegCommand {
init: boolean,
inputFiles: string[],
streams: IffmpegCommandStream[]
container: string,