You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varffmpeg=require("fluent-ffmpeg");constINPUT_PATH="./input/SampleVideo_1280x720_1mb.mkv";constOUTPUT_PATH="./output/test.mp4";// start by converting with a valid FFMPEG pathffmpeg(INPUT_PATH).output(OUTPUT_PATH).on("start",function(cmdline){console.log("Command line: "+cmdline);}).on("error",function(err,stdout,stderr){console.log("An error happened: "+err.message);console.log("ffmpeg standard output:\n"+stdout);console.log("ffmpeg standard error:\n"+stderr);}).on("end",function(){console.log("Finished processing");// once the conversion has finished with the valid path// start converting with an invalid pathffmpeg(INPUT_PATH).setFfmpegPath("bad-path").output(OUTPUT_PATH).on("start",function(cmdline){console.log("Command line: "+cmdline);}).on("error",function(err,stdout,stderr){console.log("An error happened: "+err.message);console.log("ffmpeg standard output:\n"+stdout);console.log("ffmpeg standard error:\n"+stderr);}).on("end",function(){console.log("Finished processing");}).run();}).run();
Expected results
I expect the conversion to fail, but to fail gracefully by calling the error callback and for the above code to then log the error.
Observed results
Instead the entire program crashes when the error occurs. I don't see the logged out error as expected. I instead see the following:
Exception has occurred: TypeError: Cannot read properties of undefined (reading 'get')
at endCB (A:\Germingi\Documents\programming\test\fluent-ffmpeg-bug\node_modules\fluent-ffmpeg\lib\processor.js:543:37)
at ChildProcess.<anonymous> (A:\Germingi\Documents\programming\test\fluent-ffmpeg-bug\node_modules\fluent-ffmpeg\lib\processor.js:157:9)
at ChildProcess.emit (node:events:520:28)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
and the error message in the endCB function is "spawn bad-path ENOENT", which is expected.
From looking at the code, it might be necessary to clear the cache in capabilities.js when the ffmpeg path is changed.
I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
I have included full stderr/stdout output from ffmpeg
The text was updated successfully, but these errors were encountered:
I'm seeing a program crash when converting with an invalid ffmpeg path after successfully converting a video with a valid path.
Version information
Code to reproduce
Expected results
I expect the conversion to fail, but to fail gracefully by calling the error callback and for the above code to then log the error.
Observed results
Instead the entire program crashes when the error occurs. I don't see the logged out error as expected. I instead see the following:
and the error message in the
endCB
function is "spawn bad-path ENOENT", which is expected.From looking at the code, it might be necessary to clear the
cache
in capabilities.js when the ffmpeg path is changed.Checklist
The text was updated successfully, but these errors were encountered: