Skip to main content

Pre-Execute

FFmpeg Builder: Pre-Execute

This element lets you run custom code just prior to the FFmpeg Builder: Executor executes FFmpeg.

This allows you to alter the arguments passed into FFmpeg.

Code

Javascript code similar to Function you can execute.

Except this does not require a return code.


Examples

for(let arg of FFmpeg.Args)
{
Logger.ILog('FFmpeg arg: ' + arg);
}

Insert Argument

This will insert an argument before the -i input arguments

let index = FFmpeg.Args.indexOf('-i');

if(index < 0)
{
Logger.ELog('Failed to locate -i')
return -1;
}

Logger.DLog('Index of -i: ' + index);

FFmpeg.Args.Insert(index, 'my-new-parameter');