stride3d/stride · error · InvalidOperationException

No video backend is registered or supported on this…

Error message

No video backend is registered or supported on this platform.

What it means

InitializeMedia obtains the active video backend factory from VideoSystem to create a playback backend. This InvalidOperationException is thrown when VideoSystem.ActiveBackendFactory is null — no video backend was registered or the current platform has no supported backend (e.g. FFmpeg natives unavailable).

Solutions

  1. Deploy/register a video backend (e.g. FFmpeg backend) and ensure its native libraries load on the target platform
  2. Call FFmpegUtils.EnsurePlatformSupport() early to fail fast with a clearer message
  3. Verify platform support before enabling video playback in the app (check VideoSystem.ActiveBackendFactory != null)
  4. Check that the FFmpeg backend assembly and natives are included in the deployment for the target RID

Example fix

// before
videoComponent.Source = myVideo; // throws on unsupported platform
// after
if (videoSystem.ActiveBackendFactory == null)
{
    Log.Warning("Video playback unavailable on this platform (no backend)." );
    return;
}
videoComponent.Source = myVideo;
Defensive patterns

Strategy: type-guard

Validate before calling

if (videoSystem.ActiveBackendFactory == null)
{
    Log.Warning("No video backend on this platform; disabling video playback");
    return;
}

Type guard

bool BackendAvailable(VideoSystem vs) => vs.ActiveBackendFactory != null;

Try / catch

try { videoInstance.Play(); }
catch (InvalidOperationException ex) when (ex.Message.Contains("backend"))
{
    // hide video UI / use placeholder on unsupported platforms
}

Prevention

When it happens

Trigger: Playing a video on a platform where no backend factory registered with VideoSystem; FFmpeg backend failed platform support checks (EnsurePlatformSupport), leaving ActiveBackendFactory null.

Common situations: Unsupported platforms (no FFmpeg natives deployed); video playback attempted before VideoSystem initialization selected a backend; trimmed builds excluding the backend natives.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/789c7be2cf355711. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Video/VideoInstance.cs:415

                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)
                return;

            var factory = videoSystem.ActiveBackendFactory
                ?? throw new InvalidOperationException("No video backend is registered or supported on this platform.");
            backend = factory.CreateBackend(this);
            mediaInitialized = backend.Initialize(url, startPosition, length);
            if (!mediaInitialized)
            {
                backend.Dispose();
                backend = null;
            }
        }

        internal void AllocateVideoTexture(int width, int height)
        {
            if (videoTexture != null)
                throw new InvalidOperationException("\"videoTexture\" was not deallocated properly before trying to create a new one!");

            videoTexture = new VideoTexture(GraphicsDevice, services, width, height, videoComponent.MaxMipMapCount);
        }

        private void DeallocateVideoTexture()

View on GitHub (pinned to 96fad776d2)