libvpx-vp9 at CRF 32 with -b:v 0 makes a 1080p WebM that scores a VMAF of about 96; two passes save under 2% for over three times the time. ReelSDK encodes an 11-second clip for under three quarters of a cent at $0.02 per compute minute.
Encode VP9 WebM with ffmpeg
WebM pairs VP9 video with Opus audio, and ffmpeg encodes VP9 with libvpx-vp9; ReelSDK's API took about 19 seconds for our clip. CRF 32 with -b:v 0 gives constant quality, and -cpu-used 4 with -row-mt 1 keep a 1080p encode to a few times real time.
GuidesUpdated
ffmpeg -i clip.mp4 -c:v libvpx-vp9 -crf 32 -b:v 0 -row-mt 1 \
-deadline good -cpu-used 4 -c:a libopus -b:a 96k clip.webm-crf 32 with -b:v 0 asks for constant quality, the mode the FFmpeg VP9 guide recommends for files. -cpu-used 4 and -row-mt 1 keep it reasonably quick: an 11-second 1080x1920 clip took under 40 seconds and came out at about 3.2 MB.
Variations
The other commands you will need
Run two passes
The first pass only analyses, so it writes to
/dev/null. Left at the default-cpu-used, two passes took over three times as long together and saved under 2%, with a VMAF of about 97 instead of 96.two-pass ffmpeg -y -i clip.mp4 -c:v libvpx-vp9 -crf 32 -b:v 0 -row-mt 1 \ -pass 1 -an -f null /dev/null && \ ffmpeg -i clip.mp4 -c:v libvpx-vp9 -crf 32 -b:v 0 -row-mt 1 \ -pass 2 -c:a libopus -b:a 96k two-pass.webmEncode fast with the realtime setting
-deadline realtimewith-cpu-used 8is the fastest setting we tried. It took about 8 seconds here, a fifth of the CRF 32 time, but the file grew 56% for the same VMAF.realtime ffmpeg -i clip.mp4 -c:v libvpx-vp9 -crf 32 -b:v 0 -row-mt 1 \ -deadline realtime -cpu-used 8 -c:a libopus -b:a 96k rt.webm
The flags
The flags in these commands
| Flag | What it does | Used here |
|---|---|---|
-c:v libvpx-vp9 | Encodes VP9 with libvpx | Every encode |
-crf 32 | Quality target from 0 to 63; lower is better | Every encode |
-b:v 0 | No bitrate target, so the CRF alone sets the quality | Every encode |
-row-mt 1 | Splits rows across threads; off by default | Every encode |
-deadline good | The default speed class; best is slower, realtime faster | One pass |
-cpu-used 4 | Speed inside the class: higher is faster with lower efficiency | One pass |
-pass 1 | Analysis pass of a two-pass encode; -pass 2 writes the file | Two passes |
-c:a libopus -b:a 96k | Opus audio at 96 kbit/s, the usual partner of VP9 in WebM | Every encode |
Sources: FFmpeg VP9 encoding guide, ffmpeg codecs: libvpx, checked November 2026.
What -b:v 0 still does
The FFmpeg VP9 guide says -b:v MUST be 0 for constant quality, because a bitrate turns -crf into a cap. In ffmpeg 8.1, leaving -b:v out has the same effect: libvpxenc.c switches VP9 to constant quality when it gets a CRF and no bitrate. Without -b:v 0, our encode came out the same size, with a video stream identical by MD5.
Keep -b:v 0 anyway. It costs nothing, it says what you mean, and older builds and other wrappers may not make the same choice.
Speed settings
libvpx-vp9 is slow at its defaults: -deadline good with -cpu-used 0, and no row threading. -row-mt 1 is the free win, and each step up in -cpu-used trades some efficiency for speed. The realtime class goes furthest: on our file it traded 56% more bytes for the speed.
Two passes let the encoder see the whole video before it spends any bits. Here they made the file under 2% smaller and lifted VMAF from about 96 to about 97, but they also ran at the slower default -cpu-used, so not all of that is the second pass.
Pick a CRF
The guide recommends 15 to 35, and 31 for 1080p. Our 32 scored a VMAF of about 96 on a 1080x1920 clip; go lower if you see blocks in dark or busy scenes. To compare VP9 with H.264, HEVC and AV1 on the same clip, see encode AV1 with ffmpeg.
Going the other way, from WebM to MP4, needs a re-encode for most players: see convert WebM to MP4.
Without installing ffmpeg
The same command as one API call
The engine has libvpx-vp9 and libopus, so the first command runs as is. The job finished in about 19 seconds and cost under three quarters of a cent at $0.02 per compute minute, billed per second, and its WebM came out the same size as ours.
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
-H "Authorization: Bearer $REELSDK_KEY" \
--json '{
"inputs": {
"clip.mp4": "https://api.reelsdk.com/f/lib/demo/clip.mp4"
},
"args": [
"-i", "clip.mp4", "-c:v", "libvpx-vp9", "-crf", "32", "-b:v", "0",
"-row-mt", "1", "-deadline", "good", "-cpu-used", "4", "-c:a",
"libopus", "-b:a", "96k", "clip.webm"
],
"outputs": ["clip.webm"]
}'FAQ
Questions, answered
Do I need -b:v 0 for VP9 in ffmpeg?
The FFmpeg VP9 guide says yes for constant quality. In ffmpeg 8.1 a -crf without any -b:v already gives constant quality: our encode without -b:v 0 had an identical video stream. Keep -b:v 0 for older builds.
Why is VP9 encoding so slow?
libvpx-vp9 defaults to -cpu-used 0 and no row threading. Add -row-mt 1 and -cpu-used 4: our 11-second clip then took under 40 seconds.
What CRF should I use for VP9?
The guide recommends 15 to 35, and 31 for 1080p. CRF 32 gave our 1080x1920 clip a VMAF of about 96 at about 3.2 MB.
Can I make a VP9 WebM with an API?
Yes. The engine has libvpx-vp9 and libopus: send the args to POST https://api.reelsdk.com/v1/ffmpeg with the video's URL in inputs. Our job finished in about 19 seconds and cost under three quarters of a cent, at $0.02 per compute minute, billed per second.
- Convert WebM to MP4 with ffmpegRe-encode a WebM's VP9 and Opus to H.264 and AAC, or copy both streams into an MP4 in under a second without re-encoding.
- Encode AV1 with ffmpegEncode AV1 with SVT-AV1 or libaom: presets 4, 8 and 12 against libaom and x264 on one clip, with file size, VMAF and time.
- Encode H.265 (HEVC) with ffmpegEncode HEVC with libx265: CRF 28 against x264 CRF 23 on one clip, the hvc1 tag Apple players need, and 10-bit output.
- Choose a CRF value in ffmpegWhat CRF does in libx264, the file size and VMAF score for CRF 18, 23, 28 and 33 on one clip, and how x265's scale differs.
- Compress a video with ffmpegShrink a video with ffmpeg: CRF 28 in x264 or x265, a smaller frame or a slower preset, with the size and quality each one gets you.
- Set the video bitrate with ffmpegSet an average bitrate with -b:v, cap it with -maxrate and -bufsize, or run two passes to land on a file size, with measured results.
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
