ffmpeg - Conversions - Convert H264 to AV1 - libaom - Two-Pass

In order to create more efficient encodes when a particular target bitrate should be reached, two-pass encoding should be used.

Two-pass encoding is also beneficial for encoding efficiency when constant quality is used without a target bitrate.

time ffmpeg -i a.mp4 -c:v libaom-av1 -b:v 2M -pass 1 -an -f null /dev/null && time ffmpeg -i a.mp4 -c:v libaom-av1 -b:v 2M -pass 2 -c:a libopus -f mp4 out.mp4
 
time ffmpeg -i a.mp4 -c:v libaom-av1 -b:v 2000k -pass 1 -an -f null /dev/null && time ffmpeg -i a.mp4 -c:v libaom-av1 -b:v 2000k -pass 2 -ac 2 -c:a libopus  -f mp4 out.mp4x

returns:

...
real	98m40.037s
user	567m32.622s
sys	0m26.253s

NOTE:

  • Input test size: 75.5M
  • Output test size: 4.2M

NOTE: The bitrate limit by the -b:v where the bitrate MUST be non-zero.

  • Opus is a totally open, royalty-free, highly versatile audio codec.