stride3d/stride · error · InvalidOperationException
Video files needs to be stored on the virtual file system…
Error message
Video files needs to be stored on the virtual file system in a non-compressed form.
What it means
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.
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
Example fix
// before
videoComponent.Source = Content.Load<Video>("video.mp4.compressed");
// after
// import as a Stride Video asset (uncompressed in the object database)
videoComponent.Source = Content.Load<Video>("MyVideo"); Defensive patterns
Strategy: validation
Validate before calling
// confirm the asset resolves in the content index before play
if (!source.FileProvider.ContentIndexMap.TryGetValue(source.CompressedDataUrl, out _))
Log.Error($"Video asset '{source.CompressedDataUrl}' missing from content index"); Try / catch
try { videoInstance.Play(); }
catch (InvalidOperationException ex) when (ex.Message.Contains("virtual file system"))
{
Log.Error("Video asset not imported/uncompressed — reimport via Stride video asset pipeline.");
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- A negative number of mip maps is not allowed.
- AVAssetReader create failed
- AVAssetReader.StartReading failed
- AVFoundationVideoBackend already initialized.
- Could not fill codec parameters. Error code=
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/94b590255bfd9c71.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Video/VideoInstance.cs:393
public void InitializeFromDataSource()
{
ReleaseMedia();
string url = null;
long startPosition = 0;
long end = 0;
var source = videoComponent.Source;
if (source != null)
{
var dataUrl = source.CompressedDataUrl;
var fileProvider = source.FileProvider;
if (!fileProvider.ContentIndexMap.TryGetValue(dataUrl, out ObjectId objectId) ||
!fileProvider.ObjectDatabase.TryGetObjectLocation(objectId, out url, out startPosition, out end))
{
throw new InvalidOperationException("Video files needs to be stored on the virtual file system in a non-compressed form.");
}
InitializeMedia(url, startPosition, end - startPosition);
UpdateAudioVolume();
UpdateLoopingSettings();
UpdatePlayRangeSettings();
UpdateSpeedSettings();
}
// New video always starts in Stopped state.
}
private bool IsMediaValid() => mediaInitialized && backend != null;
private void InitializeMedia(string url, long startPosition, long length)
{
if (url == null || startPosition < 0 || length < 0)View on GitHub (pinned to 96fad776d2)