FFmpeg.wasm Core

July 27, 2023 ยท View on GitHub

Deprecated, merge to https://github.com/ffmpegwasm/ffmpeg.wasm as part of the monorepo.

Node Version FFmpeg.wasm Core npm (tag) Maintenance Downloads Total Downloads Month

This is the core part of FFmpeg.wasm where we transpile C/C++ code of FFmpeg to JavaScript/WebAssembly code. It is still very experimental (and slow), but shows the possibilities of using FFmpeg purely in the browser.

If you have any issues for this repository, please put it here: https://github.com/ffmpegwasm/ffmpeg.wasm/issues

Setup

$ git clone https://github.com/ffmpegwasm/ffmpeg.wasm-core
$ git submodule update --init --recursive

Build

  1. Use docker (easy way)

Install latest docker and run build-with-docker.sh.

$ bash build-with-docker.sh
  1. Install emsdk (unstable way)

Setup the emsdk from HERE and run build.sh.

$ bash build.sh

If nothing goes wrong, you can find JavaScript files in wasm/packages/core/dist.

Test

Once the build completes, you can test with following scripts:

$ cd wasm
$ npm install
$ npm test

Configuration

Base

Library/Tool NameVersionRemark
Emscripten3.1.30
FFmpeg4.3.1

Video

Library/Tool NameVersionRemark
x2640.160.xmp4 format
x2653.4mp4 format, only works with -pix_fmt yuv420p10le and -pix_fmt yuv420p12le
libvpx1.9.0webm format
theora1.1.1ogv format
aom1.0.0mkv format, extremely slow (takes over 120s for 1s video), not recommended to use

Audio

Library/Tool NameVersionRemark
wavpack5.3.0wav/wv format
lame3.100mp3 format
fdk-aac2.0.1aac format
ogg1.3.4required by vorbis
vorbis1.3.6ogg format
opus1.3.1opus format

Image

Library/Tool NameVersionRemark
libwebp1.1.0webp format

Others

Library/Tool NameVersionRemark
freetype22.10.4font file support
fribidi1.0.10Arabic and Hebrew alphabets support
harfbuzz2.7.4text shaping engine
libass0.15.0SSA/ASS subtitles rendering library