{"record":{"id":"c0e63bc554503565","repo":"stride3d/stride","slug":"failed-to-compile-a-video-asset-ffmpeg-was-not-found","errorCode":null,"errorMessage":"Failed to compile a video asset, ffmpeg was not found.","messagePattern":"Failed to compile a video asset, ffmpeg was not found\\.","errorType":"exception","errorClass":"AssetException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Media/VideoAssetCompiler.cs","lineNumber":86,"sourceCode":"            {\n                Version = 5;\n                ListSupportedCodecNames = listSupportedCodecNames;\n            }\n\n            public override IEnumerable<ObjectUrl> GetInputFiles()\n            {\n                yield return new ObjectUrl(UrlType.File, Parameters.SourcePathFromDisk);\n            }\n\n            /// <inheritdoc />\n            protected override async Task<ResultStatus> DoCommandOverride(ICommandContext commandContext)\n            {\n                VideoAsset videoAsset = Parameters.Video;\n\n                try\n                {\n                    // Get path to ffmpeg\n                    var ffmpeg = ToolLocator.LocateTool(\"ffmpeg\", ensureExecutable: true)?.ToOSPath() ?? throw new AssetException(\"Failed to compile a video asset, ffmpeg was not found.\");\n\n                    // Get absolute path of asset source on disk\n                    var assetDirectory = videoAsset.Source.GetParent();\n                    var assetSource = UPath.Combine(assetDirectory, videoAsset.Source);\n\n                    //=====================================================================================\n                    //Get the info from the video codec\n                    \n                    //Check if we need to reencode the video\n                    var mustReEncodeVideo = false;\n                    var sidedataStripCommand = \"\";\n\n                    // check that the video file format is supported\n                    if (Parameters.Platform == PlatformType.Windows && videoAsset.Source.GetFileExtension() != \".mp4\")\n                        mustReEncodeVideo = true;\n\n                    //Use FFmpegMedia object (need to check more details first before I can use it)\n                    VideoStream videoStream = null;","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Media/VideoAssetCompiler.cs#L68-L104","documentation":"VideoAssetCompiler needs ffmpeg to process video sources. When ToolLocator.LocateTool(\"ffmpeg\") cannot find an executable it returns null and the compiler throws this AssetException before opening the media.","triggerScenarios":"DoCommandOverride compiles a video asset and ffmpeg is not locatable on the machine (not on PATH, missing, or not executable).","commonSituations":"Missing ffmpeg on dev machine or CI agent, PATH not visible to the build process, non-executable downloaded binary, container images without ffmpeg installed.","solutions":["Install ffmpeg and add it to PATH for the build environment","Make the binary executable (chmod +x) on Linux/macOS","Confirm with 'ffmpeg -version' in the same shell/user context the build uses","Add ffmpeg to the CI/docker image before running the asset build"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (ToolLocator.LocateTool(\"ffmpeg\", ensureExecutable: true) is null)\n    throw new InvalidOperationException(\"Install ffmpeg and add it to PATH before building video assets.\");","typeGuard":"static bool FfmpegAvailable() => ToolLocator.LocateTool(\"ffmpeg\", ensureExecutable: true) != null;","tryCatchPattern":"try\n{\n    await CompileVideoAsync(asset);\n}\ncatch (AssetException ex) when (ex.Message.Contains(\"ffmpeg was not found\"))\n{\n    logger.Error(\"Install ffmpeg and ensure it is on PATH, then rebuild.\");\n}","preventionTips":["Install ffmpeg in all build environments including CI/docker","Check PATH visibility for the user running the build","Verify 'ffmpeg -version' works before asset builds","Mark downloaded binaries executable on Linux/macOS"],"tags":["video","ffmpeg","build-pipeline","external-tool"],"backgroundTag":"command-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}