-
Notifications
You must be signed in to change notification settings - Fork 0
FFmpeg AV1
AV1 encoding with ffmpeg >=4.1 using libaom reference encoder, use e.g. a static build for ffmpeg (see https://johnvansickle.com/ffmpeg/)
one pass fixed bitrate encoding:
ffmpeg -y -i "$infile" -vf scale=-2:"$res" \
-pix_fmt yuv420p \
-c:v libaom-av1 \
-b:v "$bitrate" \
-cpu-used 4 \
-an -strict -2 "$outfile".mkv
$infile=input file, $res=height of video, $bitrate=bitrate, e.g. 1M, $outfile=output file
two pass fixed bitrate encoding:
# first pass
./ffmpeg -y -i "$infile" -vf scale=-2:"$res" \
-pix_fmt yuv420p \
-c:v libaom-av1 \
-b:v "$bitrate" \
-cpu-used 4 \
-pass 1 \
-passlogfile "$infile"_pass1_av1_"$res"p_"$bitrate" \
-an -strict -2 "$infile"_pass1_av1_"$res"p_"$bitrate".mkv
# second pass
./ffmpeg -y -i "$infile" -vf scale=-2:"$res" \
-pix_fmt yuv420p \
-c:v libaom-av1 \
-b:v "$bitrate" \
-cpu-used 4 \
-pass 2 \
-passlogfile "$infile"_pass1_av1_"$res"p_"$bitrate" \
-an -strict -2 "$infile"_pass2_av1_"$res"p_"$bitrate".mkv
similar input values like in one pass, outputfilename is automatically generated.
To slow down or speed up calculations change the -cpu-used 4
parameter, a low value means longer calculations with a higher quality and a 8 means ultra fast and low quality, this is similar to presets in HEVC/AVC.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License *.
Code (snippets) are licensed under a MIT License *.
* Unless stated otherwise