Skip to content

Record canvas frames to ffmpeg.wasm and export a video file, all in the browser.

License

Notifications You must be signed in to change notification settings

kig/canvas-ffmpeg

Repository files navigation

canvas-ffmpeg

Record canvas frames to ffmpeg.wasm and export a video file, all in the browser.

Uses ffmpeg.wasm for the heavy lifting, huge props to the devs there.

Usage

# If you already have serve, this is all you need:
serve

# Otherwise:
# Install dependencies
yarn

# Run server
yarn start

Open http://localhost:5000/ for a demo page that records a 10-second video of a 2048x2048 canvas animation.

See index.html for the source.

Requirements

As a result of the ffmpeg.wasm dependency, the requirements are the same as well: WebAssembly Threads and SharedArrayBuffers.

Because the SharedArrayBuffer requirement, the page needs to be served with cross-origin isolation headers. The serve.json config file adds those here.

About

Record canvas frames to ffmpeg.wasm and export a video file, all in the browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages