FFmpeg h264 & h265 preset crf comparison 2020 (finale)

This comprehensive FFmpeg encoding comparison includes H.264 and H.265 HEVC from the fastest preset ultrafast through to veryslow with CRF values from 20 to 30.

The posts have been split up with this, the finale putting the fasts and slows presets from both H.264 with H265 HEVC together.

H.264 and H.265 preset crf comparison

This post is the finale concluding the previous 7 parts. Part 1, 2, 3 and 4 For H.264 can be found at the links. Part 1 for H265 here, part 2 and part 3.

The server

Intel Xeon E-2246G CPU with 6 cores, 12 threads at 3.60GHz boosted to 4.80GHz with 32GB of ram and SSD disk running Ubuntu 18.04 64 bit.

CPU model            : Intel(R) Xeon(R) E-2246G CPU @ 3.60GHz
Number of cores      : 12
CPU frequency        : 4200.984 MHz
Total size of Disk   : 877.5 GB (25.1 GB Used)
Total amount of Mem  : 32068 MB (365 MB Used)
Total amount of Swap : 1951 MB (0 MB Used)
System uptime        : 1 days, 4 hour 47 min
Load average         : 0.00, 0.00, 1.19
OS                   : Ubuntu 18.04.3 LTS
Arch                 : x86_64 (64 Bit)
Kernel               : 4.15.0-72-generic
----------------------------------------------------------------------
I/O speed(1st run)   : 438 MB/s
I/O speed(2nd run)   : 440 MB/s
I/O speed(3rd run)   : 440 MB/s
Average I/O speed    : 439.3 MB/s

The Xeon E-2246G is a very recently released CPU (Q2 2019). FFmpeg version 3.4.6.

The source media

Thanks to jell.yfish.us the source media file for the H.265 testing is this file here. At 4k resolution (3840×2160) 29.97 fps, 30 seconds long, 400Mbps bitrate, 10 bit and a file size of 1.4GB this video file is rich in its data.

Results

If you didn’t already know, you will after reading this. H265 or HEVC is considerably slower than H264. The average of all the H264 encode times in seconds was 144.42 whilst H265 was a much greater 590.65 seconds.

H264 averaged 23.91 encoding fps, whilst H265 averaged an encoding FPS speed of just 5.63. The advantages from H265 come in its filesize averaging just 61,648.88 Kilobytes whilst H264 was 103,183.18 KB.

Average H265 bitrate was 16,813.71 kb/s whilst H264 was 28,145.15 kb/s. furthermore stating that H265 HEVC compress the media much more than h264 that is why it takes longer.

File size in kilobytes

ffmpeg h264 h265 comparison chart file size
ffmpeg h264 h265 file size

Bitrate kb/s

ffmpeg h264 h265 comparison chart bitrate
ffmpeg h264 h265 bitrate

Encoding FPS

ffmpeg h264 h265 comparison chart encode fps
ffmpeg h264 h265 encode fps

Time taken to finish

ffmpeg h264 h265 comparison chart encode time
ffmpeg h264 h265 time taken

File size + seconds

ffmpeg h264 h265 comparison chart size plus seconds
ffmpeg h264 h265 size plus seconds

File size + seconds + bitrate

ffmpeg h264 h265 comparison chart size plus seconds plus bitrate
ffmpeg h264 h265 size plus seconds plus bitrate

Each preset with averages for H264 and H265:

Average file size

ffmpeg h264 h265 comparison avg file size
ffmpeg h264 h265 comparison avg file size

Average bitrate

ffmpeg h264 h265 comparison avg bitrate
ffmpeg h264 h265 comparison avg bitrate

Average seconds

ffmpeg h264 h265 comparison avg seconds
ffmpeg h264 h265 comparison avg seconds

Average FPS

ffmpeg h264 h265 comparison avg fps
ffmpeg h264 h265 comparison avg fps

Average size + seconds

ffmpeg h264 h265 comparison avg size plus seconds
ffmpeg h264 h265 comparison avg size plus seconds

Average size + seconds + bitrate

ffmpeg h264 h265 comparison avg size plus seconds plus bitrate
ffmpeg h264 h265 comparison avg size plus seconds plus bitrate

Precentage difference charts:

ffmpeg h264 h265 avg bitrate less
h265 avg bitrate less than h264
ffmpeg h264 h265 avg seconds faster
h264 avg seconds faster than h265
ffmpeg h264 h265 avg file size smaller
h265 avg file size smaller than h264
ffmpeg h264 h265 avg fps less
h265 avg fps less than h264

Graphs for each crf value

FPS

ffmpeg h264 h265 comparison chart fps crf 20 ffmpeg h264 h265 comparison chart fps crf 21 ffmpeg h264 h265 comparison chart fps crf 22 ffmpeg h264 h265 comparison chart fps crf 23 ffmpeg h264 h265 comparison chart fps crf 24 ffmpeg h264 h265 comparison chart fps crf 25 ffmpeg h264 h265 comparison chart fps crf 26 ffmpeg h264 h265 comparison chart fps crf 27 ffmpeg h264 h265 comparison chart fps crf 28 ffmpeg h264 h265 comparison chart fps crf 29 ffmpeg h264 h265 comparison chart fps crf 30

File size

ffmpeg h264 h265 comparison chart size crf 20 ffmpeg h264 h265 comparison chart size crf 21 ffmpeg h264 h265 comparison chart size crf 22 ffmpeg h264 h265 comparison chart size crf 23 ffmpeg h264 h265 comparison chart size crf 24 ffmpeg h264 h265 comparison chart size crf 25 ffmpeg h264 h265 comparison chart size crf 26 ffmpeg h264 h265 comparison chart size crf 27 ffmpeg h264 h265 comparison chart size crf 28 ffmpeg h264 h265 comparison chart size crf 29 ffmpeg h264 h265 comparison chart size crf 30

Seconds

ffmpeg h264 h265 comparison chart seconds crf 20 ffmpeg h264 h265 comparison chart seconds crf 21 ffmpeg h264 h265 comparison chart seconds crf 22 ffmpeg h264 h265 comparison chart seconds crf 23 ffmpeg h264 h265 comparison chart seconds crf 24 ffmpeg h264 h265 comparison chart seconds crf 25 ffmpeg h264 h265 comparison chart seconds crf 26 ffmpeg h264 h265 comparison chart seconds crf 27 ffmpeg h264 h265 comparison chart seconds crf 28 ffmpeg h264 h265 comparison chart seconds crf 29 ffmpeg h264 h265 comparison chart seconds crf 30

Bitrate

ffmpeg h264 h265 comparison chart bitrate crf 20 ffmpeg h264 h265 comparison chart bitrate crf 21 ffmpeg h264 h265 comparison chart bitrate crf 22 ffmpeg h264 h265 comparison chart bitrate crf 23 ffmpeg h264 h265 comparison chart bitrate crf 24 ffmpeg h264 h265 comparison chart bitrate crf 25 ffmpeg h264 h265 comparison chart bitrate crf 26 ffmpeg h264 h265 comparison chart bitrate crf 27 ffmpeg h264 h265 comparison chart bitrate crf 28 ffmpeg h264 h265 comparison chart bitrate crf 29 ffmpeg h264 h265 comparison chart bitrate crf 30