{"record":{"id":"94b590255bfd9c71","repo":"stride3d/stride","slug":"video-files-needs-to-be-stored-on-the-virtual-file-system-in","errorCode":null,"errorMessage":"Video files needs to be stored on the virtual file system in a non-compressed form.","messagePattern":"Video files needs to be stored on the virtual file system in a non-compressed form\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Video/VideoInstance.cs","lineNumber":393,"sourceCode":"\n        public void InitializeFromDataSource()\n        {\n            ReleaseMedia();\n\n            string url = null;\n            long startPosition = 0;\n            long end = 0;\n\n            var source = videoComponent.Source;\n            if (source != null)\n            {\n                var dataUrl = source.CompressedDataUrl;\n                var fileProvider = source.FileProvider;\n\n                if (!fileProvider.ContentIndexMap.TryGetValue(dataUrl, out ObjectId objectId) ||\n                    !fileProvider.ObjectDatabase.TryGetObjectLocation(objectId, out url, out startPosition, out end))\n                {\n                    throw new InvalidOperationException(\"Video files needs to be stored on the virtual file system in a non-compressed form.\");\n                }\n\n                InitializeMedia(url, startPosition, end - startPosition);\n\n                UpdateAudioVolume();\n                UpdateLoopingSettings();\n                UpdatePlayRangeSettings();\n                UpdateSpeedSettings();\n            }\n\n            // New video always starts in Stopped state.\n        }\n\n        private bool IsMediaValid() => mediaInitialized && backend != null;\n\n        private void InitializeMedia(string url, long startPosition, long length)\n        {\n            if (url == null || startPosition < 0 || length < 0)","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Video/VideoInstance.cs#L375-L411","documentation":"InitializeFromDataSource resolves the video binary through the virtual file system (ContentIndexMap + ObjectDatabase). This InvalidOperationException is thrown when the video's data URL cannot be found in the content index or its object location cannot be resolved — the video file was not stored as an uncompressed asset in the virtual file system.","triggerScenarios":"VideoComponent.Source points to a video that was imported compressed (e.g. via a DataUrl/compressed bundle), the asset was not processed by the video importer, or the FileProvider/database lacks the entry at runtime.","commonSituations":"Loading videos from compressed content bundles or archives; forgetting to include the video asset in the build; runtime FileProvider differing from the editor's; using raw file paths instead of asset URLs.","solutions":["Import the video through the Stride video asset pipeline so it's stored uncompressed in the ObjectDatabase","Ensure the video asset URL exists in the runtime ContentIndexMap (include the asset in the build/package)","Verify the correct FileProvider is mounted for the content the video belongs to","Check source.CompressedDataUrl vs the uncompressed asset URL used by the video system"],"exampleFix":"// before\nvideoComponent.Source = Content.Load<Video>(\"video.mp4.compressed\");\n// after\n// import as a Stride Video asset (uncompressed in the object database)\nvideoComponent.Source = Content.Load<Video>(\"MyVideo\");","handlingStrategy":"validation","validationCode":"// confirm the asset resolves in the content index before play\nif (!source.FileProvider.ContentIndexMap.TryGetValue(source.CompressedDataUrl, out _))\n    Log.Error($\"Video asset '{source.CompressedDataUrl}' missing from content index\");","typeGuard":null,"tryCatchPattern":"try { videoInstance.Play(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"virtual file system\"))\n{\n    Log.Error(\"Video asset not imported/uncompressed — reimport via Stride video asset pipeline.\");\n}","preventionTips":["Import videos via the Stride video asset pipeline, not raw compressed data","Include video assets in build/package output","Verify runtime FileProvider mounts the same content as the editor"],"tags":["asset-pipeline","virtual-file-system","video","content"],"backgroundTag":"file-not-found","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"}