Compress WebM files
Compress WebM for web-first delivery. WebM can be smaller than MP4 depending on content and encoding settings.
Last updated: 2026-03-18
To compress WebM files, run npx optimo video.webm. Optimo applies FFmpeg-powered compression by default. For stronger reduction, use --lossy or --resize to shrink dimensions — often the single biggest lever for file size.
Start with optimo
First, run optimo on your video file:
npx optimo video.webm
This is safe: optimo keeps the original if the output isn't smaller.
Two big levers
1) Lossy mode
npx optimo video.webm --lossy
2) Resize (dimensions)
npx optimo video.webm --resize w1280
Practical tips
- If you need maximum compatibility (especially on some platforms), keep an MP4 fallback.
- Use `--resize` to cap resolution before chasing codec-level wins.
- For silent loops, muted WebM can be extremely efficient.
Related pages
Consider converting
Sometimes the best compression is picking a better delivery format.
Popular conversions
Frequently asked questions
- How do I compress WebM files?
- Run "npx optimo video.webm" to compress WebM with lossless optimization. For stronger compression, add --lossy. For size reduction through resizing, add --resize followed by a percentage, dimensions, or target file size.
- What is the best way to reduce WebM file size?
- The two biggest levers are resizing (reducing dimensions to match display size) and lossy compression. Resizing usually has a larger impact than codec-level compression. Sometimes converting to a more efficient format is the best approach.