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

vp9
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

  1. 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.webm
  2. Encode fast with the realtime setting

    -deadline realtime with -cpu-used 8 is 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

The flags in these commands
FlagWhat it doesUsed here
-c:v libvpx-vp9Encodes VP9 with libvpxEvery encode
-crf 32Quality target from 0 to 63; lower is betterEvery encode
-b:v 0No bitrate target, so the CRF alone sets the qualityEvery encode
-row-mt 1Splits rows across threads; off by defaultEvery encode
-deadline goodThe default speed class; best is slower, realtime fasterOne pass
-cpu-used 4Speed inside the class: higher is faster with lower efficiencyOne pass
-pass 1Analysis pass of a two-pass encode; -pass 2 writes the fileTwo passes
-c:a libopus -b:a 96kOpus audio at 96 kbit/s, the usual partner of VP9 in WebMEvery 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.

terminalTry it
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"]
  }'
clip.webm from the API: VP9 and Opus at CRF 32, about 3.2 MB for 11 seconds.Input: clip.mp4

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.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains