Which licence is your ffmpeg.wasm? A 2-minute check, and an LGPL build for audio apps
I'm Dodly Forbi, an electrical engineering student in Germany. On the side I build WeConvertIt, a set of free file tools that run entirely in your browser, which mostly means my laptop fan has strong opinions about WebAssembly.
Nothing gets uploaded. Your audio, PDFs and photos stay on your device, and that's the whole point of the site. A lot of that runs on FFmpeg, compiled to WebAssembly. Like most people, I got it from npm through the ffmpeg.wasm project. The package said MIT, so I didn't think about it twice.
Then, while planning a new audio editor, I audited every dependency the site ships. One result stopped me. The FFmpeg core I'd been serving to every visitor contains this sentence, printed by the binary itself when you ask for its licence:
This version of ffmpeg has nonfree parts compiled in. Therefore it is not legally redistributable.
That's not something you want to find in a file you've been handing out to strangers for months. It's a bit like learning that the cake you've been serving at every party had a "not for resale" sticker on the bottom the whole time.
So I dug in, fixed it, and published the fix. This post is what I learned, how you can check your own build in two minutes, and the LGPL build I now use in production. I'm an electrical engineer in training, not a lawyer, and nothing here is legal advice. It's simply what the binaries say about themselves when you ask them nicely.
What's actually inside the packages
FFmpeg records how it was built inside the binary. So you don't have to trust labels; you can ask the file. I checked the published npm packages on 22 November 2026:
| Package | npm "license" field | Build flags that decide the licence | What the binary says (-L) |
|---|---|---|---|
@ffmpeg/core / @ffmpeg/core-st 0.11.x |
MIT | --enable-gpl --enable-nonfree --enable-libfdk-aac, plus x264 and x265 |
nonfree, "not legally redistributable" |
@ffmpeg/core / @ffmpeg/core-mt 0.12.10 |
GPL-2.0-or-later | --enable-gpl --enable-libx264 --enable-libx265 |
GPL version 2 or later |
To be fair to the maintainers: the current 0.12 packages are honestly labelled. Someone reported the wrong field in issue #685, it was fixed in PR #686, and the GPL label has been on npm since 0.12.8. The project's FAQ also says the core follows "the same licenses as FFmpeg and its external libraries", which is correct.
What's still easy to miss:
- The older 0.11.x cores are still on npm, still labelled MIT, and they're the non-free ones. I was using
@ffmpeg/core-st0.11.1, the single-threaded build, because it works without special server headers. I doubt I'm the only one. - The repository's README badge says MIT. That's true for the JavaScript wrapper,
@ffmpeg/ffmpeg. It isn't true for the core, which is the part that does the work. - The npm tarballs don't include a licence file or a way to get the corresponding source. Issue #902, opened in September 2025, asks about exactly this and hasn't had a reply yet.
Why it matters
FFmpeg's own configure --help explains the two flags better than I can:
--enable-gplallow use of GPL code, the resulting libs and binaries will be under GPL [no]--enable-nonfreeallow use of nonfree code, the resulting libs and binaries will be unredistributable [no]
So a GPL build is fine if your project can live with the GPL. Plenty of projects can't, especially closed-source web apps. And a non-free build isn't fine for anyone who serves it to the public, because serving a file to a browser is distributing it.
FFmpeg's legal page puts it first in its checklist: "Compile FFmpeg without "--enable-gpl" and without "--enable-nonfree"."
The irony for me was that I only do audio. I never needed x264 or x265, which are video encoders. They were in my build because the prebuilt core is made for video, and they're what pulled the whole thing into the GPL. I was basically carrying a full film studio around just to cut ringtones.
Check your own build in two minutes
Option 1: read the build line straight out of the .wasm. I wrote a small script with no dependencies for this. It works on single- and multi-threaded cores from any source:
node tools/check-licence.mjs node_modules/@ffmpeg/core/dist/umd/ffmpeg-core.wasm
flags of interest: --enable-gpl --enable-libx264 --enable-libx265
licence FFmpeg's configure assigns to this configuration: GPL version 2 or later
It exits with 0 for an LGPL build, 1 if it finds --enable-gpl or --enable-nonfree, and 2 if it can't find a build line at all, so you can drop it into CI.
Option 2: no Node at hand?
strings ffmpeg-core.wasm | grep -- --target-os
Then read the line yourself and look for --enable-gpl and --enable-nonfree.
Option 3: ask the binary. With the ffmpeg.wasm 0.12 API:
ffmpeg.on('log', ({ message }) => console.log(message));
await ffmpeg.exec(['-L']);
Building an LGPL core for audio
I wanted three things: no GPL and no non-free parts, everything a normal audio tool needs, and a build anyone can check without taking my word for it.
What's in it. FFmpeg 5.1.10, unmodified, built with Emscripten 3.1.40. For formats FFmpeg can't encode on its own, I added LAME 3.100 for MP3 and libvorbis 1.3.7 with libogg 1.3.6 for Vorbis. AAC, FLAC, Opus, ALAC and WAV use FFmpeg's own encoders. Everything is LGPL or more permissive.
Why 5.1 and not something newer. It's the newest FFmpeg series whose command-line tool still builds without threads. From 6.0 on, it needs threads, and threads in the browser mean SharedArrayBuffer and special cross-origin headers on your whole site. Single-threaded keeps it a drop-in file.
What I gave up. x264, x265 and fdk-aac. For audio that cost nothing. If I ever need video encoding, browsers now have their own hardware encoders through WebCodecs, which avoids the GPL question entirely.
Making it reproducible. Every source tarball is pinned by its SHA-256 checksum. The Docker image with the compiler is pinned by its digest. The build fixes the timestamp, time zone and locale, so nothing about my machine leaks into the result. Then I rebuilt it from scratch twice: once on my own PC, and once on GitHub's servers through CI. Both times the output was byte-for-byte identical to the published files. Two computers agreeing down to the last byte is the least dramatic result possible, which is exactly what you want from a build.
The CI also fails if --enable-gpl or --enable-nonfree ever appears, or if -L stops reporting the LGPL. So the licence can't quietly drift back.
How it went in production
I swapped it into every audio tool on the site in early November. A few things I measured along the way:
- The core went from 24.4 MB to 16.7 MB, because the video codecs are gone. Visitors download less on their first visit.
- I ran 170 conversion jobs through the old and new core side by side, in Chrome and Firefox. All 170 worked on both.
- AAC got better. FFmpeg 5 switched its default AAC encoding method, so quality went up by 2 to 3.5 dB. The trade-off is that it's about half a second slower per minute of audio, which I'm happy with.
- WMA files stopped getting about 46 ms of silence added at the start, a quirk of the old core. The new one matches desktop FFmpeg exactly.
The same audit turned up one more case: a HEIC image decoder I used had LGPL-3.0 code bundled inside its JavaScript, with no way to get the matching source. I replaced it with my own reproducible build too. That's a story for another post, but if you ship heic2any, it's worth a look.
Use it, or check mine
Everything is on GitHub: github.com/Eden-Gomez/ffmpeg-wasm-lgpl. That includes the build files, the exact source tarballs, the licence checker, the CI that proves the build, and the Web Worker my site uses in production.
The core is a plain Emscripten module. If you want a different build later, you can swap the core file without touching your code. One tip: in Node, pass -nostdin, or FFmpeg will politely wait for you to press a key. Forever.
Thanks
None of this exists without ffmpeg.wasm. It's what made FFmpeg in the browser practical, and my build stands on years of their work. If the maintainers find something in this post that's wrong or unfair, I'll correct it. And if you find a mistake in my build, open an issue. I'd much rather hear it from you than from a lawyer.
Dodly Forbi, November 2026
Comments
No comments yet. Start the discussion.