Skip to content

Enable native AV1 VideoToolbox decoding on macOS - #83

Merged
cgutman merged 1 commit into
moonlight-stream:mainfrom
elibosley:agent/enable-macos-av1-videotoolbox
Aug 5, 2026
Merged

Enable native AV1 VideoToolbox decoding on macOS#83
cgutman merged 1 commit into
moonlight-stream:mainfrom
elibosley:agent/enable-macos-av1-videotoolbox

Conversation

@elibosley

Copy link
Copy Markdown
Contributor

What changed

Enable FFmpeg's native AV1 decoder in the macOS dependency build.

The build already enabled av1_videotoolbox, but only built the libdav1d
decoder. FFmpeg exposes the VideoToolbox hardware configuration through its
native av1 decoder, so Moonlight could not discover AV1 hardware decoding and
fell back to HEVC when hardware decoding was required.

libdav1d remains enabled as the software fallback.

Fixes the dependency-side regression still reported in
moonlight-stream/moonlight-qt#1125.

Validation

  • Built the pinned FFmpeg 8.1 commit on Apple Silicon.
  • Verified configure reports:
    • decoders: av1, libdav1d
    • hwaccel: av1_videotoolbox
  • Verified avcodec_get_hw_config() exposes videotoolbox_vld for the native
    AV1 decoder while libdav1d remains available.
  • Built current Moonlight Qt master against the resulting dependency.
  • Streamed AV1 Main10 HDR at 3024×1964, 60 FPS on an M4 Pro with hardware
    decoding forced. Moonlight negotiated AV1 Main10 (format 0x2000) and FFmpeg
    selected videotoolbox_vld successfully.

@elibosley
elibosley marked this pull request as ready for review July 30, 2026 20:07
@cgutman

cgutman commented Aug 5, 2026

Copy link
Copy Markdown
Member

I don't think this is actually necessary, since FFmpeg's build system automatically enables the av1 decoder since we're building the av1_videotoolbox hwaccel.

You can see it's being properly enabled in the FFmpeg configure log even without this patch:

Enabled decoders:
av1                     hevc
h264                    libdav1d

It doesn't hurt to be explicit though, so I'll merge this anyway.

@cgutman
cgutman merged commit bea453b into moonlight-stream:main Aug 5, 2026
5 checks passed
@elibosley
elibosley deleted the agent/enable-macos-av1-videotoolbox branch August 5, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants