# Complete Corresponding Source — FFmpeg build shipped with Vizloom

This archive contains the **complete corresponding source** for the static FFmpeg
binary distributed with Vizloom, provided to satisfy the GNU General Public
License, version 3 (GPL v3), under which that binary is licensed.

Vizloom invokes FFmpeg only as a separate child process; it is not linked into
Vizloom's own (closed-source) code. The binary is built from unmodified upstream
sources with the exact build scripts and configure invocation included here. The
same sources and scripts produce the binary on every platform Vizloom ships
(the build is driven by `ffmpeg-build.config.json` and the scripts in
`scripts/`).

## Pinned components

| Component | Version / commit | License | Source archive |
|-----------|------------------|---------|----------------|
| FFmpeg | 8.1.1 | GPL v3 | `sources/ffmpeg-8.1.1.tar.xz` |
| x264 | commit `b35605ace3ddf7c1a5d67a2eb553f034aef41d55` (branch `stable`) | GPL v2+ | `sources/x264-b35605ace3ddf7c1a5d67a2eb553f034aef41d55.tar.gz` |
| LAME | 3.100 | LGPL v2.1 | `sources/lame-3.100.tar.gz` |

Source archive SHA-256:

```
b6863adde98898f42602017462871b5f6333e65aec803fdd7a6308639c52edf3  sources/ffmpeg-8.1.1.tar.xz
cd71a7515b0e9a012e1ac9b1f8415bebcaf6fc97d4db32286642ac4c0fbe24f9  sources/x264-b35605ace3ddf7c1a5d67a2eb553f034aef41d55.tar.gz
ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e  sources/lame-3.100.tar.gz
```

The FFmpeg and LAME hashes match the pins recorded in `ffmpeg-build.config.json`.
The x264 archive is the GitLab archive of the exact commit pinned in that file.

## Build configuration

FFmpeg is configured with:

```
--enable-gpl --enable-libx264 --enable-libmp3lame --disable-autodetect
--enable-static --disable-shared --disable-debug --disable-doc
--disable-videotoolbox
```

`--enable-nonfree` is deliberately **not** used, and no nonfree codecs
(e.g. `libfdk-aac`) are included, so the binary is redistributable under the GPL.

The build statically links x264 (GPL) and LAME (LGPL). One build-time edit is
applied by `scripts/build-ffmpeg-core.sh`: it removes the `lame_init_old` entry
from `lame/include/libmp3lame.sym` so LAME links cleanly. That edit is part of
the included scripts and is reproduced automatically when you run the build;
the upstream sources in `sources/` are otherwise unmodified.

## How to build (any platform)

The build is driven by `scripts/build-ffmpeg.js`, which reads
`ffmpeg-build.config.json`, fetches the pinned sources, and runs the
appropriate platform core script (`scripts/build-ffmpeg-core.sh` on
macOS/Linux, `scripts/build-ffmpeg-win.ps1` on Windows):

```sh
node scripts/build-ffmpeg.js --strict
```

`--strict` fails the build if a downloaded source's SHA-256 does not match the
pin in `ffmpeg-build.config.json`. The resulting binary is written to
`resources/bin/<platform>/<arch>/ffmpeg[.exe]`. Building from this archive with
these scripts and the configure line above reproduces the FFmpeg binary shipped
with Vizloom for the corresponding platform.

## Contents

```
README.md                                this file
ffmpeg-build.config.json                 version pins + configure flags
scripts/build-ffmpeg.js                  build orchestrator
scripts/build-ffmpeg-core.sh             macOS/Linux core build
scripts/build-ffmpeg-mac.sh              macOS entry point
scripts/build-ffmpeg-win.ps1             Windows build
licenses/GPL-3.0.txt                     GPL v3 license text
licenses/LGPL-2.1.txt                    LGPL v2.1 license text
sources/ffmpeg-8.1.1.tar.xz              pinned FFmpeg source
sources/x264-<commit>.tar.gz             pinned x264 source
sources/lame-3.100.tar.gz                pinned LAME source
```
