Description
Changelog
Reviews (2)

MP4/MOV video playback (H.264/HEVC) for Godot 4.6+ on macOS, Windows, and Linux. Drop a recognized clip (.mp4, .mov, .m4v) onto a stock VideoStreamPlayer to play it. No custom nodes or engine changes required.

This GDExtension uses AVFoundation on macOS, Media Foundation on Windows, and GStreamer on Linux. macOS and Windows/D3D12 can present decoded frames without CPU copies. Linux uses CPU uploads, with hardware or software decoding depending on your installed plugins and drivers.

HIGHLIGHTS

  • Native media backends: uses your system's media libraries rather than bundling a decoder. Linux requires GStreamer libraries and codec plugins to be installed separately.
  • Zero-copy presentation on macOS and Windows/D3D12: decoded frames reach Godot without per-frame CPU copies. Windows/Vulkan and Linux use CPU-copy paths.
  • Extension-owned playback timing: audio-master sync, with a monotonic clock for silent clips. Late frames are dropped and early frames held, so decode hiccups don't turn into permanent drift.
  • Adaptive scrubbing: keyframe-only while dragging fast, exact frame on settle.
  • Shared decode-worker pool: core decode jobs share workers rather than creating a dedicated worker for every video. Media frameworks may also use their own threads.
  • HDR conversion: tone-map PQ/HLG clips to SDR, or request scene-linear HDR output.

REQUIREMENTS

  • Godot 4.6+.
  • macOS and Windows: Forward+ or Mobile renderer.
  • Linux: Forward+ renderer with Vulkan, plus system GStreamer libraries and codec plugins.
  • Compatibility/OpenGL isn't supported on any platform. All presentation paths require RenderingDevice and compute shaders.

Prebuilt binaries are available for macOS (Apple Silicon and Intel), Windows (x86, x86_64, and ARM64), and Linux (x86_64).

PLATFORM SUPPORT

macOS

Uses AVFoundation with zero-copy presentation through Metal. HEVC decoding is built into the OS.

Windows

Uses Media Foundation. The presentation path is selected automatically:

  • D3D12: zero-copy import (recommended). If shared-resource initialization fails, playback falls back to the CPU-copy path.
  • Vulkan: hardware decoding with a CPU-copy fallback that adds one GPU-to-CPU readback per frame before upload to Godot.

HEVC requires an installed decoder, typically the "HEVC Video Extensions" package from the Microsoft Store. It isn't present on every Windows installation.

Linux

Uses GStreamer with CPU-readable NV12/P010 frames uploaded into Godot textures. Hardware decoding is optional and depends on your installed plugins and drivers; software decoding is also supported.

This isn't a zero-copy path. Hardware decoding may still require a GPU readback before upload, and CPU memory bandwidth can become a bottleneck with multiple high-resolution streams.

GStreamer libraries and codec plugins aren't bundled with the addon. You'll need packages for MP4 demuxing, H.264/HEVC decoding, AAC audio, and format conversion. See the Linux runtime requirements for Ubuntu/Debian installation commands.

Linux release binaries target x86_64 and are built on Ubuntu 22.04. Linux ARM64 binaries aren't shipped or tested.

SUPPORTED MEDIA

  • Codecs: H.264 and HEVC (Main and Main10), subject to decoder availability.
  • Containers: MP4 and MOV; registers .mp4, .mov, and .m4v.
  • Pixel formats: NV12 (8-bit), plus x420 on macOS or P010 on Windows/Linux for 10-bit sources.
  • Colorimetry: BT.709, BT.601, and BT.2020 matrices; BT.709, BT.601, BT.2020, and DCI-P3 primaries; BT.709, PQ (HDR10), and HLG transfer functions. Video and full range are supported.
  • HDR: PQ/HLG clips tone-map to SDR by default. Scene-linear HDR output (RGBA16F) is available through the stream's output_mode setting.
  • Audio: AAC decoded to interleaved float32 PCM, with mono/stereo/5.1 channel mixing.
  • Multiple audio tracks: enumerate with NativeVideoStream.get_audio_tracks() and select through VideoStreamPlayer.audio_track, before or during playback.

KNOWN LIMITATIONS

  • Headless mode (--headless): decode, audio mixing, playback timing, and end-of-stream handling continue, but no texture output is available.
  • Compatibility/OpenGL: unsupported, including on platforms that use CPU uploads.
  • Windows/Vulkan: no zero-copy presentation. The extension doesn't include a Vulkan shared-handle import path.
  • Linux HDR: Main10/PQ/HLG decoding requires suitable GStreamer plugins. The extension preserves 10-bit data through upload and color conversion, but this doesn't guarantee OS/compositor HDR signaling or HDR display output.
  • Mixed-sample-rate audio tracks: the first track's sample rate wins. Switching to a track with a different sample rate is refused.
  • Godot 4.6 startup messages: the current bindings probe three Godot 4.7-only interface functions, producing "Attempt to get non-existent interface function" errors on 4.6. Playback is unaffected.
  • Single-precision prebuilt binaries only: double-precision Godot builds require building the extension from source with -Dprecision=double.

Full documentation, architecture notes, and build instructions: https://github.com/claytercek/godot-native-video

Changelog for version v0.4.1

2026-11-10 15:03:42

No changelog provided for this version.

Reviews

Recommended by moss dogg - 13 November 2026

perfect :)

Recommended by MrFonax - 09 November 2026

Everything works great. good job!

Login to write a review.

Consider supporting the creators!

If you enjoyed this asset consider supporting its creator. Follow the link below.