Installing on Windows (MSVC)¶
This page builds with Microsoft's compiler (MSVC). For a MinGW-w64 build under MSYS2, see Building on Windows.
Setup script¶
Run the setup script from the repository root in PowerShell 7 as an administrator (scripts/setup/windows.ps1):
powershell -ExecutionPolicy Bypass -File scripts\setup\windows.ps1 # toolchain and linters
powershell -ExecutionPolicy Bypass -File scripts\setup\windows.ps1 -EnableCuda # + NVIDIA CUDA Toolkit
powershell -ExecutionPolicy Bypass -File scripts\setup\windows.ps1 -EnableSycl # + Intel oneAPI Base Toolkit
The script installs with winget, or with Chocolatey when winget is missing:
| Package | Notes |
|---|---|
| Python 3.12 | the Python linters are installed into it |
| Meson, Ninja, NASM | build tools |
| Git, Doxygen | |
| LLVM | clang-tidy and clang-format |
| Visual Studio 2022 Build Tools | skipped when already present; add the Desktop development with C++ workload in the Visual Studio Installer afterwards |
| CUDA Toolkit | only with -EnableCuda |
| Intel oneAPI Base Toolkit | only with -EnableSycl |
-InstallLinters:$false skips the Python linters.
Build¶
- Open an x64 Native Tools Command Prompt for VS 2022, so that
cl.exeand the Windows SDK are onPATH. -
Enable C11 atomics, which MSVC refuses without this flag:
-
From the repository root, configure and build:
-Dc_std=nonekeeps Meson from adding/std:c17; the build adds/std:clatestitself, and without the optioncl.exeprints warning D9025 ("overriding/std:c17with/std:clatest") for every C file.
The binary is build\tools\vmaf.exe.
CUDA¶
Install the CUDA Toolkit (-EnableCuda, or the installer from the NVIDIA CUDA Toolkit page) and add -Denable_cuda=true to the meson setup line. Meson finds cl.exe for NVCC through vswhere or PATH; Native MSVC and CUDA explains the lookup.
SYCL / oneAPI¶
Install the Intel oneAPI Base Toolkit, initialise it in the shell, and add -Denable_sycl=true:
The Windows SYCL build also needs the Level Zero loader, which oneAPI does not ship for Windows, and the icx-cl compiler. SYCL on Windows gives the full recipe.
Intel QSV (optional, for vmaf-tune)¶
On Windows the oneVPL runtime comes with Intel's graphics driver: install the current driver from the Intel Driver & Support Assistant or the Arc & Iris Xe Graphics driver package. To build FFmpeg with QSV yourself, install the oneVPL development headers. Intel QSV has the hardware matrix and the FFmpeg requirements.
Notes¶
- A change that builds on Linux but fails on Windows usually hits an MSVC difference: variable-length arrays are rejected, the 64-bit integer typedefs differ, and narrowing conversions are stricter.
scripts/dev/preflight.sh --stage msvcismchecks the most common of these without a Windows host (preflight).- Windows on ARM64 has its own recipe in Native MSVC on Windows ARM64.