JavaScript video editor libraries compared: WebAssembly, WebCodecs and SDKs
The open-source building blocks of a web video editor compared by job: WebCodecs, Mediabunny, ffmpeg.wasm, renderers and timelines, with their licences.
JavaScript video editor libraries compared: WebAssembly, WebCodecs and SDKs
Key takeaways
- A web video editor does four jobs (decode, compose, edit, export), and most libraries cover only one or two of them.
- For most projects, WebCodecs plus a container library such as Mediabunny handles media, with ffmpeg.wasm as a fallback for odd formats.
- The ffmpeg.wasm wrapper is MIT, but its core packages are GPL-2.0-or-later: check the licence of what you actually ship.
- Timelines are usually custom code around your own data model; borrow components for waveforms and prototypes.
A web video editor does four separate jobs (reading and decoding media, drawing frames, letting people edit on a timeline, and encoding the result), and we found no single open-source library that covers all of them; each covers one or two. Our take, for most new projects: the browser's WebCodecs API plus a container library such as Mediabunny for reading and writing files, Canvas or WebGL for drawing, a timeline you build yourself around your own data model, and ffmpeg.wasm or libav.js only for the formats the browser can't decode. This guide compares the main libraries by job, with each one's licence and latest release taken from its own repository or npm entry, and ends with a recommendation per use case.
The four jobs a web video editor does#
Before comparing libraries it helps to name the jobs, because most confusion comes from comparing tools that do different ones. The series' architecture overview covers the whole system; here is the short version.
- Read and decode. Open a file, find its tracks (demuxing), and turn compressed video and audio into raw frames and samples you can draw and play. The container work and the codec work are separate steps, often done by separate libraries.
- Compose. Draw each output frame: the video layers, text, images, transitions and effects, in the right order and position for that moment in time.
- Edit. The timeline, the selection, the handles you drag on the canvas, undo and redo. This is mostly your own application code, built on your own timeline data model.
- Encode and export. Compress the composed frames and the mixed audio and write a finished file, usually an MP4.
- 01 → Read and decodeWebCodecs + demuxer, or FFmpeg in Wasm
- 02 → ComposeCanvas, WebGL, WebGPU
- 03 → EditYour timeline and handles
- 04 → Encode and exportWebCodecs + muxer, or FFmpeg in Wasm
The rest of this guide takes the jobs in that order.
Codec layer: WebCodecs, Mediabunny, ffmpeg.wasm and libav.js#
WebCodecs, the browser's own codecs#
WebCodecs is a browser API, not a library: it gives JavaScript direct access to the browser's video and audio decoders and encoders, frame by frame.[1][2] Because the codecs are the browser's own, they're fast, often hardware-accelerated, and add nothing to your bundle. What WebCodecs doesn't do is read or write files. It takes compressed chunks in and gives frames out (or the reverse), so you need a separate demuxer to pull chunks out of an MP4 or WebM, and a muxer to pack encoded chunks into a file. Browser support and the codecs each browser can encode differ, so check MDN's compatibility data for your target browsers.[1] The series part on decoding frames with WebCodecs shows the API in use.
Mediabunny: reading and writing files around WebCodecs#
Mediabunny describes itself as a pure TypeScript media toolkit for reading, writing and converting media files in the browser.[3] It handles the container side (MP4, MOV, WebM, MKV and others) and uses WebCodecs for the codec side, so together they cover reading and decoding as well as encoding and writing. It's licensed under MPL-2.0. Its author's earlier libraries, mp4-muxer and webm-muxer, are now marked deprecated on npm with a note that Mediabunny supersedes them.[4]
mp4box.js: a focused MP4 parser#
mp4box.js is the JavaScript version of GPAC's MP4Box tool: it parses MP4 files, extracts samples and can segment them.[5] It's BSD-3-Clause licensed and widely used as the demuxer in WebCodecs examples. It does MP4 only; for other containers you need something else.
ffmpeg.wasm: FFmpeg in a tab#
ffmpeg.wasm is FFmpeg compiled to WebAssembly, with a JavaScript wrapper that runs FFmpeg commands inside the browser.[6] It reads and writes almost any format FFmpeg supports, including containers and codecs the browser has no decoder for, which makes it the fallback for files WebCodecs can't open. The costs are size and speed. The single-threaded core's WebAssembly file is about 32 MB, and software codecs in WebAssembly are slower than the browser's native ones.[7] The multi-threaded core uses SharedArrayBuffer, which browsers only make available to cross-origin-isolated pages, so your site needs the matching headers.[8] Licensing differs by package: the wrapper (@ffmpeg/ffmpeg) is MIT, while the core packages are GPL-2.0-or-later, per their npm entries.[7] The series part comparing ffmpeg.wasm, WebCodecs and MediaRecorder goes deeper on that trade, including FFmpeg's own licence guidance.
libav.js: FFmpeg's libraries, lower level#
libav.js compiles FFmpeg's libraries (libavformat, libavcodec, libavfilter and others) to WebAssembly and exposes them as a library rather than as a command line.[9] That gives finer control (you can demux with it and decode with WebCodecs, for instance) at the cost of a lower-level API. Its npm entry lists LGPL-2.1, and the published package is large because it ships several builds with different codec sets.[9]
Composition: Canvas, WebGL and the renderers on top#
Every frame of your editor's preview and export is a picture you draw. The browser gives you three drawing surfaces, and a handful of libraries build on them.
Canvas 2D is the simplest. You can draw a decoded video frame, an image or text with a few calls, and transform each layer with translate, rotate and scale. It's enough for many editors, especially ones focused on cuts, text and simple overlays.
WebGL and WebGPU draw with the graphics card through shaders. They're the right tools for colour correction, blurs, keying, blend modes and anything that touches every pixel of every frame.[10][11] WebGL is the long-standing option; WebGPU is newer and more capable, with uneven support across browsers. Small helpers such as twgl.js (MIT) cut down WebGL's boilerplate without hiding it.[12] The series part on compositing with Canvas and WebGL shows both.
On top of those, three kinds of library are worth knowing:
- Renderers with a scene graph. PixiJS (MIT) is a fast 2D renderer over WebGL and WebGPU with sprites, containers, filters and text.[13] It suits editors that composite many layers with effects. Its npm package is large, but it's modular, so the size you ship depends on what you import.
- Canvas object models for editing. Konva (MIT) and Fabric.js (MIT) give you objects on a canvas that can be selected, dragged, resized and rotated, with events, which is exactly the on-canvas editing layer an editor needs.[14][15] They're built for interactive graphics rather than video timing, so you still drive what's on screen at each moment yourself. The series part on transform handles shows how to build the same thing by hand.
- Programmatic video frameworks. Motion Canvas (MIT) writes animations in TypeScript with an editor for previewing them; its latest npm release was in December 2024.[16] Remotion makes videos from React components and renders them to files.[17] It's source-available rather than open source: its licence lets individuals, for-profit organisations with up to three employees, non-profits and anyone evaluating it use it free, and requires a company licence for larger for-profit organisations.[17] etro is a JavaScript video-editing framework with layers and effects, licensed under GPL-3.0.[18] These frameworks are code-first: they're built for generating videos from code and data, not for an end user dragging clips on a timeline.
Timeline UI options#
The timeline is the part of an editor with the fewest ready-made options, and the one most tightly bound to your own code. A timeline view is a picture of your data model: tracks, clips with start and end times, and a playhead. Every drag changes that model, and the change has to go through your undo system. That's why most production editors build their own, as the series describes in the timeline data model and undo and redo.
There are still components that save time:
- @xzdarcy/react-timeline-editor (MIT) is a React timeline component with tracks, draggable and resizable actions, and a cursor.[19] It's a reasonable starting point for a prototype or a simple editor, and its data shape is easy to map to your own.
- wavesurfer.js (BSD-3-Clause) draws audio waveforms, with plugins for regions and a timeline ruler.[20] Waveforms are what make audio editable by eye, and it's fiddly to draw them well, so this is one piece worth borrowing even if you build the rest.
Whatever you use for the view, keep the data model yours. A component library that owns your clip positions makes undo, autosave and collaboration harder later.
Comparison table#
Licences and latest releases are from each project's npm entry, read on the date in the notes. Libraries change quickly; check the repository before you choose.
| Library | Job | Licence | Latest npm release | Notes |
|---|---|---|---|---|
| WebCodecs (browser API) | Decode, encode | Web standard | Ships with the browser | No containers; needs a demuxer and muxer |
| Mediabunny | Read, write, convert files | MPL-2.0 | 2026-11-26 | Containers around WebCodecs; supersedes mp4-muxer and webm-muxer |
| mp4box.js | Read MP4 | BSD-3-Clause | 2026-11-20 | MP4 parsing and segmenting only |
| ffmpeg.wasm | Decode, encode, convert | Wrapper MIT; core GPL-2.0-or-later | 2025-01-07 | Widest format support; about 32 MB .wasm; slower |
| libav.js | Decode, demux, filter | LGPL-2.1 | 2026-11-16 | FFmpeg's libraries as a library API |
| PixiJS | Compose | MIT | 2026-11-11 | WebGL and WebGPU 2D renderer |
| Konva | Compose, on-canvas editing | MIT | 2026-11-23 | Draggable, transformable canvas objects |
| Fabric.js | Compose, on-canvas editing | MIT | 2026-05-18 | Canvas object model with selection |
| twgl.js | WebGL helper | MIT | 2025-07-16 | Thin layer over WebGL |
| Motion Canvas | Programmatic animation | MIT | 2024-12-14 | Code-first animation with a preview editor |
| Remotion | Programmatic video | Source-available | 2026-11-24 | Free tier by organisation size; company licence otherwise |
| etro | Video framework | GPL-3.0 | 2026-08-12 | Layers and effects in JavaScript |
| react-timeline-editor | Timeline UI | MIT | 2026-01-25 | React timeline component |
| wavesurfer.js | Audio waveforms | BSD-3-Clause | 2026-11-24 | Waveforms, regions, timeline plugin |
Licences, in plain terms#
A library's licence decides what you owe when you ship it. This is a summary, not legal advice; read each licence, and ask a lawyer about your product.
- MIT and BSD are permissive: keep the copyright and licence notice, and you can use the code in closed-source products.
- MPL-2.0 is file-level copyleft. If you distribute the library's files, you must make their source available under the MPL, including any changes you made; your own separate files can stay under your licence.[21]
- LGPL lets non-LGPL software link to the library, with conditions on how it's linked and on letting users replace the library. GPL extends to the combined work you distribute, so GPL code generally can't be built into a closed-source product you distribute; ask a lawyer.[22] For FFmpeg builds, which parts are GPL depends on how they were configured, as the ffmpeg.wasm comparison explains.
- Source-available licences such as Remotion's let you read the code, but the terms of use are the vendor's own; check whether you qualify for the free tier.[17]
- Is the licence permissive (MIT, BSD, Apache)?
- yes → Generally fine; keep the notices
- no → Is it MPL-2.0 (file-level copyleft)?
- yes → Make the library's source, with your changes, available
- no → Is it LGPL or GPL?
- yes → Check linking and distribution with a lawyer first
- no → Anything else (source-available, AGPL, no licence): read the terms
Export: the same choice in reverse#
Exporting runs the codec layer backwards. Each composed frame goes to an encoder, the mixed audio goes to another, and a muxer packs the encoded chunks into a file. With WebCodecs, the VideoEncoder and AudioEncoder do the compression with the browser's own codecs, often in hardware, and a container library such as Mediabunny writes the MP4 or WebM around them.[1][3] With ffmpeg.wasm, you hand FFmpeg frames or an intermediate file and let its software encoders do the work, which is slower but reaches codecs the browser can't encode.[6]
Two things decide most export bugs, whichever library you use. First, timestamps: every frame and audio sample needs the right time, or the file plays at the wrong speed or drifts out of sync. Second, the frame source: the exported frame should be drawn by the same code that drew the preview, or the export won't match what the user saw. The series part on exporting an MP4 from the browser walks through both, with code.
If your editor only ever needs to capture a canvas as it plays, the browser's MediaRecorder can record it with no library at all, but it records in real time and gives you less control over quality and format.
Which to pick, by use case#
The right stack depends on what you're building. Our take on some common cases:
A single-purpose tool (trim, crop, convert, compress). WebCodecs plus Mediabunny. The browser's codecs do the heavy work, the container library reads and writes the files, and the bundle stays small. Add a Canvas 2D step if the tool changes the picture.
Accepting any file a user throws at it. Start with WebCodecs and a container library, and fall back to ffmpeg.wasm or libav.js only for the files the browser can't decode. Loading a roughly 32 MB WebAssembly file for every user to handle a rare AVI file is a poor trade; loading it on demand for that user is a reasonable one. Check the core package's licence before you ship it.[7]
An interactive editor with a timeline. WebCodecs and a container library for media, Canvas 2D or WebGL for the renderer, your own timeline and undo, and on-canvas handles either from Konva or Fabric.js or written yourself. The important rule, explained in the series' architecture overview, is that preview and export draw frames with the same code, so what people see is what they get.
Effects-heavy video. WebGL or WebGPU, directly or through PixiJS. Effects that touch every pixel need the graphics card.
Generating videos from data or templates. A programmatic framework: Motion Canvas for animation in TypeScript, Remotion for React (check its licence terms for your organisation), or etro if GPL suits your project.
Audio editing alongside video. The Web Audio API for mixing and playback, with wavesurfer.js for waveforms; the series part on the Web Audio API for video editors covers the mixing side.
- Do you edit existing files, rather than only record new ones?
- yes → Are all the formats you need ones the browser decodes?
- yes → WebCodecs plus a container library such as Mediabunny
- no → Add ffmpeg.wasm or libav.js on demand; check its licence
- no → MediaRecorder may be enough for recording
- yes → Are all the formats you need ones the browser decodes?
What to check before you depend on a library#
A library choice is a long-term dependency, and in video the cost of switching later is high, because media code reaches into import, preview and export at once. A few checks before you commit:
- Recent releases and an active issue tracker. The latest-release column above is a starting point. A library with no release for a long time may be finished and stable, or abandoned; the issue tracker usually tells you which.
- The formats you actually need. Test your users' real files, not just the samples in the README: phone HEVC, screen recordings in WebM, files with variable frame rates, files with no audio.
- Bundle size and loading. Large WebAssembly builds should load on demand. Measure what your users download on first visit.
- Browser support. WebCodecs, WebGPU and SharedArrayBuffer each have their own support story. Decide which browsers you support and test there.
- The licence of what you ship, not just the licence of the wrapper you import. The ffmpeg.wasm case, an MIT wrapper loading a GPL core, is the common trap.[7]
- Who decides the data model. Prefer libraries that work on your data over libraries that want to own it. Your project file outlives any one library, as the series' part on the project file argues.
FFmpeg, React, Remotion, WebGL, WebGPU, PixiJS, Konva, Fabric.js and the other project names here are trademarks of their owners. Azelify isn't affiliated with or endorsed by them.
Frequently asked questions#
What is the best JavaScript video editor library?#
There isn't one library for the whole job. For most projects, WebCodecs with a container library such as Mediabunny handles media, Canvas or WebGL draws frames, and the timeline is your own code. ffmpeg.wasm covers formats the browser can't decode.
Is ffmpeg.wasm free to use in a commercial product?#
The wrapper package is MIT-licensed, but the core packages are listed as GPL-2.0-or-later on npm. Read the licence of the core you ship and get legal advice for a closed-source product.
Can I build a video editor with WebAssembly only?#
You can, with ffmpeg.wasm or libav.js doing the decoding and encoding, but it's usually slower and heavier than using the browser's own codecs through WebCodecs. Many editors use WebAssembly only as a fallback.
Is Remotion open source?#
Its source code is public, but its licence is the vendor's own: free for individuals, small for-profit organisations and non-profits, with a company licence required for larger for-profit organisations.
Is there an open-source timeline component for a web video editor?#
Yes, for example react-timeline-editor (MIT) for React, and wavesurfer.js (BSD-3-Clause) for audio waveforms. Many editors still build their own timeline around their data model.
Sources
-
MDN Web Docs, WebCodecs API, including browser compatibility, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2] ↩[3]
-
W3C, WebCodecs specification, www.w3.org (opens in a new tab) (accessed 2026-11-26). ↩
-
Mediabunny repository, github.com (opens in a new tab); npm entry: licence MPL-2.0, latest release published 2026-11-26 (accessed 2026-11-26). ↩ ↩[2]
-
mp4-muxer repository, github.com (opens in a new tab); npm entry marks the package deprecated in favour of Mediabunny (accessed 2026-11-26). ↩
-
GPAC, mp4box.js repository, github.com (opens in a new tab); npm entry: licence BSD-3-Clause, latest release published 2026-11-20 (accessed 2026-11-26). ↩
-
ffmpeg.wasm repository, github.com (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2]
-
ffmpeg.wasm npm entries: @ffmpeg/ffmpeg licence MIT; @ffmpeg/core (single thread) and @ffmpeg/core-mt (multi thread) licence GPL-2.0-or-later, core about 65 MB unpacked on npm (two builds of a 32,232,419-byte .wasm file, per the package's file listing); latest releases 2025-01-07 (wrapper and core) and 2025-04-28 (core-mt). Repository github.com (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2] ↩[3] ↩[4]
-
MDN Web Docs, SharedArrayBuffer, security requirements and cross-origin isolation, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩
-
libav.js repository, github.com (opens in a new tab); npm entry: licence LGPL-2.1, latest release published 2026-11-16 (accessed 2026-11-26). ↩ ↩[2]
-
MDN Web Docs, WebGL API, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩
-
MDN Web Docs, WebGPU API, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩
-
twgl.js repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2025-07-16 (accessed 2026-11-26). ↩
-
PixiJS repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2026-11-11 (accessed 2026-11-26). ↩
-
Konva repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2026-11-23 (accessed 2026-11-26). ↩
-
Fabric.js repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2026-05-18 (accessed 2026-11-26). ↩
-
Motion Canvas repository, github.com (opens in a new tab); npm entry for @motion-canvas/core: licence MIT, latest release published 2024-12-14 (accessed 2026-11-26). ↩
-
Remotion, LICENSE.md in its source repository, free and company licence terms; npm entry lists the licence as "SEE LICENSE IN LICENSE.md", latest release published 2026-11-24; terms as read on 2026-11-26, and Remotion says they change in version 5.0 (accessed 2026-11-26). ↩ ↩[2] ↩[3]
-
etro repository, github.com (opens in a new tab); npm entry: licence GPL-3.0, latest release published 2026-08-12 (accessed 2026-11-26). ↩
-
react-timeline-editor repository, github.com (opens in a new tab); npm entry for @xzdarcy/react-timeline-editor: licence MIT, latest release published 2026-01-25 (accessed 2026-11-26). ↩
-
wavesurfer.js repository, github.com (opens in a new tab); npm entry: licence BSD-3-Clause, latest release published 2026-11-24 (accessed 2026-11-26). ↩
-
Mozilla, MPL 2.0 FAQ, www.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩
-
Free Software Foundation, Frequently Asked Questions about the GNU Licenses, www.gnu.org (opens in a new tab) (accessed 2026-11-26). ↩
See these pieces running
Free tools that decode, edit and encode video inside your browser tab, without uploading the file.
Try the free toolsKeep reading
How to build a video editor in the browser: the complete architecture
A plain-language map of a browser video editor: the project file, timeline, decoding, compositing, audio and export, and how each piece connects.
FFmpeg.wasm vs WebCodecs vs MediaRecorder: choosing a browser video stack
Compare FFmpeg.wasm, WebCodecs and MediaRecorder for browser video: speed, codec support, file size, frame accuracy and which one to choose for an editor.
More in Browser video editor
Designing the project file for a web video editor: schema, versions and autosave
Design the JSON document behind a web video editor: what a project stores, how to version and migrate it, and how to autosave without losing work.
Undo and redo in a web editor: the command pattern, explained from zero
Implement undo and redo for a browser editor with the command pattern: commands, history stacks, grouping a drag into one step, and common traps.
How a video editor timeline works: tracks, clips, trims and overlaps
Learn the data model behind a non-linear video timeline: tracks, clips, in and out points, trims, ripple edits and how overlapping clips are resolved.