Best VP9 cpu-used Value for Real-Time Streaming

Selecting the correct cpu-used parameter in the libvpx-vp9 encoder is critical for maintaining stable frame rates and preventing lag during live broadcasts. This article explains the recommended cpu-used values for real-time VP9 streaming, how this setting impacts encoding speed and video quality, and how to configure it for optimal performance.

For real-time streaming applications (such as WebRTC, live interactive broadcasting, or low-latency streaming), the recommended cpu-used value is between 5 and 8, with 6 being the most common sweet spot for modern hardware.

To use these values effectively, you must also set the encoder deadline to realtime (using -deadline realtime or -quality realtime in FFmpeg).

Here is how the recommended values perform in practice:

Why Lower Values are Unsuitable for Real-Time

In libvpx-vp9, the cpu-used parameter ranges from 0 to 9 (when in real-time mode).

When streaming live using FFmpeg and libvpx-vp9, you should pair the cpu-used setting with a constant bitrate (CBR) configuration. This prevents bitrate spikes that could congest the viewer’s network.

Below is an example of an optimized real-time VP9 encoding command:

ffmpeg -i input_source \
  -c:v libvpx-vp9 \
  -s 1280x720 \
  -b:v 2000k -minrate 2000k -maxrate 2000k -bufsize 1000k \
  -deadline realtime \
  -cpu-used 6 \
  -static-thresh 0 \
  -frame-parallel 1 \
  -f rtp rtp://destination_address

Key Parameter Explanations: