{"record":{"id":"2b189f0b88d99234","repo":"subhra74/xdm","slug":"ffmpeg-executable-not-found","errorCode":null,"errorMessage":"FFmpeg executable not found","messagePattern":"FFmpeg executable not found","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"app/XDM/XDM.Core/Downloader/MediaProcessor/FFmpegMediaProcessor.cs","lineNumber":228,"sourceCode":"                    return path;\r\n                }\r\n                var ffmpegPathEnvVar = Environment.GetEnvironmentVariable(\"FFMPEG_HOME\");\r\n                //Log.Debug(\"FFMPEG_HOME: \" + ffmpegPathEnvVar);\r\n                if (ffmpegPathEnvVar != null)\r\n                {\r\n                    path = Path.Combine(ffmpegPathEnvVar, executableName);\r\n                    if (File.Exists(path))\r\n                    {\r\n                        return path;\r\n                    }\r\n                }\r\n                path = PlatformHelper.FindExecutableFromSystemPath(executableName);\r\n                if (path != null)\r\n                {\r\n                    return path;\r\n                }\r\n            }\r\n            throw new FileNotFoundException(\"FFmpeg executable not found\");\r\n        }\r\n\r\n        public static bool IsFFmpegInstalled()\r\n        {\r\n            try\r\n            {\r\n                FindFFmpegBinary();\r\n            }\r\n            catch (FileNotFoundException)\r\n            {\r\n                return false;\r\n            }\r\n            return true;\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":210,"sourceCodeEnd":245,"githubUrl":"https://github.com/subhra74/xdm/blob/1ca5a25aae007826c859c81bea494e7c102e1242/app/XDM/XDM.Core/Downloader/MediaProcessor/FFmpegMediaProcessor.cs#L210-L245","documentation":"FindFFmpegBinary searches the bundled application directories and the system PATH (via PlatformHelper.FindExecutableFromSystemPath) for the ffmpeg executable. When neither location yields a path, it throws FileNotFoundException 'FFmpeg executable not found'. IsFFmpegInstalled uses this method to probe availability.","triggerScenarios":"Calling FindFFmpegBinary (directly or via IsFFmpegInstalled/ProcessMedia's file lookup) when ffmpeg is neither shipped alongside the app nor installed in any PATH directory.","commonSituations":"FFmpeg was never installed; ffmpeg installed but not on PATH; PATH changed or the install was removed; bundled ffmpeg files deleted by antivirus or a partial update.","solutions":["Install FFmpeg (winget install ffmpeg / apt install ffmpeg / brew install ffmpeg) so it is discoverable on PATH","If you have ffmpeg elsewhere, add its directory to the system PATH environment variable and restart the app","Verify the bundled ffmpeg files exist in the application folder; reinstall XDM if they were removed","Confirm with 'ffmpeg -version' in a new terminal that the binary resolves before retrying"],"exampleFix":"// before\nvar ffmpeg = FFmpegMediaProcessor.FindFFmpegBinary(); // throws if missing\n// after\nif (!FFmpegMediaProcessor.IsFFmpegInstalled())\n{\n    Log.Warn(\"FFmpeg not found; prompting user to install FFmpeg or disabling muxing\");\n    DisableMuxingFeature();\n    return;\n}\nvar ffmpeg = FFmpegMediaProcessor.FindFFmpegBinary();","handlingStrategy":"fallback","validationCode":"// Probe availability without triggering the exception\nbool hasFFmpeg = FFmpegMediaProcessor.IsFFmpegInstalled();\nif (!hasFFmpeg)\n    Log.Warn(\"FFmpeg is not installed and not on PATH\");","typeGuard":null,"tryCatchPattern":"try\n{\n    ffmpegPath = FFmpegMediaProcessor.FindFFmpegBinary();\n}\ncatch (FileNotFoundException)\n{\n    ffmpegPath = PromptUserForFFmpegPath(); // or disable muxing feature\n}","preventionTips":["Install FFmpeg via a package manager so it lands on PATH","Check 'ffmpeg -version' resolves in a fresh terminal after install","Keep the app's bundled ffmpeg directory intact (watch AV quarantine)","Re-check IsFFmpegInstalled after PATH changes and app restart"],"tags":["ffmpeg","missing-binary","path","dependency"],"backgroundTag":"file-not-found","analyzedSha":"1ca5a25aae007826c859c81bea494e7c102e1242","analyzedAt":"2026-09-13T20:37:40.968Z","contentChangedAt":"2026-09-13T20:37:40.968Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}