trenskow/stream-transcoder.js

ffmpeg process is still running after execute ffmpeg commond

Opened this issue · 1 comments

image

The processes are not released, and they take a lot of memory. It is a big problem!

I'm using this in electron and noticed if you close a window before the process is done it will stays running. My workaround was to use the _exec method which returns the child process instead of writeToFile. Then I'm able to kill it when I need to. Here is an example:

const transcoder = new Transcoder(filePath).format('mp4')
let a = transcoder._compileArguments()
a = a.concat('-y', outputFilePath)
const childProcess = transcoder._exec(a)