2025/08/13
Vidcomp Script, Update on h264 vs h265 vs VP9 vs AV1: ffmpeg/AV1 is way too slow and ffmpeg/VP9 is still too slow compared to h264
π
2025-08-13 01:01
in Linux
This is an update to My vidcomp script to recompress to h264, h265, VP9 and AV1 amongst other things
After a bit over half a year using it, I figured out that while indeed I don't want to use h265 since it does not decode in every app for licensing issues. At the time, I had also figured out that in ffmpeg, AV1 which is supposed to be even better than VP9, was indeed slower, but not better as far as compression ratio is concerned, or barely enough to matter.
Since then, I came to realize that vp9 is definitely at least 2x slower to encode compare to h264. Originally I considered going back to h264 but then I saw the terrible video quality for lights and lasers, so I'm going to eat the time delay. I will see if for recompressing IG videos before I can merge them, maybe it's fine to use h264 for speed.
AV1: Offers the best compression efficiency, resulting in smaller file
sizes for a given quality level
H.265: Provides significant improvements over H.264, offering better
compression than VP9 in many cases
VP9: While not as efficient as H.265 or AV1, it still offers decent
compression and is widely supported.
Encoding and Decoding Speed:
AV1: Requires more computational power for encoding and decoding,
which can impact performance on older hardware
H.265: Offers a good balance between compression efficiency and
encoding/decoding speed.
VP9: Generally faster to encode and decode compared to AV1.
# x264 (H.264) Fastest
# libvpx-vp9 ~5–10× slower than x264 => my test shows single pass is 2x slower than h264 2 pass
# libaom-av1 ~20–50× slower than x264 (depending on settings)
#
# VP9 (libvpx-vp9): VP9 is a more modern and complex codec. It performs a much
# more exhaustive analysis of the video to find better ways to compress it. This
# allows it to achieve the same visual quality at a 20-50% smaller file size than
# H.264, but this complex analysis requires significantly more CPU time.
# C0012_H264_orig.mp4 (sony camera 1080p h264)
# C0012a_mencoder_H264_4:34.mp4 => terrible quality
# C0012b_ffmpeg_H264_2:08.mp4 => better quality and 2x faster encode
# C0012c_VP9_4:19.webm => decent enough
# C0012d_AV1_22:03.webm => tiny bit better?
# h4 9mn 91MB => join worked
# h4ff 15mn 93MB => non matching but can read android h265 that mencoder cannot
# vp9 45mn 102MB => join worked
# av1 65mn 93MB => join worked
Vp9 is around 2x slower than h264 but the output quality is definitely better. Doing single pass over 2 pass still gives decent output. Maybe for IG video stories, which has taken over 24H in the past for just 1 to 2H of video, I'm going to go back to h264 for speed's sake.
Never a dull moment indeed, doing video is really a lot more work than pictures....
vp9 vs av1 comparison and flags: https://jonathanmh.com/p/encoding-webm-videos-with-ffmpeg-vp9-av1
Gemini says: Compression Efficiency
Never a dull moment indeed, doing video is really a lot more work than pictures....