How to Set libaom AV1 Static Threshold in FFmpeg

This article provides a straightforward guide on how to configure the static threshold parameter when encoding AV1 video using the libaom-av1 encoder in FFmpeg. By adjusting this setting, you can optimize your encoding efficiency, reduce CPU usage, and control file size by skipping the processing of blocks that experience little to no motion between frames.

What is the Static Threshold?

The static threshold in the libaom AV1 encoder is a setting that determines whether a block of pixels has changed enough from the previous frame to warrant being re-encoded.

If the change in a block falls below the specified threshold, the encoder treats it as static and skips encoding that block, reusing the data from the previous frame instead. This is highly beneficial for videos with low motion, such as screencasts, presentations, or talking-head interviews, as it saves significant processing time and reduces bitrate.

Configuring -static-thresh in FFmpeg

To configure this setting, use the -static-thresh private option in your FFmpeg command.

The syntax is: -static-thresh <value>

Example FFmpeg Command

Below is an example of an FFmpeg command that applies a static threshold of 100 using the libaom-av1 encoder:

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -static-thresh 100 output.mkv

In this command: * -c:v libaom-av1 selects the Reference ADK AV1 encoder. * -crf 30 -b:v 0 sets the quality target using Constant Rate Factor. * -static-thresh 100 tells the encoder to skip processing blocks with motion changes below a score of 100.