| 28 | const DEFAULT_STDERR_TAIL_LINES = 15; |
| 29 | |
| 30 | function formatWindowsFfmpegExit(exitCode: number | null): string | undefined { |
| 31 | if (process.platform !== "win32" || exitCode === null) return undefined; |
| 32 | if (exitCode === 3221225595 || exitCode === -1073741701) { |
| 33 | return ( |
| 34 | "[FFmpeg] Windows could not start ffmpeg.exe (STATUS_INVALID_IMAGE_FORMAT). " + |
| 35 | "The binary may be corrupted or the wrong architecture. Reinstall a 64-bit Windows FFmpeg build." |
| 36 | ); |
| 37 | } |
| 38 | if (exitCode === 3221225794 || exitCode === -1073741502) { |
| 39 | return ( |
| 40 | "[FFmpeg] Windows failed while initializing ffmpeg.exe. " + |
| 41 | "The binary may be corrupted, blocked, or missing runtime DLLs. Reinstall a 64-bit Windows FFmpeg build." |
| 42 | ); |
| 43 | } |
| 44 | return undefined; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Build a user-facing error message for a failed ffmpeg invocation. |