AV1 encoding with ffmpeg

5

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?

Dr. Snail

Posted 2018-05-15T08:15:32.140

Reputation: 247

You really do not want to use AVI containers anymore. – Daniel B – 2018-05-15T09:05:58.010

@DanielB the new one AV1 not AVI – Dr. Snail – 2018-05-15T09:41:15.937

Sure. However, in your question you have .avi. – Daniel B – 2018-05-15T13:00:48.267

That's the default sample of FFMPeg at https://www.ffmpeg.org

– Dr. Snail – 2018-05-15T14:43:53.860

What is the best container to use for AV1? – Aaron Franke – 2020-01-05T01:47:31.943

Answers

9

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.

Gyan

Posted 2018-05-15T08:15:32.140

Reputation: 21 016

thanks so far! Could you also add a reference or did you gat that by trying? – Dr. Snail – 2018-05-15T09:42:10.407

No ref yet; I'll add it to the documentation soon. – Gyan – 2018-05-15T09:45:28.543

@slhck I see you removed the mention of 2-pass, why? It's available. – Gyan – 2018-06-03T18:14:19.420

@slhck no problem - was puzzled, that's all. – Gyan – 2018-06-03T18:40:23.547