How libvpx cpu-used Affects Encoding Performance

The cpu-used parameter in the libvpx encoder (used for VP8 and VP9 video compression) is a critical setting that directly balances encoding speed against visual quality and file size. This article explains how adjusting this speed preset impacts CPU utilization, encoding time, and compression efficiency, helping you select the optimal configuration for your specific video processing workflow.

Understanding the cpu-used Parameter

In libvpx, the --cpu-used (or -cpu-used in FFmpeg) parameter acts as a speed preset. It controls the depth of the encoder’s search algorithms, partition decisions, and motion estimation.

The parameter accepts integer values within a specific range: * For VP9: The range is typically 0 to 8 (and up to 9 in newer versions). * For VP8: The range is typically -16 to 16.

Unlike other encoders where higher numbers might mean slower speeds, in libvpx, lower values result in slower encoding (higher quality/better compression), while higher values result in faster encoding (lower quality/worse compression).

Impact on Encoding Speed and CPU Utilization

As you increase the cpu-used value, the encoder disables or simplifies complex compression tools to save processing time:

Impact on Video Quality and Bitrate Efficiency

The time saved by using a higher cpu-used setting comes at a cost to compression efficiency:

To get the best performance out of libvpx, you should align the cpu-used parameter with your specific application: