FFmpeg process control
These let a script spawn and manage external FFmpeg processes (e.g. for sidecar transcoding).
| Function | Returns | Description |
|---|---|---|
ProcessFfMpegGetIsProcessRunning(processId) |
bool |
Returns true if an OS process with the given id exists and has not yet exited. Returns false for non-positive ids or if the process has already terminated. |
ProcessFfMpegKillByProcessId(processId) |
void |
Stops the FFmpeg process with the given id on a background Task, preferring graceful shutdown via stdin 'q' (see GracefullyStopFfMpegProcess) and falling back to a hard kill. Removes the process from FfmpegProcessList. |
ProcessFfMpegKillAllStartedProcesses() |
void |
Stops every FFmpeg process that was started through ProcessFfMpegStart (i.e. tracked in FfmpegProcessList), preferring graceful shutdown. FFmpeg processes started outside the script engine are left untouched. |
ProcessFfMpegKillAllProcesses() |
void |
Stops every running ffmpeg process on the system on a background Task. Tracked processes are gracefully stopped; untracked ones are hard-killed along with their child processes. |
ProcessFfMpegStart(arguments) |
int |
Starts an FFmpeg process with the given command-line arguments. On Windows, resolves the FFmpeg 6p2 binary via the COMPOSER_FFMPEG6p2 environment variable, then the registry key HKLM\Software\RealSprint AB\COMPOSER_FFMPEG6p2 (env var wins if both are set). On Linux, uses "ffmpeg" from PATH. Returns the started process id, or -1 on failure (missing arguments, missing binary, immediate exit, or exception). The returned PID is tracked in FfmpegProcessList so that ProcessFfMpegKillByProcessId can perform a graceful shutdown. |