0

Basically, I am running one exe file using execFile method from the child process...

That exe file used ffmpeg for some conversion... If ffmpeg throws some error (Basically it won't affect the actual process) my child process is terminated automatically because the error has been captured...

 this.recorder = execFile(`"${BIN}"`, command, { shell: true, maxBuffer: (1024 * 1024 * 2) }, (error) => {
                if (error) {
                    log('error', 'Recorder error', error);
                }
            });

Is there any way to prevent this?

Akbar Basha
  • 1,168
  • 1
  • 16
  • 38
  • But, `ffmpeg` terminates when it gets an error. What do you expect it to do or be useful for if it got an error? I guess I'm not understanding what/why you're asking to keep ffmpeg running when it encountered an error? – jfriend00 Aug 10 '22 at 17:54
  • @jfriend00 basically ffmpeg not terminating it keeps on running... – Akbar Basha Aug 10 '22 at 17:57
  • @jfriend00 Basicaly that exe is generating the video and ffmpeg tries to convert that video in another format that exe produce multiple chunks of video... during that in some cases ffmpeg throws the warning kind of error but it won't affect any actual process... but that error has been captured in child process because of that the child process has been terminated – Akbar Basha Aug 10 '22 at 17:59
  • There is insufficient code shown here for us to understand the problem or offer a solution. – jfriend00 Aug 10 '22 at 18:00
  • 2
    You got the cause-n-effect backwards. It should read: "the error has been captured because my child process terminated abnormally". Your main program must spawn a new ffmpeg child process every time it needs it. – kesh Aug 10 '22 at 18:40

0 Answers0