Skip to main content

Decode · Draw · Export

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.

12 min readEngineering
Decode · Draw · Exportazelify
Engineering

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.

  1. 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.
  2. Compose. Draw each output frame: the video layers, text, images, transitions and effects, in the right order and position for that moment in time.
  3. 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.
  4. Encode and export. Compress the composed frames and the mixed audio and write a finished file, usually an MP4.
Fig. 01
The four jobs of a web video editor, and the kind of library that does each.Reading and decoding uses WebCodecs with a demuxer such as Mediabunny or mp4box.js, or a WebAssembly build of FFmpeg. Composing uses Canvas 2D, WebGL or WebGPU, directly or through a renderer such as PixiJS. Editing is mostly application code, sometimes with a timeline component. Encoding uses WebCodecs with a muxer, or FFmpeg in WebAssembly.
Read and decodeWebCodecs + demuxer, or FFmpeg in Wasm
ComposeCanvas, WebGL, WebGPU
EditYour timeline and handles
Encode and exportWebCodecs + muxer, or FFmpeg in Wasm
  1. 01 → Read and decodeWebCodecs + demuxer, or FFmpeg in Wasm
  2. 02 → ComposeCanvas, WebGL, WebGPU
  3. 03 → EditYour timeline and handles
  4. 04 → Encode and exportWebCodecs + muxer, or FFmpeg in Wasm
The four jobs of a web video editor, and the kind of library that does each.

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.

LibraryJobLicenceLatest npm releaseNotes
WebCodecs (browser API)Decode, encodeWeb standardShips with the browserNo containers; needs a demuxer and muxer
MediabunnyRead, write, convert filesMPL-2.02026-11-26Containers around WebCodecs; supersedes mp4-muxer and webm-muxer
mp4box.jsRead MP4BSD-3-Clause2026-11-20MP4 parsing and segmenting only
ffmpeg.wasmDecode, encode, convertWrapper MIT; core GPL-2.0-or-later2025-01-07Widest format support; about 32 MB .wasm; slower
libav.jsDecode, demux, filterLGPL-2.12026-11-16FFmpeg's libraries as a library API
PixiJSComposeMIT2026-11-11WebGL and WebGPU 2D renderer
KonvaCompose, on-canvas editingMIT2026-11-23Draggable, transformable canvas objects
Fabric.jsCompose, on-canvas editingMIT2026-05-18Canvas object model with selection
twgl.jsWebGL helperMIT2025-07-16Thin layer over WebGL
Motion CanvasProgrammatic animationMIT2024-12-14Code-first animation with a preview editor
RemotionProgrammatic videoSource-available2026-11-24Free tier by organisation size; company licence otherwise
etroVideo frameworkGPL-3.02026-08-12Layers and effects in JavaScript
react-timeline-editorTimeline UIMIT2026-01-25React timeline component
wavesurfer.jsAudio waveformsBSD-3-Clause2026-11-24Waveforms, 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]
Fig. 02
A first check of a library's licence before it goes into a closed-source product. Not legal advice.If the licence is MIT, BSD or similar, keep the notices. If it is MPL-2.0, make the library's source, with any changes, available. If it is LGPL or GPL, check how the code is linked and distributed with a lawyer before shipping. Anything else, such as a source-available licence, AGPL or no licence at all, needs its terms read before shipping.yesnoyesnoyesno
Is the licence permissive (MIT, BSD, Apache)?
Generally fine; keep the notices
Is it MPL-2.0 (file-level copyleft)?
Make the library's source, with your changes, available
Is it LGPL or GPL?
Check linking and distribution with a lawyer first
Anything else (source-available, AGPL, no licence): read the terms
  1. Is the licence permissive (MIT, BSD, Apache)?
    1. yes → Generally fine; keep the notices
    2. no → Is it MPL-2.0 (file-level copyleft)?
      1. yes → Make the library's source, with your changes, available
      2. no → Is it LGPL or GPL?
        1. yes → Check linking and distribution with a lawyer first
        2. no → Anything else (source-available, AGPL, no licence): read the terms
A first check of a library's licence before it goes into a closed-source product. Not legal advice.

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.

Fig. 03
Choosing the codec layer for a web video editor.If the files you need to open are ones the browser decodes, use WebCodecs with a container library such as Mediabunny. If you also need formats the browser cannot decode, add ffmpeg.wasm or libav.js as an on-demand fallback for those files, and check the licence of the build you ship. If you only record the screen or camera, MediaRecorder may be enough.yesyesnono
Do you edit existing files, rather than only record new ones?
Are all the formats you need ones the browser decodes?
WebCodecs plus a container library such as Mediabunny
Add ffmpeg.wasm or libav.js on demand; check its licence
MediaRecorder may be enough for recording
  1. Do you edit existing files, rather than only record new ones?
    1. yes → Are all the formats you need ones the browser decodes?
      1. yes → WebCodecs plus a container library such as Mediabunny
      2. no → Add ffmpeg.wasm or libav.js on demand; check its licence
    2. no → MediaRecorder may be enough for recording
Choosing the codec layer for a web video editor.

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

  1. MDN Web Docs, WebCodecs API, including browser compatibility, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2] ↩[3]

  2. W3C, WebCodecs specification, www.w3.org (opens in a new tab) (accessed 2026-11-26). ↩

  3. 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]

  4. mp4-muxer repository, github.com (opens in a new tab); npm entry marks the package deprecated in favour of Mediabunny (accessed 2026-11-26). ↩

  5. 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). ↩

  6. ffmpeg.wasm repository, github.com (opens in a new tab) (accessed 2026-11-26). ↩ ↩[2]

  7. 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]

  8. MDN Web Docs, SharedArrayBuffer, security requirements and cross-origin isolation, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩

  9. 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]

  10. MDN Web Docs, WebGL API, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩

  11. MDN Web Docs, WebGPU API, developer.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩

  12. twgl.js repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2025-07-16 (accessed 2026-11-26). ↩

  13. PixiJS repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2026-11-11 (accessed 2026-11-26). ↩

  14. Konva repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2026-11-23 (accessed 2026-11-26). ↩

  15. Fabric.js repository, github.com (opens in a new tab); npm entry: licence MIT, latest release published 2026-05-18 (accessed 2026-11-26). ↩

  16. 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). ↩

  17. 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]

  18. 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). ↩

  19. 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). ↩

  20. 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). ↩

  21. Mozilla, MPL 2.0 FAQ, www.mozilla.org (opens in a new tab) (accessed 2026-11-26). ↩

  22. 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 tools

Keep reading

More in Browser video editor

All guides