Changes between Version 31 and Version 32 of Encode/AV1


Ignore:
Timestamp:
Mar 5, 2022, 4:19:33 PM (5 years ago)
Author:
veikk0
Comment:

information on SVT-AV1

Legend:

Unmodified
Added
Removed
Modified
  • Encode/AV1

    v31 v32  
    1 = libaom AV1 Encoding Guide =
     1{{{
     2#!html
     3<h1 style="font-size: 22px;">
     4AV1 Video Encoding Guide
     5</h1>
     6}}}
    27
    38[[PageOutline(1-2, Contents)]]
    49
    5 `libaom-av1` is the AOMedia video encoder for [https://en.wikipedia.org/wiki/AV1 AV1], an open source & royalty-free video codec. `libaom-av1` can save about 30% bitrate compared to VP9 and H.265 / HEVC, and about 50% over H.264, while retaining the same visual quality.
     10[https://en.wikipedia.org/wiki/AV1 AV1] is an open source & royalty-free video codec developed by the [https://en.wikipedia.org/wiki/Alliance_for_Open_Media Alliance for Open Media] (AOMedia), a non-profit industry consortium. Depending on the use case, AV1 can achieve about 30% higher compression efficiency than VP9, and about 50% higher efficiency than H.264.
     11
     12There are currently three AV1 encoders supported by FFmpeg: libaom (invoked with `libaom-av1` in FFmpeg), SVT-AV1 (`libsvtav1`), and rav1e (`librav1e`). This guide currently focuses on libaom and SVT-AV1.
     13
     14= libaom =
     15
     16libaom (`libaom-av1`) is the reference encoder for the AV1 format. It was also used for research during the development of AV1. `libaom` is based on `libvpx` and thus shares many of its characteristics in terms of features, performance, and usage.
    617
    718To install FFmpeg with support for `libaom-av1`, look at the [https://ffmpeg.org/trac/ffmpeg/wiki/CompilationGuide Compilation Guides] and compile FFmpeg with the {{{--enable-libaom}}} option.
    … …  
    1425- 1-pass average bitrate
    1526
    16 For a list of options, run `ffmpeg -h encoder=libaom-av1` or check FFmpeg's [https://ffmpeg.org/ffmpeg-codecs.html#libaom_002dav1 online documentation].
     27For a list of options, run `ffmpeg -h encoder=libaom-av1` or check FFmpeg's [https://ffmpeg.org/ffmpeg-codecs.html#libaom_002dav1 online documentation]. For options that can be passed via `-aom-params`, checking the --help output of the `aomenc` application is recommended, as there is currently no official online reference for them.
    1728
    1829{{{
    … …  
    116127= SVT-AV1 =
    117128
    118 `libsvtav1` is the Intel x86-64 codec for AV1. Compile with `--enable-libsvtav1`. See [https://www.ffmpeg.org/ffmpeg-all.html#libsvtav1 FFmpeg doc] and [https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/svt-av1_encoder_user_guide.md upstream doc].
     129SVT-AV1 (`libsvtav1`) is an encoder originally developed by Intel in collaboration with Netflix. In 2020, SVT-AV1 was adopted by AOMedia as the basis for the future development of AV1 as well as future codec efforts. The encoder supports a wide range of speed-efficiency tradeoffs and scales fairly well across many CPU cores.
    119130
    120 The range of options are similar to that of libaom (aomenc). It is supposed to be faster than libaom while having comparable quality.
     131To enable support, FFmpeg needs to be built with `--enable-libsvtav1`. For options available in your specific build of FFmpeg, see `ffmpeg -help encoder=libasvav1`. See also [https://www.ffmpeg.org/ffmpeg-all.html#libsvtav1 FFmpeg documentation] and the [https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/svt-av1_encoder_user_guide.md upstream encoder user guide].
     132
     133As of FFmpeg 5.0, relatively few encoder options are supported by FFmpeg. However, since 2022-02-24, the FFmpeg git has supported `-svtav1-params`, which was introduced in SVT-AV1 0.9.1 for passing encoder options.
     134
     135CRF is the default rate control method, and while VBR and CBR are also available, as of SVT-AV1 0.9.1 they're a work-in-progress and only recommended for "demos, experimentation, and further development uses" as per encoder output.
     136
     137== CRF ==
     138
     139Much like CRF in x264 and x265, this rate control method tries to ensure that every frame gets the number of bits it deserves to achieve a certain (perceptual) quality level.
     140
     141For example:
     142
     143{{{
     144ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 svtav1_test.mp4
     145}}}
     146
     147Note that the `-crf` option is only supported in FFmpeg git builds since 2022-02-24. Prior to this, the CRF value is set with `-qp`.
     148
     149The valid CRF value range is 0-63, with the default being 50. Lower values correspond to higher quality and greater file size. Lossless encoding is currently [https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/1636 not supported.]
     150
     151== Presets and tunes ==
     152
     153The trade-off between encoding speed and compression efficiency is managed with the `-preset` option. Since SVT-AV1 0.9.0, supported presets range from 0 to 13, with higher numbers providing a higher encoding speed.
     154
     155Note that preset 13 is only meant for debugging and running fast convex-hull encoding. In versions prior to 0.9.0, valid presets are 0 to 8.
     156
     157As an example, this command encodes a video using preset 8 and a CRF of 35 while copying the audio:
     158
     159{{{
     160ffmpeg -i input.mp4 -c:a copy -c:v libsvtav1 -preset 8 -crf 35 svtav1_test.mp4
     161}}}
     162
     163Since SVT-AV1 0.9.1, the encoder also supports tuning for visual quality (sharpness). This is invoked with `-svtavt-params tune=0`. The default value is 1, which tunes the encoder for PSNR.
     164
     165Also supported since 0.9.1 is tuning the encoder to produce bitstreams that are faster (less CPU intensive) to decode, similar to the `fastdecode` tune in x264 and x265. This feature is invoked with `-svtav1-params fast-decode=X`, with X being an integer from 1 to 3. Higher numbers result in easier-to-decode video.
     166
     167Decoder tuning is only supported for presets from 5 to 10. The level of decoder tuning supported varies by preset.
     168
     169== Keyframe placement ==
     170
     171By default, SVT-AV1's keyframe interval 2-3 seconds, which is quite short for most use cases. Consider changing this up to 10 seconds with the `-g` option; `-g 240` for 24 fps content, `-g 300` for 30 fps, etc.
     172
     173Note that as of SVT-AV1 0.9.1, scene change detection is not considered to be in an optimal state and is disabled by default. This means that the default behavior is to place keyframes at set intervals instead of at scene changes and other optimal locations. Scene change detection can be turned on with `-sc_detection 1` or via the svtav1-params option `scd=1`.
     174
     175== Film grain synthesis ==
     176
     177SVT-AV1 supports film grain synthesis, an AV1 feature for preserving the look of grainy video while spending very little bitrate to do so. The grain is removed from the image with denoising, its look is approximated and synthesized, and then added on top of the video at decode-time as a filter.
     178
     179The film grain synthesis feature is invoked with `-svtav1-params film-grain=X`, where X is an integer from 1 to 50. Higher numbers correspond to higher levels of denoising for the grain synthesis process and thus a higher amount of grain.
    121180
    122181= rav1e =
    … …  
    126185Rav1e claims to be the fastest software AV1 encoder, but that really depends on the setting.
    127186
    128 = More Info =
    129 
    130 More info about AV1 can be found here:
     187= Additional Resources =
    131188
    132189* [https://nwgat.ninja/test-driving-aomedias-av1-codec/ Nwgat's AOMedia's AV1 Codec Overview]
     190* [https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/svt-av1_encoder_user_guide.md SVT-AV1 user guide]
     191* [https://bugs.chromium.org/p/aomedia/issues/list libaom issue tracker]
     192* [https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues SVT-AV1 issue tracker]
     193* [https://github.com/xiph/rav1e/issues rav1e issue tracker]