mediaforge - v0.1.0
    Preparing search index...

    Function autoKillOnExit

    • Register cleanup handler to kill an ffmpeg process when the Node.js process exits. Returns an unregister function — call it once the ffmpeg process finishes normally.

      Listens to process exit, SIGINT, and SIGTERM only. Does NOT listen to uncaughtException to avoid suppressing error reporting.

      Parameters

      • child: ChildProcess
      • signal: Signals = 'SIGTERM'

      Returns () => void

      const proc = ffmpeg('input.mp4').output('out.mp4').spawn();
      const unregister = autoKillOnExit(proc.child);
      proc.emitter.on('end', () => unregister());