Configure libaom AV1 Drop Frame in FFmpeg

When encoding video with the AV1 codec using the libaom library in FFmpeg, managing bitrate spikes is crucial for streaming and low-bandwidth scenarios. This guide provides a straightforward explanation of how to configure the drop-frame parameter in libaom-av1 using FFmpeg, helping you prevent buffer underflows by allowing the encoder to drop frames when necessary.

The drop-frame feature in the libaom-av1 encoder is controlled via the -drop-threshold option in FFmpeg. This parameter is used in rate-controlled encoding (such as Constant Bitrate, or CBR) to drop video frames when the encoding buffer fullness drops below a specified percentage.

The -drop-threshold Parameter

The -drop-threshold option accepts an integer value from 0 to 100:

FFmpeg Command Example

To use this parameter, you must define a target bitrate (-b:v) and a buffer size (-bufsize) along with the -drop-threshold value. Below is an example of a Constant Bitrate (CBR) configuration with frame dropping enabled:

ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 1M -maxrate 1M -bufsize 2M -drop-threshold 30 output.mkv

Parameter Breakdown:

By adjusting this threshold, you can balance video smoothness (fewer dropped frames) against strict bitrate compliance (more dropped frames during complex scenes).