How fallback to local ffmpeg works
mainWhen fallbackToLocal is enabled, the client attempts to run the host's local ffmpeg (or ffprobe) if the initial TCP connection to the server fails. This ensures transcoding continues even if the remote GPU machine is offline.
Key Behaviors
- Trigger: Only triggered on initial TCP connection failure. Mid-stream errors are fatal and do not trigger a local restart.
- Binary Selection: The client selects
ffmpegorffprobebased on its ownargv[0]basename. A binary namedffprobe(or containing it) looks forffprobeon$PATH; otherwise, it looks forffmpeg. - Environment Security:
FFMPEG_OVER_IP_*environment variables are stripped from the local process to prevent theauthSecretfrom leaking into/proc/<pid>/environ. - Path Searching: The client searches
$PATHfor the local binary. On Windows, it tries the bare name first, then follows%PATHEXT%order.
Security Considerations
- Path Hijacking: Only enable this on hosts where you trust the
$PATH. A user with write access to a directory earlier in$PATHthan the real binary could hijack transcodes. - Windows
%PATHEXT%: A maliciousffmpeg.comcould be picked up beforeffmpeg.exedepending on the declared order. - Root Users: Audit
$PATHdirectory permissions if running the client as root to prevent non-root users from hijacking transcodes.