Compress WebM Online — Free File Size Reducer

Compress a WebM file into a smaller WebM using VP9 video encoding with constant-rate factor quality control and Opus audio. Because the input and output share the same container and codecs, compression is achieved purely through re-encoding at a higher CRF value, giving you fine-grained control over the quality-to-filesize tradeoff without switching formats.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

Unlike a simple remux where streams are copied without re-encoding, compressing WebM to WebM means the VP9 video stream is fully decoded and re-encoded using libvpx-vp9 in constant-quality mode (CRF 33 by default, with -b:v 0 disabling the bitrate cap so CRF drives the encode entirely). The Opus audio stream is similarly re-encoded at 128k bitrate using libopus. The result is a new WebM file with a smaller file size at the cost of a generation of lossy quality loss on both tracks. Transparency (alpha channel) and HDR metadata supported by VP9 are preserved through the re-encode as long as they were present in the source.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg command-line tool, which is running here via FFmpeg.wasm compiled to WebAssembly and executing entirely inside your browser — no data is sent to a server.
-i input.webm Specifies the input WebM file. FFmpeg reads the VP9 video stream and the Opus (or Vorbis) audio stream from the Matroska-based WebM container for decoding.
-c:v libvpx-vp9 Selects the libvpx-vp9 encoder for the output video stream — the same codec used in the source file. The video is fully decoded and re-encoded (not stream-copied) to apply the new compression settings.
-crf 33 Sets the VP9 constant-rate factor to 33, a moderate quality level on the 0–63 scale where lower values mean higher quality and larger files. This is the primary lever for controlling how aggressively the video is compressed.
-c:a libopus Re-encodes the audio using libopus, the recommended encoder for Opus audio in WebM. Opus provides excellent quality at low bitrates and is the default audio codec for WebM, ensuring compatibility with all WebM-capable browsers.
-b:a 128k Sets the Opus audio bitrate to 128 kilobits per second, a standard quality level for stereo music and mixed audio. For speech-only content, this can be safely lowered to 64k or 96k to reduce file size further.
-b:v 0 Disables the video bitrate cap for the libvpx-vp9 encoder, which is required to activate pure CRF constant-quality mode. Without this flag, VP9 operates in constrained-quality mode where an implicit bitrate ceiling can interfere with CRF-driven quality targeting.
output.webm The filename for the compressed output file. The .webm extension tells FFmpeg to write a WebM container, preserving the open, royalty-free format suitable for direct HTML5 video embedding.

Common Use Cases

  • Reducing the file size of a high-bitrate screen recording exported as WebM before embedding it in a web page or documentation site
  • Trimming bandwidth usage for a WebM video asset served from a CDN by re-encoding at a higher CRF value to hit a target file size
  • Compressing a WebM animation with an alpha channel transparency layer for use as a lightweight web overlay or sticker, while retaining the transparent background
  • Re-encoding an uncompressed or lightly compressed WebM capture from a browser-based recorder (e.g., MediaRecorder API) into a production-ready, web-optimized file
  • Archiving or sharing a large WebM lecture or presentation recording at a lower bitrate to stay within email or upload size limits
  • Batch-preparing WebM video files for an HTML5 video player where the native format must remain WebM for open-format licensing compliance

Frequently Asked Questions

Yes. Because the video is being fully re-encoded by libvpx-vp9 rather than copied, this is a lossy generation — even if the original WebM was already lossy. Each VP9 re-encode introduces additional compression artifacts, especially in high-motion or high-detail areas. The default CRF of 33 is a moderate quality setting; lowering it (e.g., to 24) improves quality but produces a larger file, while raising it (e.g., to 48) shrinks the file further but degrades quality more visibly.
The libvpx-vp9 encoder requires -b:v 0 to activate true constant-quality (CRF-only) mode. Without it, FFmpeg's default constrained-quality mode sets an implicit bitrate ceiling that can override the CRF target and produce inconsistent quality. Setting -b:v 0 removes that ceiling so the encoder allocates exactly as many bits as the CRF quality level demands, frame by frame — giving you more predictable quality throughout the video.
Change the number after -crf to control video quality. The VP9 CRF scale runs from 0 (lossless) to 63 (lowest quality); the default here is 33. For a noticeably smaller file at acceptable quality, try -crf 40 or -crf 48. For higher fidelity at a larger size, try -crf 24 or -crf 20. You can also adjust audio size by changing the -b:a value — for example, replacing 128k with 64k halves the audio bitrate, or 192k for higher-quality audio.
VP9 alpha channel transparency is preserved through the re-encode because libvpx-vp9 supports encoding with an alpha plane, and WebM supports storing it. However, subtitle tracks and chapter metadata are not automatically carried through by the default FFmpeg command shown — you would need to add -c:s copy and -map_chapters 0 flags to the command to include them. Multiple audio tracks are similarly not mapped by default; add -map 0:a to copy all audio streams.
Compatibility is identical to the source since both files use the same WebM container with VP9 video and Opus audio. WebM with VP9/Opus plays natively in all modern browsers (Chrome, Firefox, Edge, Opera) via HTML5, and is supported on Android devices. Apple platforms (Safari, iOS) have limited WebM support. If broad Apple compatibility is a concern, consider converting to MP4 (H.264 + AAC) instead of compressing within WebM.
Yes. On Linux or macOS you can use a shell loop: for f in *.webm; do ffmpeg -i "$f" -c:v libvpx-vp9 -crf 33 -c:a libopus -b:a 128k -b:v 0 "compressed_$f"; done. On Windows (PowerShell) use: Get-ChildItem *.webm | ForEach-Object { ffmpeg -i $_.Name -c:v libvpx-vp9 -crf 33 -c:a libopus -b:a 128k -b:v 0 ("compressed_" + $_.Name) }. Note that VP9 encoding is CPU-intensive; batch jobs on large files will take significant time.

Technical Notes

VP9 CRF-mode encoding via libvpx-vp9 is significantly slower than encoders like H.264 (libx264) at equivalent quality levels, so expect longer processing times in the browser for large files. The -b:v 0 flag is essential for pure CRF mode in libvpx-vp9 and is not required by other encoders, making it a WebM/VP9-specific consideration. Opus audio encoded at 128k with libopus is perceptually transparent for most stereo content; for mono speech, 64k is often sufficient. The WebM container technically supports lossless VP9 (CRF 0), but lossless output files will be very large and are rarely appropriate for web delivery. Metadata such as creation time, title tags, and stream language tags from the source WebM may be dropped during re-encoding unless explicitly mapped with -map_metadata 0. HDR content (HDR10 or HLG encoded in VP9) can survive the re-encode if the source color space metadata is preserved, but tone-mapping is not applied automatically — the encoder passes through the HDR signal as-is.

Related Tools