Skip to content

Building Windows

Taner Sener edited this page Aug 22, 2026 · 4 revisions

FFmpegKitNext for Windows is built natively with the MSYS2 / MinGW-w64 toolchain by calling the windows.sh script in the project root.

Before building, review Windows Prerequisites. For step-by-step MSYS2 setup, see MinGW Toolchain.

Nix is the recommended build environment on the other platforms, but it does not provide a native Windows build toolchain, so it is not used here. Windows is built directly under MSYS2.

Only arm64 (aarch64) is supported for now. x86-64 is implemented but not yet tested and will be fully enabled in a future release.

Build

Run the wrapper from an MSYS2 shell in the project root:

./windows.sh

This compiles the native FFmpeg and FFmpegKitNext shared libraries together with the C++ API for the architecture of the host machine. Building arm64 libraries requires an arm64 Windows host.

FFmpegKitNext does not publish binaries; building it yourself is the only way to use it.

Build Options

Use --enable-lib-<library name> to build with an external library and --enable-lib-all to enable all of them.

./windows.sh --enable-lib-openssl --enable-lib-dav1d

External libraries are downloaded and built from source, then linked statically into the generated DLLs. Dependencies are enabled automatically: --enable-lib-libass, for example, also builds freetype, fribidi, fontconfig, harfbuzz, libpng, expat and libiconv.

Use --enable-gpl when enabling GPL-licensed libraries such as x264, x265, xvidcore, libvidstab or rubberband. This relicenses the produced binaries under GPLv3.

By default the MinGW-w64 toolchain runtime is linked statically into the generated DLLs, so the bundle depends only on system DLLs. Use --no-static-mingw-runtime to ship the required MinGW runtime DLLs in the bundle instead. The exact DLL list is resolved from the built artifacts and can vary by MSYS2 environment.

The complete option list is printed by:

./windows.sh --help

Build Flow

The Windows build has three phases:

  1. Download FFmpeg, RapidJSON and enabled external-library sources when they are not already available locally.
  2. Build FFmpeg, FFmpegKitNext and enabled source-built external libraries natively for the host architecture.
  3. Create a Windows bundle containing headers, DLLs, import libraries, pkg-config files and a CMake package config.

The build scripts only print progress to the console. The actual build output is redirected to the build.log file. If you hit an error, that is the first file to check.

Build Output

Build outputs are written under prebuilt.

The Windows bundle is created under:

prebuilt/bundle-windows/ffmpeg-kit-next/
  include/
  bin/
  lib/
  licenses/
  • include/ — the public headers.
  • bin/ — the runtime DLLs (FFmpegKitNext and FFmpeg).
  • lib/ — the import libraries and their discovery metadata. Both a MinGW import library (libffmpegkit.dll.a, with pkgconfig/) and an MSVC import library (ffmpegkit.lib with libffmpegkit.def, with a CMake package config under cmake/ffmpeg-kit-next) are produced against the same DLLs.

Use the generated headers, DLLs and import libraries from this folder in your Windows application. See Using FFmpegKitNext on Windows for how to link them from each toolchain.

Clone this wiki locally