Difference Between libvpx cpu-used 0 and 8

In the libvpx encoder (used for VP8 and VP9 video compression), the --cpu-used parameter controls the trade-off between encoding speed and video quality. Setting cpu-used 0 configures the encoder for maximum quality and compression efficiency at the cost of extremely slow encoding speeds, while cpu-used 8 prioritizes rapid encoding speed, resulting in faster processing but lower overall video quality and larger file sizes at a equivalent bitrate.

The Role of the cpu-used Parameter

The cpu-used parameter (often set via -cpu-used in FFmpeg) dictates how much computational effort the encoder exerts when compressing video frames. The encoder uses various algorithms to analyze motion, block partitions, and pixel differences. By adjusting this setting, you tell the encoder whether to perform an exhaustive, high-precision search for the best compression or to use fast heuristics to get the job done quickly.

libvpx cpu-used 0: Maximum Quality, Slowest Speed

When you set cpu-used 0, you are instructing the encoder to prioritize visual quality and compression efficiency above all else.

libvpx cpu-used 8: Maximum Speed, Lowest Quality

Setting cpu-used 8 shifts the encoder’s focus entirely toward speed and low latency.

Key Differences At a Glance

Feature cpu-used 0 cpu-used 8
Encoding Speed Extremely Slow Extremely Fast
Compression Efficiency Excellent (Smallest file size for quality) Poor (Larger file size for quality)
Visual Quality Highest Lower (More compression artifacts)
Resource Usage High CPU utilization over a long duration Low CPU utilization per frame
Primary Use Case Archiving and professional distribution Live streaming and real-time communication

For most practical offline encoding tasks, a middle ground like cpu-used 1 to cpu-used 4 is recommended to achieve a reasonable balance between time spent encoding and the final quality of the video.