{"record":{"id":"d8852405b15b7a60","repo":"stride3d/stride","slug":"failed-to-compile-a-video-asset-did-not-find-the-videostream","errorCode":null,"errorMessage":"Failed to compile a video asset. Did not find the VideoStream from the media.","messagePattern":"Failed to compile a video asset\\. Did not find the VideoStream from the media\\.","errorType":"exception","errorClass":"AssetException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Media/VideoAssetCompiler.cs","lineNumber":115,"sourceCode":"                    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;\n                    AudioStream audioStream = null;\n                    FFmpegUtils.PreloadLibraries();\n                    FFmpegUtils.Initialize();\n                    using (var media = new FFmpegMedia())\n                    {\n                        media.Open(assetSource.ToOSPath());\n\n                        // Get the first video stream\n                        videoStream = media.Streams.OfType<VideoStream>().FirstOrDefault();\n                        if (videoStream == null)\n                            throw new AssetException(\"Failed to compile a video asset. Did not find the VideoStream from the media.\");\n\n                        // On windows MediaEngineEx player only decode the first video if the video is detected as a stereoscopic video, \n                        // so we remove the tags inside the video in order to ensure the same behavior as on other platforms (side by side decoded texture)\n                        // Unfortunately it does seem possible to disable this behavior from the MediaEngineEx API.\n                        if (Parameters.Platform == PlatformType.Windows && media.IsStereoscopicVideo(videoStream))\n                        {\n                            mustReEncodeVideo = true;\n                            sidedataStripCommand = \"-vf sidedata=delete\";\n                        }\n\n                        // Get the first audio stream\n                        audioStream = media.Streams.OfType<AudioStream>().FirstOrDefault();\n                    }\n                    Size2 videoSize = new Size2(videoStream.Width, videoStream.Height);\n\n                    //check the format\n                    if (ListSupportedCodecNames != null)\n                    {","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Media/VideoAssetCompiler.cs#L97-L133","documentation":"After opening the source media with the native media library, the compiler looks for the first VideoStream. If the opened media contains no video stream (audio-only file, unsupported container that decodes no streams), it throws this AssetException.","triggerScenarios":"DoCommandOverride calls media.Open(assetSource) and media.Streams.OfType<VideoStream>().FirstOrDefault() returns null.","commonSituations":"Assigning an audio file (mp3/wav) to a video asset, a container ffmpeg-less decoders can't open so zero streams are reported, corrupt/truncated video file, codec not recognized by the bundled media decoders.","solutions":["Verify the asset source is a real video file with a decodable video track (ffprobe the file)","Re-export/convert the video to a standard container/codec (e.g. mp4/h264) and re-import","Check the file is not truncated or corrupt; re-obtain the source","Ensure the video asset's Source path points at the intended file, not an audio track"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify the file has a video stream before assigning it to a video asset\nif (!File.Exists(assetSource) || IsAudioOnly(assetSource))\n    throw new InvalidOperationException($\"{assetSource} has no video stream and cannot be a video asset.\");","typeGuard":"static bool IsAudioOnly(string path) =>\n    !new[] { \".mp4\", \".avi\", \".mov\", \".mkv\", \".wmv\", \".webm\" }.Contains(Path.GetExtension(path)?.ToLowerInvariant());","tryCatchPattern":"try\n{\n    await CompileVideoAsync(asset);\n}\ncatch (AssetException ex) when (ex.Message.Contains(\"Did not find the VideoStream\"))\n{\n    logger.Error($\"'{assetSource}' contains no decodable video track; use a real video file (mp4/h264).\");\n}","preventionTips":["Only assign files with video tracks to video assets","Convert exotic codecs/containers to mp4/h264 before import","Verify files are not truncated or corrupt","Use ffprobe to confirm a video stream exists"],"tags":["video","media","assets"],"backgroundTag":"empty-result-set","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"}