I have been experimenting with HEVC/H.265 compression parameters to find a sweet spot balance between file size and quality for a 1080p/H.264 recording of a festival with lots of details and flashing/strobing dynamics going on in the picture.
Specifically, I was comparing the "slow" and "slower" presets at CRF 24.
The "slower" preset took roughly twice as longer to encode and produced only about 1% smaller file size than "slow". I expected the quality to be at least not worse.
To my surprise, the "slower" preset introduced some noticeable artefacts in the picture which "slow" did not.
Here is a 200x150 px chunk of a frame from the original stream (showing crowd before the stage at night time):
Same encoded with "slow":
Same encoded with "slower":
It may be hard to spot any difference at first glance, so I repeat the latter showing where to look:
— see there is a tiny dot of light which is not visible in either the original or the "slow" encodings. This is just one example. The entire frame featured more of these new light dots (or other artefacts) which HEVC seemingly introduced on its own.
Why is HEVC doing that when using the "slower" preset? Is that a bug? Is it applying some fancy opportunistic or heuristic prediction of what it thinks should be on the picture?
ffmpeg
params I used:
-c:v libx265 -x265-params log-level=error -crf 24 -preset slower
Version:
ffmpeg -version
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.27)
configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libass --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-version3 --pkg-config-flags=--static --disable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100