# Source code for the ffmpeg fallback served by this site

This site serves `ffmpeg-core.wasm` and `ffmpeg-core.js` from @ffmpeg/core 0.12.10, a build of FFmpeg for the web.
It is free software under the GNU General Public License, version 2 or (at your option) any later version; the licence text is
in [../COPYING.txt](../COPYING.txt). This folder holds the complete corresponding source for that build, served from the same place as
the binary, for as long as the binary is served.

## The binary

- Package: @ffmpeg/core 0.12.10 on npm (https://registry.npmjs.org/@ffmpeg/core/-/core-0.12.10.tgz), published 2025-01-07T10:13:14.328Z, licence field
  `GPL-2.0-or-later`, integrity `sha512-dzNplnn2Nxle2c2i2rrDhqcB19q9cglCkWnoMTDN9Q9l3PvdjZWd1HfSPjCNWc/p8Q3CT+Es9fWOR0UhAeYQZA==`. The npm tarball holds only the built files, so it is not the source.
- This site serves `dist/esm/ffmpeg-core.wasm` from that package split into two parts, joined again in the page and checked
  against the SHA-256 in [../manifest.json](../manifest.json), and `dist/esm/ffmpeg-core.js` unchanged.

## The build

- Recipe: Dockerfile in the ffmpeg.wasm archive, target exportor: docker buildx build -o . .
- Toolchain: emscripten/emsdk:3.1.40 (Emscripten; its own runtime libraries are under permissive licences).
- FFmpeg configure flags: `--enable-gpl --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libopus --enable-zlib --enable-libwebp --enable-libfreetype --enable-libfribidi --enable-libass --enable-libzimg` (plus the cross compile flags in build/ffmpeg.sh).
- The ffmpeg.wasm archive below is the repository at the commit that released @ffmpeg/core 0.12.10
  ("RELEASE: @ffmpeg/core and @ffmpeg/core-mt v0.12.10"). Its Dockerfile fetches each library below from the ref shown.
- Two libraries are named in that Dockerfile by a branch rather than a tag (x264 `4-cores`, lame `master`). Upstream did not
  record which commit it built from, so the archive here is that branch's head on the day the package was published, the closest
  record there is.

## The archives

| Component | What it is | Licence | Upstream and ref | Commit | File | SHA-256 |
| --- | --- | --- | --- | --- | --- | --- |
| ffmpeg.wasm | Dockerfile, build scripts, JavaScript bindings and the fftools patches that build ffmpeg-core.js and ffmpeg-core.wasm | MIT (build scripts, bindings); the built core is GPL-2.0-or-later | https://github.com/ffmpegwasm/ffmpeg.wasm 71aa99d37c02a7b4c435275ca9ef50e612f6efa1 (commit) | `71aa99d37c02a7b4c435275ca9ef50e612f6efa1` | [ffmpeg.wasm-71aa99d37c02.tar.gz](ffmpeg.wasm-71aa99d37c02.tar.gz) | `53c5842f160cece0e39345876f9483b56aa84b966637ff6f624353a0fa884219` |
| FFmpeg | ffmpeg itself | GPL-2.0-or-later as configured (--enable-gpl) | https://github.com/FFmpeg/FFmpeg n5.1.4 (tag) | `4729204c17f756e186d622060088371d10b34f7e` | [FFmpeg-4729204c17f7.tar.gz](FFmpeg-4729204c17f7.tar.gz) | `0d7ad57d4dd851d577fc6c19e5cec5b6e5faaeb2dbd52ab76127e3c3763fec6d` |
| x264 | H.264 encoder | GPL-2.0-or-later | https://github.com/ffmpegwasm/x264 4-cores (branch head on 2025-01-07) | `33cac6b77d5b9259c552156013a817ab23119612` | [x264-33cac6b77d5b.tar.gz](x264-33cac6b77d5b.tar.gz) | `75434a5a1f2d7d4314821c6054dd300731d69e2fa73314ba4a5ec9df38d4ec80` |
| x265 | HEVC encoder | GPL-2.0-or-later | https://github.com/ffmpegwasm/x265 3.4 (tag) | `2bb5520e9596f361bf0ed81b3b8da0d7fd999069` | [x265-2bb5520e9596.tar.gz](x265-2bb5520e9596.tar.gz) | `e5254828f5db7bc375d385e31247861d25facee87b43fa2d08ea3ab5569672ab` |
| libvpx | VP8 and VP9 | BSD-3-Clause | https://github.com/ffmpegwasm/libvpx v1.13.1 (tag) | `10b9492dcf05b652e2e4b370e205bd605d421972` | [libvpx-10b9492dcf05.tar.gz](libvpx-10b9492dcf05.tar.gz) | `12181ed27342415e8b01bf09abfbf1dfa27a6a32f302fb78b48bd70efe50f702` |
| lame | MP3 encoder | LGPL-2.0-or-later | https://github.com/ffmpegwasm/lame master (branch head on 2025-01-07) | `2badea1974ae36cb8312afe99cff1e6b3b5decee` | [lame-2badea1974ae.tar.gz](lame-2badea1974ae.tar.gz) | `0d97ba0776988f5730e0ce1fa936e7c5d6836c757993ba55073513fe89cf410a` |
| ogg | Ogg container | BSD-3-Clause | https://github.com/ffmpegwasm/Ogg v1.3.4 (tag) | `bada45718453ac27b56773ae663f7e65112f6a6e` | [ogg-bada45718453.tar.gz](ogg-bada45718453.tar.gz) | `4d61f8dfa248276c42bd5404b1a87ae9d8a0d58791f55e20018c7b39b38d8823` |
| theora | Theora | BSD-3-Clause | https://github.com/ffmpegwasm/theora v1.1.1 (tag) | `7ffd8b2ecfc2d93ae5e16028e7528e609266bfbf` | [theora-7ffd8b2ecfc2.tar.gz](theora-7ffd8b2ecfc2.tar.gz) | `c38e6a3fb19566a44dcb283323c48311dd484f1416f3f34676d3e7fd252dfbc5` |
| opus | Opus | BSD-3-Clause | https://github.com/ffmpegwasm/opus v1.3.1 (tag) | `e85ed7726db5d677c9c0677298ea0cb9c65bdd23` | [opus-e85ed7726db5.tar.gz](opus-e85ed7726db5.tar.gz) | `c6d574b17d70b8c289d997a8ac81314cf1fd8c52237c421b2ee34e69cea85bf8` |
| vorbis | Vorbis | BSD-3-Clause | https://github.com/ffmpegwasm/vorbis v1.3.3 (tag) | `7798164043197d7e33f02de4353ce2aa5b248225` | [vorbis-779816404319.tar.gz](vorbis-779816404319.tar.gz) | `69b87cafe2815d02609886a63b9d4c0b7461e1e2f6ecf3960ede04053da6e96a` |
| zlib | zlib | Zlib | https://github.com/ffmpegwasm/zlib v1.2.11 (tag) | `cacf7f1d4e3d44d871b605da3b647f07d718623f` | [zlib-cacf7f1d4e3d.tar.gz](zlib-cacf7f1d4e3d.tar.gz) | `6d4d6640ca3121620995ee255945161821218752b551a1a180f4215f7d124d45` |
| libwebp | WebP | BSD-3-Clause | https://github.com/ffmpegwasm/libwebp v1.3.2 (tag) | `ca332209cb5567c9b249c86788cb2dbf8847e760` | [libwebp-ca332209cb55.tar.gz](libwebp-ca332209cb55.tar.gz) | `1676107dc385f9bf6cb4c2b94d4a9359d1fd95ab6309cb587191a742df292fe2` |
| freetype2 | FreeType | FTL or GPL-2.0-or-later | https://github.com/ffmpegwasm/freetype2 VER-2-10-4 (tag) | `6a2b3e4007e794bfc6c91030d0ed987f925164a8` | [freetype2-6a2b3e4007e7.tar.gz](freetype2-6a2b3e4007e7.tar.gz) | `09acceb42508c65b7b744cc2ad01d7548868ca57babc39f7683ec3c0f7541e8c` |
| fribidi | FriBidi | LGPL-2.1-or-later | https://github.com/fribidi/fribidi v1.0.9 (tag) | `f9e8e71a6fbf4a4619481284c9f484d10e559995` | [fribidi-f9e8e71a6fbf.tar.gz](fribidi-f9e8e71a6fbf.tar.gz) | `65ff6fb1a478c4d90ae16825da8c97b8a63e2674f8a2d6dae8800f89089640ba` |
| harfbuzz | HarfBuzz | MIT | https://github.com/harfbuzz/harfbuzz 5.2.0 (tag) | `4a1d891c6317d2c83e5f3c2607ec5f5ccedffcde` | [harfbuzz-4a1d891c6317.tar.gz.part0](harfbuzz-4a1d891c6317.tar.gz.part0)<br>[harfbuzz-4a1d891c6317.tar.gz.part1](harfbuzz-4a1d891c6317.tar.gz.part1) | `69ba7c7a42643a3654781242016dd09245cab7353fc2a02cecb710e479c9a881` |
| libass | libass | ISC | https://github.com/libass/libass 0.15.0 (tag) | `d149636f502f5774ae1a8fb4c554b122674393b2` | [libass-d149636f502f.tar.gz](libass-d149636f502f.tar.gz) | `5cfe23562fa623a3b209d156ad469aeb2e31f69bf6b256ea737d87d9ed89301d` |
| zimg | zimg (cloned with --recursive; submodules listed below it) | WTFPL | https://github.com/sekrit-twc/zimg release-3.0.5 (tag) | `e5b0de6bebbcbc66732ed5afaafef6b2c7dfef87` | [zimg-e5b0de6bebbc.tar.gz](zimg-e5b0de6bebbc.tar.gz) | `3ab062eff30067799997bc3e911c0108a5b8cbcd6e0ef14053f17ff0ecd0add8` |
| zimg/test/extra/googletest | zimg submodule test/extra/googletest | see the archive | https://github.com/google/googletest submodule of zimg (submodule commit) | `703bd9caab50b139428cea1aaff9974ebee5742e` | [zimg_test_extra_googletest-703bd9caab50.tar.gz](zimg_test_extra_googletest-703bd9caab50.tar.gz) | `d17b1b83a57b3933565a6d0616fe261107326d47de20288d0949ed038e1c342d` |

Archives over 20 MB are split so the host accepts them. Join the parts in order before unpacking, for example:

    cat harfbuzz-4a1d891c6317.tar.gz.part0 harfbuzz-4a1d891c6317.tar.gz.part1 > harfbuzz-4a1d891c6317.tar.gz

To rebuild: unpack the ffmpeg.wasm archive and run the recipe above in it. The Dockerfile fetches the same trees as the archives here;
to build offline, point each `ADD` line at the matching archive instead.
