ffmpeg.FS('writeFile', "video.mp4", await fetchFile(localVars.VideoURL));
await ffmpeg.run(...parametersArray);
runtime.callFunction("ffmpegComplete", result)
This all works wonderfully, as long as it initializes and runs in the same scripting block. But that means every time I want to run ffmpeg, I need to initialize again!
If I initialize at the start of the layout and then call it later, it says 'ffmpeg is not defined' - seems it doesn't have access to any functions, variables and other stuff that's created on another block.
I've been reading up on it and I imagine the solution involves imports and exports, which I haven't been able to figure out how to use yet (I know very little javascript). Am I in the right path? Is there a simpler way for me to run that first bit of code so that the 'ffmpeg' object (as well as declared functions, variables etc.) is accessible to other blocks of javascript in my event sheet?
Thanks in advance!