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
8 changes: 4 additions & 4 deletions apps/website/docs/getting-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,9 @@ Asyncify, which rewrites the wasm code. The JSPI core does the same job with
[JavaScript Promise Integration](https://github.com/WebAssembly/js-promise-integration),
a feature of the browser and Node.js. It runs the same FFmpeg and the same
`src/pthread-fiber` scheduler, so it needs no `SharedArrayBuffer`. Its wasm
file is about 19% smaller than the default core's (32.4 MB against 40.1 MB,
before compression), and the CI benchmark cases ran faster and used less
memory.
file is about {Math.round((1 - coreSizes["core-jspi"]["ffmpeg-core.wasm"] / coreSizes.core["ffmpeg-core.wasm"]) * 100)}% smaller than the default core's
({(coreSizes["core-jspi"]["ffmpeg-core.wasm"] / 1e6).toFixed(1)} MB against {(coreSizes.core["ffmpeg-core.wasm"] / 1e6).toFixed(1)} MB, before compression), and the CI
benchmark cases ran faster and used less memory.

It needs a runtime with JSPI: Chrome 137 or later, Firefox 153 or later,
Safari 27 or later, or Node.js 24 or later (tested on 24.21.0, and an older
Expand Down Expand Up @@ -626,7 +626,7 @@ return a Promise instead of a number, so `await` them.
- It has only been tested on short clips in CI, the wrapper test suites and
FFmpeg's FATE tests. It has had no long-running or large-file testing, and
no memory-leak testing over many commands.
- It is not on the Playground, and its size is not in `core-sizes.json`.
- It is not on the Playground.

## Node.js

Expand Down
4 changes: 4 additions & 0 deletions apps/website/src/data/core-sizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
"core-mt": {
"ffmpeg-core.js": 113289,
"ffmpeg-core.wasm": 32778819
},
"core-jspi": {
"ffmpeg-core.js": 97901,
"ffmpeg-core.wasm": 32412275
}
}
4 changes: 2 additions & 2 deletions scripts/update-core-sizes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Usage: node scripts/update-core-sizes.mjs <version> [--run <run-id>]
// Default reads the published packages from the jsDelivr data API. --run
// reads the ffmpeg-core and ffmpeg-core-mt artifacts of a CI run with gh
// reads the ffmpeg-core, -core-mt and -core-jspi artifacts of a CI run with gh
// instead, for a release PR whose version is not published yet. The cores
// are built from the same inputs, so the sizes hold for the tag.
import { execFileSync } from "node:child_process";
Expand Down Expand Up @@ -48,7 +48,7 @@ async function sizesFromJsdelivr(pkg) {
const sizes = { version };
const scratch = mkdtempSync(join(tmpdir(), "core-sizes-"));
try {
for (const pkg of ["core", "core-mt"]) {
for (const pkg of ["core", "core-mt", "core-jspi"]) {
sizes[pkg] = flag ? sizesFromRun(pkg, scratch) : await sizesFromJsdelivr(pkg);
}
} finally {
Expand Down
Loading