Video Compressor

Compress video in your browser: quality, lossless, or audio removal

1234

About Video Compressor

This compressor runs ffmpeg.wasm — FFmpeg compiled to WebAssembly, version 0.12.10 with the single-threaded core — inside your browser, downloading it from a CDN the first time you use it. Your video is never uploaded anywhere, but encoding speed is limited to one CPU core. Expect it to be several times slower than desktop FFmpeg; a one-minute 1080p clip can take a few minutes.

There are three modes. Quality compression re-encodes to H.264 (libx264) in an MP4. Keep original (no re-encode) copies the streams into a new container without re-encoding. Remove audio leaves the picture untouched and drops the sound track. Only the first one makes a file substantially smaller.

CRF targets quality, not file size

Quality mode does not set a bitrate. It uses CRF (Constant Rate Factor), a quality target from 0 to 51 where lower means better and bigger. The encoder spends more bits on busy scenes and fewer on static ones to keep perceived quality roughly even, so at the same CRF a football match comes out large and a slideshow recording comes out small.

The FFmpeg wiki's rule of thumb is that raising CRF by 6 roughly halves the file, and lowering it by 6 roughly doubles it. The tool's three steps are 23 (high quality), 28 (default) and 33 (strong compression), five apart. x264's own default is 23, so treat 23 as hard to tell from the source and 33 as fine on a phone screen.

The catch with CRF is that you cannot choose the output size in advance. If a platform caps uploads at a certain size, compress once, and if it is still over, raise CRF or lower the resolution and run it again.

Why the output is always H.264 MP4

VP9 and AV1 produce smaller files than H.264 at the same quality, but they are far slower to encode; AV1 on single-threaded WebAssembly would take an unreasonable time even for a short clip. Playback compatibility differs too. H.264 MP4 plays with hardware decoding on virtually every phone, TV, chat app and older Windows PC, whereas hardware AV1 decoding is limited to relatively recent devices.

The same reasoning explains the x264 preset veryfast. A preset trades compression efficiency for speed: it is faster than the default medium, at the cost of slightly larger files at the same CRF. Audio is re-encoded to AAC at 128 kbps.

Lower the resolution before you raise CRF

Going from 1080p (1920×1080) to 720p (1280×720) leaves 44% of the pixels. On a phone or in a chat preview the difference is hard to see, while the size drops sharply — usually a better result than pushing CRF to 33 until everything smears.

When you pick a resolution, the tool sets the height and derives the width from the aspect ratio, rounding both to even numbers because H.264 cannot encode odd dimensions. Only values smaller than the source make sense. Note that choosing 720p for a vertical 1080×1920 video makes the height 720, which is much smaller than you might expect.

What Keep original and Remove audio actually do

Keep original mode copies the video and audio streams into a new container without decoding them (stream copy). There is no quality loss and it finishes in seconds, but since nothing is recompressed, the size barely changes. Its real use is tidying the container: MP4, WebM, MKV and AVI stay in the same format, while MOV and anything else become MKV. MP4 output has its index (moov) moved to the front (faststart), so once uploaded to the web it starts playing before the whole file has downloaded.

Remove audio also copies the video stream and simply omits the sound. The saving equals the size of the audio track. At 128 kbps that is about 0.96 MB per minute, which makes it a quick fix for screen recordings that never needed sound.

Worked examples

Working out the bitrate budget for an upload cap

Input
A 60-second clip that must fit in 8 MiB, with AAC audio at 128 kbps
Output
About 0.99 Mbps average for the video

8 MiB = 67,108,864 bits ÷ 60 s ≈ 1,118,000 bps; subtract 128,000 bps for audio and roughly 990 kbps is left. That is thin for 1080p but workable at 720p or 480p, so lower the resolution first and try CRF 28.

Changing only the resolution

Input
1920×1080 → 720p
Output
1280×720, 44.4% of the pixels

1280 × 720 ÷ (1920 × 1080) = 921,600 ÷ 2,073,600 = 0.444. Even at the same CRF, the encoder has less than half as much picture to describe.

Stripping sound from a screen recording

Input
10-minute screen recording, 128 kbps audio, Remove audio
Output
About 9.6 MB smaller; video identical to the original

128,000 bps × 600 s ÷ 8 = 9,600,000 bytes. The video track is not re-encoded, so there is no cost in quality or time.

How to use it

  1. Choose a video file (above 300 MB you will see a memory warning).
  2. Pick a mode; for quality compression, choose the quality step and resolution.
  3. On first use the engine (about 30 MB) downloads, then encoding starts.
  4. Preview the result, check the size and download.

Frequently asked questions

Why is compression so slow?

ffmpeg.wasm here is a single-threaded build using one CPU core, so it is much slower than desktop FFmpeg. Dropping to 720p or 480p cuts the number of pixels to encode and shortens the wait considerably.

Keep original mode didn't reduce the size.

That is expected. This mode copies the streams unchanged, so no compression takes place. Use quality mode to shrink the file.

Can I make the output exactly 10 MB?

Not with CRF, which targets quality rather than size. Run it once, and if the file is too big, raise CRF or lower the resolution and compress again.

Can I export AV1 or VP9?

No. Encoding them in single-threaded WebAssembly is too slow, and H.264 has the widest playback compatibility.

My iPhone HDR video looks washed out after compressing.

The tool does not tone-map HDR to SDR, so colours can look faded or dark on standard screens. For HDR clips, choosing Most Compatible when exporting from the iPhone is safer.

Sources

Last reviewed:

Privacy and how data is handled