Skip to content

feat(ffmpeg): prebuild FFmpeg for the original Xbox - #851

Merged
ReenigneArcher merged 3 commits into
masterfrom
codex/ffmpeg-nxdk
Nov 25, 2026
Merged

ReenigneArcher merged 3 commits into
masterfrom
codex/ffmpeg-nxdk

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Description

Add NXDK-i386-ffmpeg.tar.gz to the existing FFmpeg matrix on ubuntu-latest. The Xbox and native profiles share the ffmpeg CPM package and CMake build and install steps. Both write the configure log under build/_deps/ffmpeg-*/ffbuild/.

Select the FFmpeg patch set in package-lock.cmake and keep the patched checkouts separate. The Xbox profile builds the nxdk runtime and selects its Pentium III decoders and parsers in ffmpeg.cmake. Build-deps owns the Xbox patch and adapters, tracks the nxdk commit through Renovate, and includes the original license and attribution with the compatibility archive.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

  • Built and installed the Xbox and minimal native profiles under MSYS2 UCRT64. The Xbox profile still enables six decoders and three parsers.
  • Verified the i386 COFF archives and linked the nxdk probe on ubuntu-latest (Ubuntu 26.04). Downloaded the CI archive and relinked Moonlight to produce an XBE. Xbox CI job
  • Passed common lint with the repository's CMake checks. Common lint run
  • Streaming in xemu and on Xbox hardware remains untested.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

Comment thread .github/workflows/ci.yml Outdated
name: ${{ matrix.name }}-${{ matrix.build }}
path: ./${{ matrix.name }}-*.tar.gz

build-ffmpeg-nxdk:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do this in the existing matrix instead of adding another?

Comment thread cmake/ffmpeg/nxdk.cmake Outdated
CPMGetPackage(moonlight_nxdk)

# Use the same FFmpeg tag as the native builds with the Xbox-specific patch set.
CPMAddPackage(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this just be in the package-lock.cmake file instead?

Comment thread cmake/ffmpeg/nxdk.cmake Outdated
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_deps/ffmpeg-nxdk-${FFMPEG_TAG}"
UPDATE_DISCONNECTED TRUE
DOWNLOAD_ONLY YES
PATCHES "${moonlight_nxdk_SOURCE_DIR}/src/_nxdk_compat/ffmpeg/ffmpeg-nxdk.patch"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the patches should be put into this build-deps repo instead of pulling them from the moonlight repo

Comment thread scripts/build-ffmpeg-nxdk.sh Outdated
# Win32 stack realignment prevents inline x86 asm while NASM can emit i386 COFF.
mkdir -p ffmpeg
cd ffmpeg
sh "$ffmpeg/configure" \

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be ideal to use our existing build-deps project structure (through cmake) for this build if possible

Comment thread package-lock.cmake Outdated

# The original Xbox decoder package uses a separately pinned SDK and adapters.
set(NXDK_REVISION fafbe41b48fa00a31b79dd49ad1f86a30adcdd9e)
set(MOONLIGHT_NXDK_REVISION af34ad6db9c638207d00a783d4e84c38f1ea96b7)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need moonlight

Comment thread package-lock.cmake Outdated
)

# The original Xbox decoder package uses a separately pinned SDK and adapters.
set(NXDK_REVISION fafbe41b48fa00a31b79dd49ad1f86a30adcdd9e)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure renovate can update nxdk

@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher marked this pull request as ready for review November 25, 2026 18:42
@ReenigneArcher
ReenigneArcher merged commit 881a3b3 into master Nov 25, 2026
35 of 36 checks passed
@ReenigneArcher
ReenigneArcher deleted the codex/ffmpeg-nxdk branch November 25, 2026 18:44
ReenigneArcher added a commit that referenced this pull request Nov 28, 2026
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.

1 participant