FFmpeg recipe
FFmpeg: Convert MP4 to WebM (VP9 + Opus)
WebM is 20–40% smaller than MP4 at equal visual quality, and royalty-free. Browser-friendly, no licensing concerns.
Command
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 33 -b:v 0 -c:a libopus -b:a 128k -y output.webmPrefer no terminal?
Use the Video Converter in your browser
What each flag does
| -i | Input file. Can be a video, audio, or image. Repeat for multiple inputs. |
|---|---|
| -c:v | Video codec for output. e.g. libx264, libx265, libvpx-vp9. |
| -crf | Constant Rate Factor — quality target (lower = better, larger file). 23 is visually lossless for libx264. |
| -c:a | Audio codec for output. e.g. aac, libmp3lame, copy. |
| -b:a | Audio bitrate, e.g. 192k. |
| -b:v 0 | Tells VP9 to use pure CRF mode (no target bitrate cap). Standard for quality-first encoding. |
Notes & gotchas
- VP9 encoding is slow — roughly 5x real-time on a modern CPU.
- For two-pass encoding (sharper at low bitrates), use -pass 1 then -pass 2 with the same -b:v target.
Related recipes
Convert MOV → MP4 · MOV → MP4
Convert MOV to MP4 with FFmpeg using H.264 video and AAC audio. CRF 23 default keeps quality visually identical.
Convert HEVC → H.264 · HEVC → H.264
Convert HEVC (H.265) video to H.264 with FFmpeg so it plays on Windows, in Chrome, and on older Macs.
Convert MKV → MP4 · MKV → MP4
Convert MKV to MP4 with FFmpeg using stream-copy. Remuxes the H.264 / AAC streams without re-encoding.
Convert MP4 → GIF · MP4 → GIF
Convert MP4 to GIF with FFmpeg using a custom palette for sharp colors at small file sizes.