# Building the Hub's FFmpeg Shutter Vault Hub ships a small FFmpeg of its own, in `Server/vendor/ffmpeg//`. This folder is how it is built. It is also the "build script" part of the source we publish beside each installer (see "Publishing the source" below). - **Source:** the unmodified release tarball `ffmpeg-9.0.2.tar.xz` from , pinned by SHA-256 in `build-ffmpeg.sh` and signed by the FFmpeg release key (`FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8`). - **Licence:** LGPL 2.1 or later. No `--enable-gpl`, `--enable-nonfree` or `--enable-version3`; no outside library. The script stops if the result is anything else. - **What it can do:** read MOV/MP4/M4V/3GP/AVI with H.264, HEVC, ProRes, MPEG-4, H.263 or Motion JPEG video, and write one JPEG. The full list is the `COMMON` block in `build-ffmpeg.sh`. ## Windows (x64) Needs Docker. From the `Hub` folder: ```sh docker build --output type=local,dest=installer/ffmpeg/out installer/ffmpeg ``` `installer/ffmpeg/out/` then holds `ffmpeg.exe`, the licence texts, `BUILD-INFO.json` and `toolchain-packages.txt`. Copy all of it to `Server/vendor/ffmpeg/win32-x64/`. The build is reproducible: the base image is pinned by digest, the compiler comes from a dated Debian snapshot, and no build time goes into the file. Two builds of 9.0.2 on November 11, 2026 gave the same `ffmpeg.exe`, SHA-256 `72e0e66ae16f926326832af5529efe8a9bb5f7603a025b7ea9b4be67e1bb7d4e`. To build without a download, put `ffmpeg-9.0.2.tar.xz` in this folder first. (`*.tar.xz` and `out/` here are ignored by git.) ## Mac (Apple Silicon) On the Mac, with Xcode's command-line tools: ```sh bash installer/ffmpeg/build-ffmpeg.sh darwin-arm64 installer/ffmpeg/out-mac ``` Copy `installer/ffmpeg/out-mac/` to `Server/vendor/ffmpeg/darwin-arm64/`. It targets macOS 13, the Mac Hub's minimum, and links only system libraries. This build depends on the installed Xcode, so it is repeatable but not pinned byte for byte; `BUILD-INFO.json` records the compiler and SDK used. ## After a rebuild 1. In `Server/`: `node scripts/run-tests.js`. `test/ffmpegBundle.test.js` checks the licence, the hashes in `BUILD-INFO.json` and one frame from every kind of video, with the Hub's exact command. 2. Rebuild the installers. Both refuse a binary that doesn't match its `BUILD-INFO.json`. ## Publishing the source The LGPL asks that the source be offered where the binary is. For each public installer, publish beside it: - `ffmpeg-9.0.2.tar.xz` (the exact tarball; SHA-256 `8c3850283eb25fa026482078a04051e0be17347b09ef81a0849bec15a96e002e`), and - this folder (`build-ffmpeg.sh`, `Dockerfile`, `README.md`). When the FFmpeg version changes, keep the old source up for as long as the old installer is offered. ## Changing what it reads Add the decoder, parser or container to `COMMON` in `build-ffmpeg.sh`, rebuild both platforms, and add a clip to `Server/test/fixtures/video/` with a line in `test/ffmpegBundle.test.js`. Use only FFmpeg's own LGPL parts. An outside library (`--enable-lib…`) brings its own licence and its own source to publish; the notice collector flags it.