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.
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.