Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ maintained fork of the abandoned `ffmpegwasm/ffmpeg.wasm`.

## FFmpeg upgrade plan

Both cores build FFmpeg n9.0.2. The ffmpeg CLI in fftools has needed a
Both cores build FFmpeg n9.1. The ffmpeg CLI in fftools has needed a
threaded scheduler since 6.0; the mt core has real pthreads, the st core has
none (no `SharedArrayBuffer`), so it runs the scheduler on a cooperative
pthread shim instead.
Expand Down Expand Up @@ -61,7 +61,7 @@ Lessons from the shim, so they are not rediscovered:
core links so fftools' scheduler runs without `SharedArrayBuffer`.
With `PFIBER_JSPI` (`make prd-jspi`, the opt-in `packages/core-jspi`) a switch
suspends the wasm stack with JSPI instead; see `build/ffmpeg-wasm.sh`.
- `build/patches/n9`: patches applied to FFmpeg n9.0.2's own fftools sources
- `build/patches/n9`: patches applied to FFmpeg n9.1's own fftools sources
for both cores; see the comment in the Dockerfile's `ffmpeg-base` stage.
- `src/bind`: JS glue passed to emcc when building the core.
- `build/`: per-library build scripts used by the Dockerfile.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Changed

- Both cores build FFmpeg 9.1 (was 9.0.2).
- The cores are built with Emscripten 7.0.0.

## 0.18.0
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ ARG EXTRA_LDFLAGS
ARG FFMPEG_ST
ARG FFMPEG_MT
ENV INSTALL_DIR=/opt
# Both cores build the same FFmpeg release now: n9.0.2's fftools has needed
# Both cores build the same FFmpeg release now: n9.1's fftools has needed
# real threads (the fftools scheduler) since n6.0, and the st core gets them
# via src/pthread-fiber, a cooperative pthread shim on Emscripten fibers,
# since it has no SharedArrayBuffer for real ones. See "FFmpeg upgrade plan"
# in AGENTS.md. Kept as two variables, both n9.0.2, only so a future version
# in AGENTS.md. Kept as two variables, both n9.1, only so a future version
# bump can stage st and mt separately again if needed.
ENV FFMPEG_VERSION_ST=n9.0.2
ENV FFMPEG_VERSION_MT=n9.0.2
ENV FFMPEG_COMMIT_ST=946fcce07b6dcd0331c8cc609192aeff5e1924f8
ENV FFMPEG_COMMIT_MT=946fcce07b6dcd0331c8cc609192aeff5e1924f8
ENV FFMPEG_VERSION_ST=n9.1
ENV FFMPEG_VERSION_MT=n9.1
ENV FFMPEG_COMMIT_ST=74e4393595cf2b5857f0da925c4e0dd74ea306e5
ENV FFMPEG_COMMIT_MT=74e4393595cf2b5857f0da925c4e0dd74ea306e5
# Clang in current emsdk releases defaults several legacy-C88/C89 patterns
# (implicit function declarations, mismatched function pointer types, and
# int/pointer conversions) to hard errors. Some of the bundled third-party
Expand Down
3 changes: 1 addition & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ FFmpeg and third-party libraries built into the core packages
FFmpeg
https://ffmpeg.org
License: LGPL-2.1-or-later; GPL-2.0-or-later when built with --enable-gpl
(this project's build). Versions used: n5.1.10 (single-thread core),
n9.0.2 (multi-thread core). See Dockerfile.
(this project's build). Version used: n9.1 (both cores). See Dockerfile.

x264
https://www.videolan.org/developers/x264.html
Expand Down
6 changes: 3 additions & 3 deletions apps/website/docs/fate-and-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ where that download is unwanted.

```sh
# 1. Fetch FFmpeg's tests/ directory for the pinned tag (sparse checkout).
node scripts/fate/fetch-defs.mjs --tag n9.0.2
node scripts/fate/fetch-defs.mjs --tag n9.1

# 2. Pick a subset and write it as a manifest.
node scripts/fate/select.mjs --tag n9.0.2 --subset fast --out manifest.json
node scripts/fate/select.mjs --tag n9.1 --subset fast --out manifest.json

# 3. Fetch any samples that subset's tests reference (no-op for "fast").
node scripts/fate/fetch-samples.mjs --manifest manifest.json --tag n9.0.2
node scripts/fate/fetch-samples.mjs --manifest manifest.json --tag n9.1

# 4. Run it against a built core and write results.
node scripts/fate/run.mjs --core packages/core --label st --manifest manifest.json --out results.json
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ffmpeg.wasm is built with toolchains / libraries:
<TableBody>
{[
{name: "Emscripten", version: "7.0.0", note: "Emscripten is a toolchain for compiling C and C++ code into WebAssembly and JavaScript, making it possible to run applications written in these languages in web browsers. Version is the emsdk Docker image tag."},
{name: "FFmpeg", version: "n9.0.2 (multithread core), n9.0.2 (single-thread core)", note: "FFmpeg is a powerful multimedia framework that can decode, encode, transcode, and stream audio and video files. Both cores now build the same FFmpeg release; the single-thread core runs fftools' scheduler on a cooperative pthread shim (src/pthread-fiber) since it has no SharedArrayBuffer for real threads. See \"FFmpeg upgrade plan\" in AGENTS.md."},
{name: "FFmpeg", version: "n9.1 (multithread core), n9.1 (single-thread core)", note: "FFmpeg is a powerful multimedia framework that can decode, encode, transcode, and stream audio and video files. Both cores now build the same FFmpeg release; the single-thread core runs fftools' scheduler on a cooperative pthread shim (src/pthread-fiber) since it has no SharedArrayBuffer for real threads. See \"FFmpeg upgrade plan\" in AGENTS.md."},
{name: "x264", version: "4-cores (branch)", note: "x264 is a popular video encoding library that provides high-quality H.264 video compression. Built from the ffmpegwasm mirror's 4-cores branch; upstream x264 has no stable release tags to move to."},
{name: "x265", version: "4.2", note: "x265 is a video encoding library that specializes in encoding videos using the H.265/HEVC codec, offering high compression efficiency for video content. Built from canonical upstream (multicoreware/x265_git)."},
{name: "libvpx", version: "v1.17.0", note: "libvpx is an open-source video codec library used for encoding and decoding VP8 and VP9 video formats, commonly used for web-based video streaming. Built from canonical upstream (webmproject/libvpx)."},
Expand Down
14 changes: 7 additions & 7 deletions apps/website/docs/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ copy one to start your own.

## Size

Measured in CI at FFmpeg n9.0.2, from `dist/umd`. Gzip is level 9. The last
Measured in CI at FFmpeg n9.1, from `dist/umd`. Gzip is level 9. The last
column adds the gzipped `ffmpeg-core.js`.

| preset | core | wasm (MB) | wasm gzip (MB) | wasm and js gzip (MB) |
| --- | --- | --- | --- | --- |
| `full` | single-thread | 39.96 | 13.44 | 13.48 |
| `full` | multi-thread | 32.36 | 11.05 | 11.08 |
| `web` | single-thread | 14.89 | 4.84 | 4.87 |
| `web` | multi-thread | 12.30 | 4.01 | 4.04 |
| `decode` | single-thread | 25.31 | 9.00 | 9.04 |
| `decode` | multi-thread | 20.22 | 7.46 | 7.50 |
| `full` | single-thread | 40.37 | 13.62 | 13.65 |
| `full` | multi-thread | 33.25 | 11.35 | 11.38 |
| `web` | single-thread | 15.70 | 5.13 | 5.16 |
| `web` | multi-thread | 13.27 | 4.35 | 4.38 |
| `decode` | single-thread | 25.85 | 9.22 | 9.25 |
| `decode` | multi-thread | 20.93 | 7.73 | 7.76 |

Each `build-preset` job in the CI workflow prints its row in the job summary,
so a change that moves these numbers shows up in a pull request.
Expand Down
72 changes: 39 additions & 33 deletions apps/website/docs/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@ This page is generated from `baseline/fate.json` and `baseline/bench.json` by `n

## Compatibility (FATE)

FFmpeg n9.0.2. The pass rate is pass divided by pass plus fail. A skipped test is one the runner could not run: its sample is missing from the FATE mirror, or it is a known failure listed below.
FFmpeg n9.1. The pass rate is pass divided by pass plus fail. A skipped test is one the runner could not run: its sample is missing from the FATE mirror, or it is a known failure listed below.

### Full subset (pull requests)

| core | pass | fail | skip | total | pass rate |
| --- | --- | --- | --- | --- | --- |
| st | 1055 | 0 | 4 | 1059 | 100.0% |
| mt | 1055 | 0 | 4 | 1059 | 100.0% |
| st | 1164 | 1 | 6 | 1171 | 99.9% |
| mt | 1164 | 1 | 6 | 1171 | 99.9% |

| test file | st pass / total | mt pass / total |
| --- | --- | --- |
| `filter-audio.mak` | 53 / 53 | 53 / 53 |
| `filter-video.mak` | 88 / 91 | 88 / 91 |
| `ffmpeg.mak` | 23 / 23 | 23 / 23 |
| `libswscale.mak` | 2 / 2 | 2 / 2 |
| `filter-video.mak` | 120 / 126 | 120 / 126 |
| `ffmpeg.mak` | 78 / 78 | 78 / 78 |
| `libswscale.mak` | 6 / 6 | 6 / 6 |
| `libswresample.mak` | 1 / 1 | 1 / 1 |
| `demux.mak` | 54 / 54 | 54 / 54 |
| `mov.mak` | 29 / 29 | 29 / 29 |
| `mov.mak` | 30 / 30 | 30 / 30 |
| `qt.mak` | 18 / 18 | 18 / 18 |
| `matroska.mak` | 7 / 8 | 7 / 8 |
| `matroska.mak` | 8 / 9 | 8 / 9 |
| `mxf.mak` | 6 / 6 | 6 / 6 |
| `gif.mak` | 5 / 5 | 5 / 5 |
| `apng.mak` | 5 / 5 | 5 / 5 |
| `h264.mak` | 207 / 207 | 207 / 207 |
| `hevc.mak` | 16 / 16 | 16 / 16 |
| `vpx.mak` | 24 / 24 | 24 / 24 |
| `vvc.mak` | 2 / 2 | 2 / 2 |
| `h264.mak` | 210 / 210 | 210 / 210 |
| `hevc.mak` | 18 / 18 | 18 / 18 |
| `vpx.mak` | 25 / 25 | 25 / 25 |
| `vvc.mak` | 4 / 4 | 4 / 4 |
| `mpeg4.mak` | 6 / 6 | 6 / 6 |
| `video.mak` | 122 / 122 | 122 / 122 |
| `video.mak` | 123 / 123 | 123 / 123 |
| `image.mak` | 133 / 133 | 133 / 133 |
| `bmp.mak` | 13 / 13 | 13 / 13 |
| `prores.mak` | 10 / 10 | 10 / 10 |
Expand All @@ -41,27 +41,33 @@ FFmpeg n9.0.2. The pass rate is pass divided by pass plus fail. A skipped test i
| `lossless-video.mak` | 16 / 16 | 16 / 16 |
| `jpeg2000.mak` | 15 / 15 | 15 / 15 |
| `hap.mak` | 13 / 13 | 13 / 13 |
| `ac3.mak` | 3 / 3 | 3 / 3 |
| `acodec.mak` | 1 / 1 | 1 / 1 |
| `ac3.mak` | 4 / 4 | 4 / 4 |
| `acodec.mak` | 2 / 2 | 2 / 2 |
| `opus.mak` | 1 / 1 | 1 / 1 |
| `audio.mak` | 9 / 9 | 9 / 9 |
| `adpcm.mak` | 52 / 52 | 52 / 52 |
| `pcm.mak` | 8 / 8 | 8 / 8 |
| `audio.mak` | 11 / 11 | 11 / 11 |
| `adpcm.mak` | 54 / 54 | 54 / 54 |
| `pcm.mak` | 9 / 9 | 9 / 9 |
| `voice.mak` | 12 / 12 | 12 / 12 |
| `microsoft.mak` | 25 / 25 | 25 / 25 |
| `lossless-audio.mak` | 13 / 13 | 13 / 13 |
| `wavpack.mak` | 29 / 29 | 29 / 29 |
| `dca.mak` | 3 / 3 | 3 / 3 |
| `wavpack.mak` | 31 / 31 | 31 / 31 |
| `dca.mak` | 1 / 1 | 1 / 1 |

#### st core, full subset, failing and skipped tests

- `fate-filter-scale_cuda-resize-step-p010` fails: ffmpeg exited -28
- `fate-filter-fps-single-zero-duration` skipped: no reference file
- `fate-filter-fps-single-cross-start` skipped: no reference file
- `fate-filter-frei0r-filter` skipped: known failure: frei0r is not built into the cores
- `fate-filter-frei0r-filter-unaligned` skipped: known failure: frei0r is not built into the cores
- `fate-filter-frei0r-source` skipped: known failure: frei0r is not built into the cores
- `fate-matroska-prores-header-insertion-bz2` skipped: known failure: needs bzip2, which the cores are built without

#### mt core, full subset, failing and skipped tests

- `fate-filter-scale_cuda-resize-step-p010` fails: ffmpeg exited -28
- `fate-filter-fps-single-zero-duration` skipped: no reference file
- `fate-filter-fps-single-cross-start` skipped: no reference file
- `fate-filter-frei0r-filter` skipped: known failure: frei0r is not built into the cores
- `fate-filter-frei0r-filter-unaligned` skipped: known failure: frei0r is not built into the cores
- `fate-filter-frei0r-source` skipped: known failure: frei0r is not built into the cores
Expand All @@ -76,26 +82,26 @@ FFmpeg n9.0.2. The pass rate is pass divided by pass plus fail. A skipped test i

| test file | st pass / total | mt pass / total |
| --- | --- | --- |
| `filter-audio.mak` | 12 / 12 | 12 / 12 |
| `filter-video.mak` | 12 / 12 | 12 / 12 |
| `ffmpeg.mak` | 5 / 5 | 5 / 5 |
| `libswscale.mak` | 2 / 2 | 2 / 2 |
| `filter-audio.mak` | 9 / 9 | 9 / 9 |
| `filter-video.mak` | 8 / 8 | 8 / 8 |
| `ffmpeg.mak` | 6 / 6 | 6 / 6 |
| `libswscale.mak` | 6 / 6 | 6 / 6 |
| `libswresample.mak` | 1 / 1 | 1 / 1 |
| `mov.mak` | 3 / 3 | 3 / 3 |
| `ac3.mak` | 2 / 2 | 2 / 2 |
| `acodec.mak` | 1 / 1 | 1 / 1 |
| `ac3.mak` | 3 / 3 | 3 / 3 |
| `acodec.mak` | 2 / 2 | 2 / 2 |
| `opus.mak` | 1 / 1 | 1 / 1 |
| `voice.mak` | 1 / 1 | 1 / 1 |

## Performance

Median of five runs on one GitHub Actions runner, against native ffmpeg version 6.1.1-3ubuntu5 from the runner image, not the pinned tag. Most cases transcode a 1 second H.264 clip, so startup is a large part of their native time. The vp8-720p-to-mp4 case transcodes 10 seconds of 720p VP8 and is measured only on manual CI runs with subset=full. A "-" means the case has no result for that core yet.
Median of five runs on one GitHub Actions runner, against native ffmpeg version 8.0.1-3ubuntu2 from the runner image, not the pinned tag. Most cases transcode a 1 second H.264 clip, so startup is a large part of their native time. The vp8-720p-to-mp4 case transcodes 10 seconds of 720p VP8 and is measured only on manual CI runs with subset=full. A "-" means the case has no result for that core yet.

| case | native (ms) | st (ms) | st ratio | st peak RSS (MB) | mt (ms) | mt ratio | mt peak RSS (MB) | jspi (ms) | jspi ratio | jspi peak RSS (MB) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| h264-to-vp9 | 120 | 520 | 4.33x | 216 | 1240 | 10.33x | 639 | 430 | 3.58x | 175 |
| h264-to-x264 | 90 | 540 | 6.00x | 239 | 1200 | 13.33x | 650 | 460 | 5.11x | 200 |
| h264-to-mpeg4 | 90 | 380 | 4.22x | 173 | 1110 | 12.33x | 613 | 280 | 3.11x | 147 |
| scale-half | 100 | 540 | 5.40x | 227 | 1200 | 12.00x | 645 | 450 | 4.50x | 196 |
| h264-remux-mkv | 80 | 270 | 3.38x | 156 | 1100 | 13.75x | 575 | 220 | 2.75x | 139 |
| vp8-720p-to-mp4 | 5250 | 69180 | 13.18x | 408 | 31480 | 6.00x | 841 | 66410 | 12.65x | 343 |
| h264-to-vp9 | 110 | 530 | 4.82x | 216 | 1200 | 10.91x | 637 | 420 | 3.82x | 176 |
| h264-to-x264 | 80 | 530 | 6.63x | 242 | 1250 | 15.63x | 666 | 440 | 5.50x | 201 |
| h264-to-mpeg4 | 80 | 380 | 4.75x | 172 | 1120 | 14.00x | 621 | 260 | 3.25x | 148 |
| scale-half | 80 | 510 | 6.38x | 233 | 1150 | 14.38x | 649 | 450 | 5.63x | 198 |
| h264-remux-mkv | 70 | 260 | 3.71x | 158 | 1050 | 15.00x | 576 | 220 | 3.14x | 140 |
| vp8-720p-to-mp4 | 5120 | 68900 | 13.46x | 408 | 31590 | 6.17x | 834 | 66610 | 13.01x | 363 |
Loading