{"record":{"id":"26951b1a57b79f81","repo":"stride3d/stride","slug":"failed-to-compile-a-video-asset-unexpected-exception","errorCode":null,"errorMessage":"Failed to compile a video asset. Unexpected exception.","messagePattern":"Failed to compile a video asset\\. Unexpected exception\\.","errorType":"exception","errorClass":"AssetException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Media/VideoAssetCompiler.cs","lineNumber":260,"sourceCode":"                        assetManager.Save(Url, video);\n\n                        return ResultStatus.Successful;\n                    }\n                    finally\n                    {\n                        if (mustReEncodeVideo)\n                        {\n                            if (tempFile != null) File.Delete(tempFile);\n                        }\n                    }\n                }\n                catch (AssetException)\n                {\n                    throw;\n                }\n                catch (Exception ex)\n                {\n                    throw new AssetException(\"Failed to compile a video asset. Unexpected exception.\", ex);\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// SharedParameters used for converting/processing the video in the storage.\n    /// </summary>\n    [DataContract]\n    public class VideoConvertParameters\n    {\n        public VideoConvertParameters()\n        {\n        }\n\n        public VideoConvertParameters(\n            UFile sourcePathFromDisk,\n            VideoAsset video,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Media/VideoAssetCompiler.cs#L242-L278","documentation":"Stride's VideoAssetCompiler wraps any unexpected exception thrown while compiling a video asset into an AssetException with this fixed message. The original exception is preserved as the InnerException, so the real cause must be read from there. It exists so asset compilation failures surface with a consistent, asset-scoped error type.","triggerScenarios":"Any non-AssetException exception during VideoAssetCompiler.DoCommandOverride: corrupt or unreadable video file, missing codecs/decoder, I/O failure reading the source, or a crash inside the video processing pipeline.","commonSituations":"Importing a video with an unsupported codec, a video file moved or deleted after import, or an engine bug/regression in the media pipeline during a build.","solutions":["Inspect the InnerException of the AssetException for the root cause (use -verbose build logging)","Verify the source video file exists, is readable, and plays in a standard player","Re-encode the video to a common codec (H.264/MP4) and re-import","Update or reinstall media codecs / try a different Stride version if the pipeline crashes"],"exampleFix":"// before: opaque failure\ntry { CompileVideo(asset); } catch (AssetException ex) { Log(ex.Message); }\n// after: surface root cause\ntry { CompileVideo(asset); } catch (AssetException ex) { Log(ex.Message + \" -> \" + ex.InnerException); }","handlingStrategy":"try-catch","validationCode":"var src = videoAsset.Source;\nif (src == null || !File.Exists(src)) throw new InvalidOperationException($\"Video source missing: {src}\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await game.Content.LoadAsync<VideoAsset>(url);\n}\ncatch (AssetException ex)\n{\n    logger.LogError(ex.InnerException, \"Video asset {Url} failed to compile\", url);\n}","preventionTips":["Always log AssetException.InnerException, not just the message","Keep source video files inside the project and under source control or LFS","Standardize on H.264/MP4 imports","Re-import assets after moving files rather than fixing references by hand"],"tags":["asset-compilation","video","build"],"backgroundTag":"asset-compilation-failed","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}