FFmpeg 8.1.3 - the source of the FFmpeg DLLs that Ball Tracer installs, and how they were built
========================================================================================

Ball Tracer (https://balltracerplugin.com/) installs four FFmpeg libraries in its "helper" folder:
avcodec-62.dll, avformat-62.dll, avutil-60.dll and swresample-6.dll. FFmpeg is free software under the GNU Lesser General Public
License, version 2.1 or later (COPYING.LGPLv2.1). This download is the complete source of those four files and the recipe that
built them. Ball Tracer has NOT modified FFmpeg: the source is the official release, byte for byte.

What is in this download
  ffmpeg-8.1.3.tar.xz              the official source, https://ffmpeg.org/releases/ffmpeg-8.1.3.tar.xz
  ffmpeg-8.1.3.tar.xz.asc          its signature
  ffmpeg-devel.asc                  the FFmpeg release signing key (fingerprint FCF9 86EA 15E6 E293 A564  4F10 B432 2F04 D676 58D8)
  nv-codec-headers-n13.0.19.0.tar.gz  header files compiled in (MIT licence), https://github.com/FFmpeg/nv-codec-headers/archive/refs/tags/n13.0.19.0.tar.gz
  build\build_ffmpeg_trimmed.ps1    the build script; the configure line is inside it and below
  build\pkg-config-standin.sh       a 20-line stand-in for pkg-config, used by the script
  COPYING.LGPLv2.1                  the licence
  SHA256SUMS.txt                    the SHA-256 of every file here

Check it
  The tarball's SHA-256 must be 7138d28c96d9d3e3af4ee3d8cad72741f8ffb40da90c1112235dea3ecd3178a3
  and, with the key in ffmpeg-devel.asc imported into GnuPG:  gpg --verify ffmpeg-8.1.3.tar.xz.asc ffmpeg-8.1.3.tar.xz
  The nv-codec-headers file's SHA-256 must be 86d15d1a7c0ac73a0eafdfc57bebfeba7da8264595bf531cf4d8db1c22940116

The configure line (build_ffmpeg_trimmed.ps1 passes exactly this; --prefix is only the install folder)
  ./configure --toolchain=msvc --arch=x86_64 --target-os=win64 --prefix=<install folder> --enable-shared --disable-static --disable-debug --disable-gpl --disable-nonfree --disable-version3 --disable-programs --disable-doc --disable-network --disable-autodetect --disable-everything --disable-avdevice --disable-avfilter --disable-swscale --enable-swresample --enable-demuxer=mov --enable-demuxer=matroska --enable-demuxer=mxf --enable-protocol=file --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=prores --enable-parser=h264 --enable-parser=hevc --enable-d3d11va --enable-hwaccel=h264_d3d11va --enable-hwaccel=hevc_d3d11va --enable-hwaccel=h264_d3d11va2 --enable-hwaccel=hevc_d3d11va2 --enable-ffnvcodec --enable-nvdec --enable-hwaccel=h264_nvdec --enable-hwaccel=hevc_nvdec

Build it again (Windows 10/11, 64-bit)
  Tools used: Microsoft Visual C++ 19.44 (Build Tools 2022, x64); NASM 2.16.03 (assembler); GNU make 4.2.1 and the shell tools of Git for Windows.
  1. Keep ffmpeg-8.1.3.tar.xz and nv-codec-headers-n13.0.19.0.tar.gz as they are in this bundle: the script checks their SHA-256
     against the values it is pinned to (they are in SHA256SUMS.txt too) and unpacks them itself into a new folder.
  2. In a Visual Studio x64 developer prompt:
       powershell -File build\build_ffmpeg_trimmed.ps1 -SourceArchive <ffmpeg-8.1.3.tar.xz> -NvHeadersArchive <nv-codec-headers-n13.0.19.0.tar.gz> -Out <install folder> -Nasm <folder with nasm.exe>
  3. <install folder>\bin holds avcodec-62.dll, avformat-62.dll, avutil-60.dll and swresample-6.dll.
  The script's header explains its four workarounds for tool quirks; none of them changes what is built. Start every build from freshly
  unpacked source (the script does not support incremental builds). A rebuild gives the same libraries (same sizes, same licence report,
  same behaviour) but not byte-identical files: the compiler writes the build folder's path and a timestamp into them.

Use your own FFmpeg with Ball Tracer
  Close DaVinci Resolve, copy your four DLLs (same names, same major numbers) over the ones in
  C:\Program Files\Common Files\OFX\Plugins\BallTracer.ofx.bundle\Contents\Win64\helper\, start Resolve. Ball Tracer's helper needs the
  mov/mp4, Matroska and MXF demuxers and the h264, hevc and prores decoders. You may reverse engineer the libraries to debug your changes
  (LGPL section 6). Ball Tracer's own THIRD-PARTY-NOTICES.txt (installed beside the plug-in) says the same, with all licence texts.

Questions: https://balltracerplugin.com/support