Changes between Version 1 and Version 2 of Encode/AV1


Ignore:
Timestamp:
Jun 3, 2018, 2:19:44 PM (2 weeks ago)
Author:
slhck
Comment:

improve AV1 guide (only based on documentation, but the previous content was not correct anyway)

Legend:

Unmodified
Added
Removed
Modified
  • Encode/AV1

    v1 v2  
    33[[PageOutline(2, Contents)]] 
    44 
    5 `libaom-av1` is the AOMedia AV1  video encoder for [https://aomedia.org/av1-bitstream-and-decoding-process-specification/], 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. 
     5`libaom-av1` is the AOMedia video encoder for AV1, an open, royalty-free media file format. `libaom-av1` can save about 30% bitrate compared to VP9 and H.265 / HEVC while retaining the same visual quality. 
    66 
    7 To install FFmpeg with support for llibaom-av1, look at the [https://ffmpeg.org/trac/ffmpeg/wiki/CompilationGuide Compilation Guides] and compile FFmpeg with the {{{--enable-libaom}}} option. 
     7To install FFmpeg with support for `llibaom-av1`, look at the [https://ffmpeg.org/trac/ffmpeg/wiki/CompilationGuide Compilation Guides] and compile FFmpeg with the {{{--enable-libaom}}} option. 
    88 
    9 Note that the default audio encoder for AV1s `libopus` 
     9The default audio encoder for AV1 is `libopus`. 
    1010 
     11libaom offers different rate control modes, which determine the quality and file size: 
     12 
     13- 1-pass average bitrate 
     14- 2-pass average bitrate 
     15- Constant quality 
     16 
     17For a list of options, run `ffmpeg -h encoder=libaom-av1`. 
     18 
     19{{{ 
     20#!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;" 
     21'''Note:''' AV1 encoding is very slow in comparison to VP9 or H.264, and considered experimental at this stage. 
     22}}} 
    1123 
    1224=== Average Bitrate (ABR) ===#averageb 
    1325 
    14 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. 
     26libaom-av1 offers a simple "Average Bitrate" or "Target Bitrate" mode. In this mode, it will simply try to reach the specified bit rate on average, e.g. 2 MBit/s. 
    1527 
    1628{{{ 
    17 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 
     29ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -c:a opus -strict -2 av1_test.mkv 
    1830}}} 
    1931 
    20 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. 
     32Only use this option if you do not care about acheiving the best possible quality. 
     33 
     34=== Constant Quality ===#constantq 
     35 
     36In addition to the "default" VBR mode, there's a constant quality (CQ) mode (like CRF in the x264 encoder) that will ensure that every frame gets the number of bits it deserves to achieve a certain (perceptual) quality level, rather than forcing the stream to have an average bit rate. This results in better overall quality. If you do not care about the file size, this should be your method of choice. 
    2137 
    2238{{{ 
    23 libaom-av1 encoder AVOptions: 
    24   -cpu-used          <int>        E..V..... Quality/Speed ratio modifier (from -8 to 8) (default 1) 
    25   -auto-alt-ref      <int>        E..V..... Enable use of alternate reference frames (2-pass only) (from -1 to 2) (default -1) 
    26   -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) 
    27   -error-resilience  <flags>      E..V..... Error resilience configuration (default 0) 
    28      default                      E..V..... Improve resiliency against losses of whole frames 
    29      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. 
    30   -crf               <int>        E..V..... Select the quality for constant quality mode (from -1 to 63) (default -1) 
    31   -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) 
    32   -drop-threshold    <int>        E..V..... Frame drop threshold (from INT_MIN to INT_MAX) (default 0) 
    33   -noise-sensitivity <int>        E..V..... Noise sensitivity (from 0 to 4) (default 0) 
     39ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -c:a opus -strict -2 av1_test.mkv 
    3440}}} 
     41 
     42The CRF value can be from 0–63. Lower values mean better quality.  
     43 
     44=== Controlling Speed / Quality === 
     45 
     46`-cpu-used` sets how efficient the compression will be. The default is 1. Lower values mean slower encoding with better quality, and vice-versa.