AV1 encoding with ffmpeg

Since the newest version (4.0), ffmpeg supports the AV1 codec. VLC should also be able to play AV1 videos.

Unfortunately I haven't found the syntax to encode existing videos to AV1. I use ffmpeg from the command line like:

ffmpeg -i input.mp4 output.avi

But what are the required options for AV1?


Solution 1:

AV1 decoding and encoding is provided via libaom if your ffmpeg build has the library linked. In order to link the library, compile ffmpeg with --enable-libaom (see the compilation guides).

The basic syntax is:

ffmpeg -i input.mp4 -c:v libaom-av1 -strict -2 output.avi

(Note: -strict -2 or -strict experimental is required since the encoder is, at present, experimental. AV1 encoding is very slow at this point.)

You may specify a target bitrate (e.g., -b:v 2M) or a target quality level (e.g. -crf 30). libaom also supports 2-pass encoding.

For more info, see the AV1 encoding guide on the FFmpeg Wiki.