# Rebuilding the audited codec DLLs

The application source is not required to rebuild or replace FFmpeg's DLLs.
Use the exact source archives in `../sources`, the configurations here, and an
x64 MSVC development environment with Windows SDK, CMake, NASM, GNU make,
pkgconf, Perl and Python/Meson/Ninja where needed. These are build tools, not
application runtime dependencies. The recorded builds used MSVC 19.51 / VS2026.

The command files in this directory record the original build paths. Substitute
your extracted source/build/install paths before replaying them. All components
install into one x64 prefix with `include`, `lib`, `lib/pkgconfig` and `bin`.
For MSYS pkgconf use a POSIX `PKG_CONFIG_PATH`, such as `/d/work/prefix/lib/pkgconfig`.

1. OpenH264 2.6.0: `make -j8 OS=msvc ARCH=x86_64 libraries`. Copy `codec/api/wels`
   headers to `include/wels`, `openh264.dll` to `bin`, and its DLL import library
   `openh264_dll.lib` as `lib/openh264.lib`. A pkg-config file is supplied in the
   project SDK. The compiler uses the upstream Windows build settings.
2. zlib 1.3.1: CMake/MSVC x64, Release, examples off. Apply
   `zlib-windows-header.patch` to `zconf.h.cmakein` before configuring. This
   preserves compatibility with consumers defining `HAVE_UNISTD_H=0`. It changes
   no library ABI or compression algorithm. Install, and place `zlib.pc` under
   `lib/pkgconfig` as well as its original `share/pkgconfig` location.
3. Mbed TLS 2.28.10: choose its Apache-2.0 option. CMake flags:
   `-DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF
   -DUSE_STATIC_MBEDTLS_LIBRARY=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5`.
   Build x64 Release with the dynamic MSVC runtime, and install.
4. SRT 1.5.4: CMake flags `-DENABLE_APPS=OFF -DENABLE_TESTING=OFF
   -DENABLE_SHARED=ON -DENABLE_STATIC=OFF -DUSE_ENCLIB=mbedtls`. Set
   `SSL_INCLUDE_DIRS` to the prefix include directory, `SSL_LIBRARY_DIRS` to its
   lib directory, and `SSL_LIBRARIES` to the complete `mbedcrypto.lib` path.
   Use x64 Release with the dynamic MSVC runtime, then install.
5. libRIST 0.2.11: Meson, MSVC x64, Release, `default_library=shared`,
   `b_vscrt=md`, `test=false`, `built_tools=false`, `builtin_cjson=true`,
   `fallback_builtin=false`. The supplied `mbedcrypto.pc` selects the static
   Apache-licensed crypto library. Keep MSVC's linker ahead of MSYS `link.exe` in
   PATH. Install; provide the DLL import library also as `rist.lib` to match the
   upstream pkg-config `-lrist` spelling. The DLL remains named `librist.dll`.
6. libaom 3.11.0: CMake/MSVC x64 Release with dynamic MSVC runtime; disable
   tests/examples/docs/tools; enable both AV1 encoder and decoder. Configure
   `CMAKE_ASM_NASM_COMPILER` explicitly to native Windows NASM 2.16.03 and
   `PERL_EXECUTABLE` to the available Perl executable. Build and install.
7. Copy ffnvcodec 13.0.19.0 and AMF 1.4.36 headers to the prefix, retaining
   notices. Apply `AMF-C-header.patch`: guard the C++-namespace declaration when
   including DisplayCapture.h from C. It changes no AMF encoder implementation.
8. Build unmodified FFmpeg 8.1.2 with `build-ffmpeg-final.sh` / the recorded
   configure line. GPL, nonfree and version3 are disabled. The final generated
   `ffmpeg-config.h` and `ffmpeg-config.mak` record all selected components.
   On MSVC, FFmpeg installs import libraries in bin; also copy them into lib for
   the application's CMake build. Keep all required DLLs together in bin.

The application's build-time manifest gate is not an end-user restriction.
Modified compatible FFmpeg DLLs may be installed in `runtime/bin/64bit` for
debugging or personal use; no signature check prevents their replacement.
# Current an earlier revision build

Use `ffmpeg-openh264-dynamic/README.md` for the matching FFmpeg patch and build
procedure. OpenH264 is now an optional separately downloaded Cisco module.
Do not build or redistribute the old source-built OpenH264 DLL. The commands
below document the an earlier revision baseline and its unchanged dependency versions.

