@wasm-zoo/ffmpeg
v0.2.8
Published
FFmpeg 9.0.2 compiled for browser WebAssembly by WASM Zoo, with Consumer API v1 and bundled runtime assets.
Maintainers
Readme
@wasm-zoo/ffmpeg
Unofficial WASM Zoo distribution of the upstream FFmpeg ffmpeg CLI for browsers. This package is backed by FFmpeg 9.0.2, Zoo builder 0.2.8, and the reviewed browser-full Release asset.
Install
npm install @wasm-zoo/ffmpegUse
import { load } from "@wasm-zoo/ffmpeg";
const ffmpeg = await load();
try {
const result = await ffmpeg.exec([
"-i", "/input.mp4",
"-c", "copy",
"/output.mp4"
], {
files: [{ name: "/input.mp4", data: inputBytes }],
outputs: ["/output.mp4"]
});
console.log(result.files[0]);
} finally {
ffmpeg.dispose();
}The default entry imports the reviewed browser wrapper and uses static new URL(..., import.meta.url) references so modern bundlers can emit ffmpeg-core.js, ffmpeg-core.wasm. For manual/self-hosted deployments use @wasm-zoo/ffmpeg/self-hosted and the Consumer API v1 baseUrl contract.
This npm package intentionally bundles only the LGPL browser-full profile. It uses pthreads and WebAssembly SIMD, so the hosting page must be cross-origin isolated and provide SharedArrayBuffer. The separate browser-full-gpl/libx264 Release profile is not bundled into this npm package.
