Table of Contents

ffmpeg - Conversions - Convert H264 to AV1

While AV1 is used to create video files, it is not a file format.

There are various methods to convert to AV1.

AV1 is implemented in libaom and svt-av1.


ffmpeg -y -i a.mp4 -c:v libaom-av1 -strict -2 -b:v 3000K -maxrate 6000K -cpu-used 8 -pass 2 out.mp4
 
ffmpeg -i input.mp4 -c:v av1 output.av1
ffmpeg -y -i input.mp4 -c:v libaom-av1 -strict -2 -b:v 3000K -maxrate 6000K -cpu-used 8 -pass 1 -f matroska NUL & \
 
ffmpeg -i input.mp4 -c:v libaom-av1 -strict -2 -b:v 3000K -maxrate 6000K -cpu-used 0 -pass 2 output_AV1.mkv

NOTE: This is extremely slow!

  • This uses the libaom-av1 encoder.

NOTE: AV1 is implemented in libaom and svt-av1.

  • Libaom is the reference codec, it produces smaller files than svt-av1 but it is slow.
  • The svt-av1 encoder is optimized for speed and produces bigger files than libaom.

Simple method, with Quality/Speed ratio modifier

ffmpeg -y -i a.mp4 -c:v libaom-av1 -cpu-used 8 -f mp4 out.mp4

NOTE: The -cpu-used 8 option sets the quality to the higher.


Simple usage

ffmpeg -y -i a.mp4 -c:v libaom-av1 -f mp4 out.mp4

NOTE: It is extremely slow.


References

https://trac.ffmpeg.org/wiki/Encode/AV1