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.webm
Prefer no terminal?
Use the Video Converter in your browser
Open Video Converter

What each flag does

-iInput file. Can be a video, audio, or image. Repeat for multiple inputs.
-c:vVideo codec for output. e.g. libx264, libx265, libvpx-vp9.
-crfConstant Rate Factor — quality target (lower = better, larger file). 23 is visually lossless for libx264.
-c:aAudio codec for output. e.g. aac, libmp3lame, copy.
-b:aAudio bitrate, e.g. 192k.
-b:v 0Tells 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