Run a binary and return its stdout, bounded by a timeout.
Blocking. Prefer execAsync on a server, where a synchronous call
stalls the event loop for every other request for the duration.
Known limitation: execFileSync signals only the direct child. A binary that
forks a long-lived grandchild which inherits the stdout pipe will keep that
pipe open past the timeout, so the call returns late even though the timeout
fired. Neither ffmpeg -version nor ffprobe does this, and the async path
below is immune because it kills the whole process group.
Run a binary and return its stdout, bounded by a timeout.
Blocking. Prefer execAsync on a server, where a synchronous call stalls the event loop for every other request for the duration.
Known limitation:
execFileSyncsignals only the direct child. A binary that forks a long-lived grandchild which inherits the stdout pipe will keep that pipe open past the timeout, so the call returns late even though the timeout fired. Neitherffmpeg -versionnorffprobedoes this, and the async path below is immune because it kills the whole process group.