Version 1 (modified by kevleyski, 2 years ago) (diff)

Basic AV1 encoding

FFmpeg and libaom AV1 Encoding Guide


libaom-av1 is the AOMedia AV1 video encoder for, an open, royalty-free media file format. libaom-av1 can save about 30% bitrate compared to vp9 and H.265 while retaining the same visual quality.

To install FFmpeg with support for llibaom-av1, look at the Compilation Guides and compile FFmpeg with the --enable-libaom option.

Note that the default audio encoder for AV1s libopus

Average Bitrate (ABR)

libaom-av1 offers a simple variable bitrate (VBR) mode by default. This is also sometimes called "Average Bitrate" or "Target Bitrate". In this mode, it will simply try to reach the specified bit rate on average, e.g. 2 MBit/s.

ffmpeg -threads 0 -i input.mp4 -c:v libaom-av1 -cpu-used 8 -crf 20 -stats -vstats -benchmark -c:a opus -strict -2 -y av1_test.mkv

Choose a higher bitrate if you want better quality. Note that you shouldn't leave out the -b:v option as the default settings will produce mediocre quality output.

libaom-av1 encoder AVOptions:
  -cpu-used          <int>        E..V..... Quality/Speed ratio modifier (from -8 to 8) (default 1)
  -auto-alt-ref      <int>        E..V..... Enable use of alternate reference frames (2-pass only) (from -1 to 2) (default -1)
  -lag-in-frames     <int>        E..V..... Number of frames to look ahead at for alternate reference frame selection (from -1 to INT_MAX) (default -1)
  -error-resilience  <flags>      E..V..... Error resilience configuration (default 0)
     default                      E..V..... Improve resiliency against losses of whole frames
     partitions                   E..V..... The frame partitions are independently decodable by the bool decoder, meaning that partitions can be decoded even though earlier partitions have been lost. Note that intra predicition is still done over the partition boundary.
  -crf               <int>        E..V..... Select the quality for constant quality mode (from -1 to 63) (default -1)
  -static-thresh     <int>        E..V..... A change threshold on blocks below which they will be skipped by the encoder (from 0 to INT_MAX) (default 0)
  -drop-threshold    <int>        E..V..... Frame drop threshold (from INT_MIN to INT_MAX) (default 0)
  -noise-sensitivity <int>        E..V..... Noise sensitivity (from 0 to 4) (default 0)