Free Video Compression for Everyone.

Category: basic knowledge (Page 1 of 4)

Making FFmpeg Faster in the Browser: Our WebAssembly SIMD Experiment

A minute of 1080p video took 39.83 seconds to encode with the production-reference WebAssembly core captured for this experiment. A new SIMD candidate finished the same job in 21.08 seconds, using the same codec, preset, target bitrate and encoder thread count.

That result came from a local experiment on one Apple M2. It measures FFmpeg execution after the core has loaded, rather than the complete wait from opening a website to downloading a file. Here is what we changed, how we checked the output, and where the evidence stops.

The short answer

Our final candidate reduced encoding time by 44–48% across three test clips. It keeps software H.264 encoding inside the browser. The work changes repeated calculations in x264, the encoder used by FFmpeg, while preserving the compression settings used in the comparison.

Encoding-time comparison on one Apple M2: production reference versus SIMD candidate, 7.10 versus 3.71 seconds for 720p, 39.83 versus 21.08 seconds for 1080p, and 8.86 versus 4.97 seconds for 4K.
Same-session FFmpeg execution time on one Apple M2. Core loading and result readback are excluded. These are three fixtures, not a prediction for every video or device.

All 16 outputs in the final validation met their size targets. The largest absolute difference in mean VMAF from the production reference was 0.094 points. That supports a useful speed improvement on these samples; it does not establish identical output under every threading configuration.

Why a SIMD-enabled build still had room to improve

SIMD stands for “single instruction, multiple data.” Instead of asking the CPU to do the same calculation separately for one pixel after another, an instruction operates on several values together. A 128-bit vector can hold sixteen 8-bit pixels, although each algorithm needs its own arrangement of loads, arithmetic and reductions.

Our existing core already supported WebAssembly SIMD. The opportunity was in the code paths doing the work. A build flag alone does not guarantee that every hot loop uses efficient vector instructions. Native assembly also cannot simply be carried into a browser build unchanged. Emscripten’s SIMD documentation describes both automatic vectorization and explicit intrinsics, along with the limits of porting native code.

We used explicit WebAssembly SIMD intrinsics for selected 8-bit x264 routines. Multithreading continued to distribute work across threads; SIMD reduced the calculations each thread needed to perform.

First, find the calculations that matter

We built a core with function names so CPU profiles could identify encoding routines instead of anonymous WebAssembly functions. In two initial profiles, reference-block interpolation and an 8×4 SATD routine together accounted for about 36–42% of samples after idle and thread-wait leaves were excluded.

Interpolation helps predict a picture from reference frames when movement falls between whole pixels. SATD scores differences between a predicted block and the actual image. Both repeat across many blocks, frames and candidate predictions.

Those percentages rank optimization targets. They are not percentages of elapsed encoding time: multiple workers can execute or wait simultaneously. We used separate, unprofiled runs to measure how long a whole encode took.

What we changed in x264

The first candidate vectorized rounded pixel averaging and the 8×4 SATD calculation. Later rounds extended that work to block SAD comparisons, chroma interpolation, quantization, and pixel sums and sums of squares. SAD is another block-difference score; quantization is part of turning transformed image information into encodable coefficients.

We also reused pixel loads across several candidate comparisons and selected common interpolation widths outside the inner loop. The aim was to preserve the integer arithmetic, including rounding, while doing less repeated work.

Independent scalar checks exercised the vector routines. We then encoded complete clips, because a faster helper is valuable only if it improves the full job. Some intermediate changes helped one clip while slowing another, which is why the final comparison uses the selected cumulative candidate rather than multiplying individual speedups.

What the benchmark measured

The experiment used FFmpeg 5.1.4, x264 core 164 and an Emscripten 4.0.22 build. Browser runs used local HTTP with cross-origin isolation and WORKERFS input. We compared the same fixtures with software libx264, the faster preset, 12 encoder threads, matched target-rate arguments and copied audio.

The production-reference JS and WASM were downloaded and checked against the original application checkout before testing. An earlier round also included a rebuilt, unpatched control to help separate patch effects from rebuilding the core.

FixtureObserved result
720p · 20 secondsProduction reference: 7.10 s
SIMD candidate: 3.71 s
Time reduction: 47.7%
1080p · 60 secondsProduction reference: 39.83 s
SIMD candidate: 21.08 s
Time reduction: 47.1%
4K · 3 secondsProduction reference: 8.86 s
SIMD candidate: 4.97 s
Time reduction: 44.0%

The candidate’s 720p and 4K times are medians of two trials. Their production-reference times, and both 1080p entries, are single trials. All were measured on the same M2 in the final comparison session. Machine load changed absolute times between sessions, so we do not mix earlier measurements into this table.

For the 1080p clip, the saving was 18.75 seconds: about 47% less execution time, or 1.89× the encoding throughput. “47% less time” and “47% faster” are different calculations. Neither describes cold-start loading, file selection or downloading the finished result.

Checking size, picture quality and equivalence

Candidate outputs were approximately 3.19–3.20 MB, 19.71 MB and 3.12 MB, below targets of 3.33 MB, 22.49 MB and 4.30 MB. Validation checked dimensions, frame counts, track codecs and durations against the reference, with a VMAF score for every output frame.

VMAF is a reference-based video quality metric. Mean VMAF stayed within 0.10 points of the production reference. Looking only at that mean would hide variation: one 720p run’s frame-level fifth-percentile score was 0.69 points lower. Two supplementary comparisons with fresh controls showed differences of −0.45 and −0.03 points. The low-scoring tail therefore deserves its own reporting.

Separate tests using one x264 encoder thread produced byte-for-byte identical MP4s from the previous SIMD and final candidate builds for the 720p, short 1080p and 4K fixtures. Those are equivalence checks between those two builds under that configuration. The speed table uses 12-thread encoding and makes no blanket claim of identical files.

The trade-offs we kept

Reducing the encoder to six or eight threads saved only another 0.6–3.8% of wall time across the screening fixtures, while increasing output size by 1.6–11.4%. We kept the measured 12-thread candidate and its original rate-control settings.

Native FFmpeg also remained ahead in the final session: the candidate took roughly 1.9–2.1 times as long across the three fixtures. That is context, not a universal browser-versus-native ratio. The native timing includes process startup and output writes, while the browser timer covers execution only.

Which jobs this work can help

The patch targets 8-bit software H.264 encoding in the multithreaded WebAssembly core. It does not directly accelerate a container-only remux, copying an audio track, or a separate WebCodecs encoding path. Browser SIMD support also does not prove that a particular job was routed through this core.

This experiment follows our earlier engine upgrade, but uses a different baseline: the production multithreaded core captured for this test. The two headline improvements should not be multiplied together.

For the separate software-versus-hardware tradeoff across tools, see our browser encoder comparison.

Frequently asked questions

Does this mean every compression job is twice as fast?

No. These measurements cover three clips on one Apple M2 and exclude loading and result readback. Different content, browsers, devices and engine routes need separate measurements.

Was the speed gain caused by a lower-quality preset?

The comparison retained the codec, preset, bitrate arguments and encoder thread count. Output checks found very similar average VMAF, with the frame-level variation described above.

Does SIMD require uploading the video?

No. SIMD instructions execute on the user’s CPU inside WebAssembly. RedPanda’s compression processes the video locally and produces an H.264 MP4. Our file-upload verification guide explains how to check local processing.

Can the same result be assumed on Windows or phones?

No. This experiment does not establish Windows or phone speedups. Compatibility, memory behavior, successful completion and fallback behavior need checking alongside speed before widening a rollout.

From a benchmark to a product

The experiment gives us a concrete result: substantially less encoding time on three M2 fixtures, with matched settings and validated outputs. It also leaves clear work: broader device testing, longer clips, cold-start measurements and production monitoring.

As of November 30, 2026, the selected core is in a limited production experiment: 20% of eligible browser profiles receive SIMD and 80% retain the original multithreaded core. This applies only where the existing routing would use that core, including eligible desktop and installed-app sessions and the isolated iOS compression pages below 200 MiB. It is not a 20% rollout across all site visitors.

If the candidate cannot load or complete a job, the application can retry with the original multithreaded core, followed by the existing legacy rescue path where applicable. Monitoring keeps the original assignment separate from the core that actually completed the task. A successful rescue demonstrates user recovery; it does not establish that the SIMD attempt was healthy.

The experiment has begun receiving real jobs, but the first short window is too small and too uneven in device and file mix to establish a real-user speed or completion-rate advantage. We are keeping those production outcomes separate from this local benchmark and checking device-specific failures, loading, output sizes and downloads before considering a wider rollout.

You can use RedPanda Compress for browser-based compression without uploading your video. This case study records the SIMD experiment; it does not promise that every visit receives the candidate core or the same speedup.

The State of Everyday Video, 2026: What Tens of Thousands of Real Files Reveal

A data report from RedPanda Compress. All statistics are aggregates over tens of thousands of real-world video files analyzed in August 2026, with a September re-run added below — percent-only, no user-level data. Reuse welcome with attribution (see the end of the post).

September update: we re-ran everything — what moved, what didn’t

In September we re-ran every query on a fresh sample, with identical definitions so the two months compare like for like. The headline is how little changed: the shape of everyday video looks the same in two independent samples. The findings below still describe August; this section is the delta.

MetricAugustSeptember
H.264 share of files82.1%80.5%
HEVC share of files13.2%14.8%
AV1 share of files0.22%0.26%
MPEG-4 Part 2 files per AV1 file6.35.9
.mp4 files that aren’t H.26414.8%16.5%
Files longer than 1 hour7.8%7.3%
Desktop video that is portrait23.2%23.5%
Files under 2 Mbps (already compressed once)24.9%25.8%
Files above 20 Mbps15.1%14.8%
Compression jobs on ≤3G-class connections9.8%10.0%
Desktop files last touched by FFmpeg41.7%42.3%
Desktop files still carrying a camera fingerprint11.8%11.0%

What moved: HEVC keeps creeping up, and the “MP4 that isn’t H.264” is now one in six. H.264 lost 1.7 points and HEVC gained 1.6. The same shift shows up in desktop-only files (H.264 81.6% → 79.8%), so it isn’t just a change in the mix of devices. Inside .mp4 files, the non-H.264 share went from 14.8% to 16.5% (HEVC alone: 13.3%), so Finding 7’s “one in seven” is now closer to “one in six”. Across the September sample HEVC holds steady around 15% rather than climbing, so we read this as a drift toward a plateau, not a cliff. AV1 ticked up to 0.26% — still invisible, still outnumbered about six to one by the DivX-era codec.

What stayed put. Duration, orientation, bitrate, connection quality and FFmpeg’s share of the last-writer fingerprints all moved by roughly a point or less. Two independent samples landing on the same shape is the best evidence we have that these are properties of everyday video, not artifacts of one month’s traffic. The modal bitrate is still 5–10 Mbps (22.0%, was 23.2%), and about one file in four is still a re-compression of already-compressed video.

What faded: the sticker cluster. Square video is now 4.3% of desktop files (was 6.3%), and 44% of all square clips are below 360p (was 61%). The August “chat-sticker culture” cluster was real but not permanent — a reminder to read small, tight clusters in usage data as snapshots rather than trends.

Method notes for the update: orientation and resolution could not be determined for a larger share of desktop files in September (about 47%, up from about 38%), so every orientation figure remains known-only. Encoder-fingerprint rows use desktop files only, where the fingerprint could be read for about 98% of files in both months (the all-device August figure in Finding 6 was 41.0%). The mix of devices in our sample shifts from month to month, so where a comparison could be distorted by it we checked the desktop-only cut.

Methodology & privacy, up front

RedPanda Compress is a browser-based video compressor: files are processed entirely on the user’s device and never uploaded. The telemetry behind this report is deliberately coarse — pre-bucketed ranges (resolution class, duration range, bitrate range), codec names, and connection-quality classes. No filenames, no file contents, no metadata atoms (camera model, GPS), and no per-user profiles; the categories match our public privacy page.

Known biases: this is not a census of “all video” — it is a census of video people need to shrink, so heavy formats are overrepresented. Orientation and resolution could not be determined for roughly a third of files; those are excluded from the orientation and resolution figures. Connection classes come from the browser’s Network Information API, which estimates effective quality — “3G” means “performs like 3G,” not a cell contract. Encoder provenance was measured on a large subsample.

Finding 1 — H.264 is still 82% of everything. AV1 is statistically invisible.

CodecShare of files
H.264/AVC82.1%
HEVC/H.26513.2%
MJPEG1.6%
MPEG-4 Part 2 (the DivX/Xvid era)1.4%
ProRes0.23%
AV10.22%
VP90.18%
VP80.08%

Twenty-three years after standardization, H.264 remains the water everyone swims in. The striking pair: files encoded with ~2003-era MPEG-4 Part 2 still outnumber AV1 files six to one. AV1 has won the streaming-platform war — YouTube and Netflix serve it billions of times a day — but in the world of files people actually hold (camera output, exports, downloads, old archives) it has essentially no presence. Codec adoption in personal files is generational, not technological: files outlive the codecs that made them, and the encoder defaults of cameras and apps — not the preferences of standards bodies — decide what the world’s disks look like. The one codec visibly gaining is HEVC, and it is gaining the same way H.264 did: by being a phone camera default.

Finding 2 — “Video” no longer means “clip”

DurationShare
< 15 s11.8%
15–60 s22.5%
1–5 min30.1%
5–20 min17.1%
20–60 min10.5%
≥ 1 hour7.8%

Nearly one file in five runs longer than 20 minutes, and roughly one in thirteen exceeds an hour — lectures, meetings, screen recordings, gameplay sessions. The mental model of compression as “shrink this phone clip” misses a fifth of the real workload: video is now also a document format, the recording of something that took an hour because the thing itself took an hour.

Finding 3 — Nearly a quarter of desktop video is vertical

Orientation of files processed on desktop computers (where orientation could be determined):

OrientationShare of desktop files
Landscape70.5%
Portrait23.2%
Square6.3%

Vertical video was born on phones, but it now flows routinely through desktop workflows — footage synced, transferred, or downloaded to a PC for editing and sharing. Desktop software that treats portrait video as an edge case is failing nearly a quarter of real files.

Inside the square segment hides this report’s favorite curiosity: 61% of all square videos are below 360p, and 71% run under 15 seconds — a distinct, many-user cluster consistent with animated chat-sticker and emote culture. Even a three-second looping sticker is worth compressing when a chat app enforces a size cap.

Finding 4 — The 5–10 Mbps world, and the quarter that’s already been compressed

Container bitrate (size × 8 ÷ duration) of source files:

BitrateShare
< 1 Mbps10.7%
1–2 Mbps14.2%
2–5 Mbps16.1%
5–10 Mbps23.2% (modal)
10–20 Mbps20.4%
20–50 Mbps9.3%
≥ 50 Mbps5.8%

The modal file arrives at 5–10 Mbps — the default output of phone cameras and screen recorders. But the tails tell the story. One file in seven exceeds 20 Mbps — modern phones shooting high-bitrate 4K their owners immediately need to shrink. And a full quarter of files arrive below 2 Mbps: video that has already been compressed once, being compressed again to squeeze under some app’s attachment limit. Both tails are artifacts of the same mismatch — recording defaults and sharing limits are set by different companies, and users are stuck reconciling them.

Finding 5 — The users the cloud forgets

Roughly one compression job in ten starts on a connection the browser classifies as 3G-class or slower (per the Network Information API’s effective-quality estimate); on desktop alone the share is about one in twelve. The label surprises until you remember what the API measures: effective throughput, which sweeps congested Wi-Fi, VPNs, tethering, and ISP throttling into the same bucket as genuine 3G.

For this population, uploading a gigabyte of video to a cloud service is somewhere between painful and impossible. Client-side processing isn’t a privacy preference for them; it is the only version of the product that works at all.

Finding 6 — 41% of everyday video has been touched by FFmpeg

Video files carry faint fingerprints of the last software that wrote them. Classifying those fingerprints on a large subsample:

Last writerShare
FFmpeg-family (Lavf muxer)41.0%
Other/indeterminate tools28.8%
Video editors12.4%
Android phone cameras7.7%
Unclassifiable4.2%
Apple cameras2.8%
Platform downloads (YouTube-style)2.2%
Action cameras1.0%

Two things stand out. First, FFmpeg — one open-source project — was the last tool to touch two files in five. It is the invisible plumbing inside converters, downloaders, editors, transcoding pipelines and apps that never mention it; no other single piece of software comes close.

Second, read the camera rows together: only about one file in nine still carries a camera’s own fingerprint. Everything else has already been through at least one piece of software — trimmed, converted, downloaded, re-muxed — before reaching us. The “original” straight-off-the-camera video is, by the time anyone needs to share it, a minority artifact.

Honest limits: the fingerprint only names the last writer, not the chain; “Lavf” is a giant catch-all for anything built on FFmpeg; and a missing fingerprint does not prove a file came straight from a camera.

Finding 7 — .mp4 is a monoculture, and one MP4 in seven is lying to you

By file extension, everyday video is astonishingly uniform: nine files in ten are named .mp4. MOV takes most of the rest (7%); MKV, AVI and WebM are all below 1% each. The container war is over.

But the label has quietly stopped meaning what people think it means:

What’s actually inside a .mp4Share
H.264 (plays everywhere)85.2%
HEVC11.6%
MPEG-4 Part 21.3%
MJPEG1.2%
AV1 + others0.7%

14.8% of .mp4 files — one in seven — don’t contain H.264, and most of those carry HEVC, which still fails to play in many browsers and on many non-Apple devices. “It’s an MP4, it’ll play anywhere” was true for fifteen years; phone cameras defaulting to HEVC-in-mp4 have silently broken it. The extension names the box, not the contents — and the box is no longer a guarantee.

(A small aside for trivia lovers: 3% of files have no audio track at all — mostly screen recordings and camera timelapses.)

Summary for the impatient

  1. H.264 is 82% of personal video; AV1 is 0.22% — still outnumbered 6:1 by DivX-era MPEG-4.
  2. Nearly 1 in 5 files exceeds 20 minutes — compression is now a meetings-and-lectures workload.
  3. 23% of desktop video is vertical — and 61% of square video is sub-360p chat stickers.
  4. The modal file is 5–10 Mbps, but a quarter of files are re-compressions of already-compressed video.
  5. ~10% of compression jobs start on ≤3G-class connections — the population client-side tools exist for.
  6. FFmpeg was the last tool to touch 41% of files; only ~1 in 9 still carries a camera fingerprint.
  7. 90% of files are named .mp4 — but one MP4 in seven doesn’t contain H.264 and may not play everywhere.

Reuse this data

Data and charts may be reused with attribution and a link to redpandacompress.com. Questions about methodology: [email protected]. All statistics are aggregates over coarse buckets; no user-level data exists to share. If you’re curious how a browser can analyze and compress video without uploading it, we’ve written up how the in-browser pipeline works and how to verify no upload happens.

« Older posts