Browser video encoders, tested against WebAssembly
We measured the browser's own H.264, VP9 and AV1 encoders against x264 compiled to WebAssembly: the file size each needs for the same picture, and how fast each runs.
Did you know your browser can encode video too? It can, through an interface called WebCodecs. A page can also download a codec compiled to WebAssembly, such as x264, the encoder behind many desktop tools. We encoded the same clips both ways, 693 times, and scored every file against its original. In short: x264 at its careful presets matches the browser's H.264 picture in about half the bytes, but it is far slower and its license doesn't fit Edit Videos, so we encode with your browser instead. The browser's own AV1 gets most of that saving with nothing to download.
What we wanted to know
Edit Videos cuts and joins videos inside your browser, so every export is encoded on your own device. Quality, waiting time and final file size then depend on one choice: which encoder does the work. The browser ships its own, and nearly any codec can be compiled to WebAssembly and loaded by a page like ours.
We wanted to know many things, but we focused on three areas. Does a WebAssembly encoder give a better picture at the same file size, or the same picture in a smaller file? How much slower is it? And would it be worth carrying for browsers that cannot encode video on their own? This page reports what we found, with the tables, the method and the limits, so you can judge the numbers yourself.
How we measured
The test page ran in headless Chrome 145 on Linux, on an AMD Ryzen 7 9800X3D with 16 threads. Through WebCodecs it encoded each clip as H.264, VP9 and AV1. Through ffmpeg.wasm 0.12.10 it encoded the same clip with x264 at three presets, ultrafast, veryfast and medium, once on a single thread and once threaded. Every encoder was asked for 1200, 2500, 5000, 10000 kbps, with a key frame every two seconds.
The clips were four standard test sequences from Xiph's collection, picked because they are hard to compress: crowd_run, a marathon start with thousands of moving heads; park_joy, people running past trees; ducks_take_off, water spraying as birds lift off; and Johnny, a man talking to the camera. We added two of our own, a screen recording and a short portrait clip from a phone. Each was cut to a reference of about ten seconds and measured at 1080p, 720p and 480p where it had them.
Each file was scored against its reference with VMAF, Netflix's model of how people rate picture quality, using its default vmaf_v0.6.1 model, plus PSNR and SSIM. Scores at one bitrate say little on their own, so we turned them around. For each bitrate the browser's H.264 produced, we found the bitrate at which the other encoder reached the same VMAF, interpolating between its two nearest measured points and never past them. That bitrate, as a share of H.264's, is what the first table shows.
In all, 693 encodes from 6 runs were recorded, each with the browser and core versions, so an update would start a new line instead of blending in. The harness is our script measure-quality.ts, which is not public. Everything it drives is, though: Chrome 145's WebCodecs, ffmpeg.wasm 0.12.10, Xiph's clips and the VMAF filter in a recent ffmpeg.
Quality at the same file size
The table below shows how much bitrate each encoder needed to give the same VMAF as the browser's H.264, as a share of H.264's own. Under 100% means a smaller file for the same picture. A range spans the bitrates where both encoders reached that score, and a dash means their scores did not overlap at any bitrate we asked for.
| Clip and size | x264 medium | x264 veryfast | x264 ultrafast | Browser AV1 | Browser VP9 |
|---|---|---|---|---|---|
| crowd_run 1080p | 58–59% | 74–75% | 105–106% | 56% | 65% |
| park_joy 1080p | 40–41% | 52–53% | 90% | 47% | 50–53% |
| ducks_take_off 1080p | 42% | 47–48% | 89–90% | — | — |
| Phone clip, 1080p | 47–48% | 58–66% | 107–132% | 34–48% | 44–56% |
| Screen recording, 1080p | — | — | — | 72% | — |
| Johnny 720p | 24–29% | 47–55% | 53–110% | 43% | 44% |
| All clips at 480p | 32–53% | 24–70% | 35–203% | 31–77% | 29–86% |
x264 at medium is the clear winner: on most clips it matched the browser's picture at about half the bitrate, and on the talking head at about a quarter. Veryfast saved less, between a quarter and a half. Ultrafast, the preset people reach for when speed matters, saved a tenth at best on the 1080p clips, and on crowd_run and the phone clip it needed more than the browser.
The browser's own AV1 and VP9 come close without any WebAssembly. AV1 needed about half to three quarters of H.264's bitrate, and VP9 a little more. On ducks_take_off neither crossed paths with H.264's scores, so that row has nothing to compare for them.
The screen recording behaved differently. Sharp text and flat colour are easy for x264, which scored higher at its lowest bitrate than the browser's H.264 did at any bitrate it produced, so there is no matching point and the x264 cells are dashes; only AV1 overlapped. One more finding: on the hardest 1080p footage the browser's H.264 ignored low targets. Asked for the lowest bitrate on crowd_run, it made a file more than five times that size.
Speed
The second table is the mean number of frames each encoder produced per second, over every encode of the Xiph clips at each picture size. These numbers belong to one fast desktop. On a laptop or a phone every row would be slower, and the browser may use a hardware encoder that this machine did not offer.
| Encoder | 1080p | 720p | 480p |
|---|---|---|---|
| Browser H.264 | 276 | 586 | 765 |
| Browser VP9 | 154 | 258 | 308 |
| Browser AV1 | 101 | 194 | 229 |
| x264 ultrafast | 36 | 75 | 137 |
| x264 ultrafast, threaded | 153 | 257 | 418 |
| x264 veryfast | 11 | 23 | 43 |
| x264 medium | 3.7 | 7.3 | 13 |
| x264 medium, threaded | 18 | 35 | 60 |
The browser's H.264 ran 13–17 times faster than x264 at medium even with all 16 threads, and 59–80 times faster than x264 medium on one thread. For a one-minute 1080p video at 30 frames a second, that is about 6.5 seconds in the browser, 100 seconds for threaded x264 medium, and around 8 minutes on a single thread.
Threading has its own trouble. Threaded veryfast crashed in every case with an error inside the WebAssembly core, which is why it has no row. And the browser's AV1 still ran 4–6 times faster than threaded x264 medium while giving a saving not far behind it, which is most of the answer to the next question.
The license question
Speed alone would not settle it, but x264 is published under the GPL, a license that reaches into the code shipped alongside it. The H.264 patent pool also applies to an encoder whatever license its code carries. Edit Videos keeps a simple rule: any codec it ships itself must be royalty-free.
H.264 therefore stays with the browser, whose maker already handles the licensing, and x264 is used only as a yardstick on our own machines. AV1 is royalty-free, but the WebAssembly build we tested has no AV1 encoder inside, so that pairing went unmeasured. For browsers that encode AV1 themselves, it would add nothing.
Why the editor uses the browser's encoders
Put together, the numbers point one way. The browser's encoders start at once, with no codec to download before the first frame. They are many times faster, so a long export is a wait of seconds rather than minutes. And they cost no license, because the browser brings its own.
The price is file size: x264 medium would make an H.264 file about half as big at the same picture. Edit Videos wins most of that back another way. Where the browser can encode AV1, the editor offers it next to H.264, so a smaller file is one switch away when the place it goes plays AV1.
We also checked whether visitors would need a WebAssembly encoder because their browser has no WebCodecs at all. Over the 30 days before the test, every browser that opened the editor had it, and none was turned away. A fallback would have served nobody, so Edit Videos uses WebCodecs alone.
When to pick AV1
H.264 is the default because almost everything plays it: old phones, smart TVs, editing programs, any chat or upload form. AV1 is newer. Recent browsers and Discord play it, but an older device may show a black frame or refuse the file.
So the question is where the file goes next. For a clip you post in a chat whose app you know, or a file you will open on your own computer, AV1 keeps more of the picture in the same megabytes. For a file you send to someone whose phone you have never seen, or hand to another program, H.264 is the safe one. The switch shows only where your browser can encode AV1, with a tip on where each format plays.
What this does not show
This was one machine: a fast desktop processor and Chrome on Linux, using whichever H.264 encoder Chrome picked there. A phone or a laptop with a hardware encoder trades quality for speed in its own way, and its numbers may differ from ours in either direction.
VMAF is one model of what people see. It is widely used and tracks viewers' ratings well, but it is not a panel of people watching. PSNR and SSIM are in the raw data too; the tables use VMAF alone.
Every clip started as raw frames, so the test says nothing about re-encoding a video that was already compressed, such as an HEVC file from an iPhone. The clips are short, about ten seconds each. A new measurement replaces the tables and the dates at the top of this page.
What to know
- x264 at its medium preset matched the browser's H.264 picture at about half the bitrate on most of the clips we tried.
- Even with all 16 threads, x264 medium ran 13–17 times slower than the browser's H.264.
- The browser's own AV1 needed about half to three quarters of H.264's bitrate, with nothing to download.
- x264's fastest preset, ultrafast, saved a tenth at best over the browser's H.264, and on some clips needed more.
Questions
Is WebAssembly video encoding slower than the browser's?
Yes, by a wide margin on our machine. The browser's encoders run as native code, while a WebAssembly encoder runs inside the page's sandbox, and x264 at a space-saving preset was 13–17 times slower even threaded.
Why not ship x264 for smaller files?
It is licensed under the GPL, H.264 itself carries patent royalties, and the wait would grow from seconds to minutes. AV1 from the browser saves most of the same space without either cost.
Does Edit Videos export AV1?
Yes, where your browser can encode it. The Format switch by the Export video button offers AV1 next to H.264. H.264 stays the default because it plays almost everywhere.
Can I repeat the test?
Yes, with public parts: WebCodecs in Chrome, ffmpeg.wasm 0.12.10, Xiph's test clips and ffmpeg built with VMAF. Encode each clip at the bitrates above, score each file against its source, then compare the bitrates that reach the same score.
Will my phone give the same numbers?
Not the same ones. A phone is slower than our desktop and may encode with dedicated hardware, which changes both speed and quality. The largest gaps, such as how slow x264 is, are the part most likely to hold.
More guides
Here at Edit Videos we tested what happens when you set the final size you want and the codec (H.264, AV1…), and measured it many times: how close each lands to the size you asked for, where our predictions fail, and how much video fits in 10 or 20 MB, in duration, for each codec.
We sent 17 short videos and animations from phones to both WhatsApp and Discord on November 9, 2026: which played in the conversation, which kept their sound, and what changed since October.
Cut a video down to the part you want, entirely in your browser. No upload, no install.