I'm testing ways to compare image similarity using ffmpeg. I'm looking at using SSIM, PSNR and VMAF.
For reference, I'm running the comparison with duplicated sources and expect a score of 100%.
Running SSIM like this:
ffmpeg -hide_banner -f lavfi -i color=red:duration=10:size=1280x720:rate=30 -f lavfi -i color=red:duration=10:size=1280x720:rate=30 -filter_complex "ssim" -pix_fmt yuv420p -t 1 -f null
Gives a perfect score:
[Parsed_ssim_0 @ 0x6000015844d0] SSIM Y:1.000000 (inf) U:1.000000 (inf) V:1.000000 (inf) All:1.000000 (inf)
Running PSNR like this:
ffmpeg -hide_banner -f lavfi -i color=red:duration=10:size=1280x720:rate=30 -f lavfi -i color=red:duration=10:size=1280x720:rate=30 -filter_complex "PSNR" -pix_fmt yuv420p -t 1 -f null
Gives a perfect score:
[Parsed_psnr_0 @ 0x600001478630] PSNR y:inf u:inf v:inf average:inf min:inf max:inf
Running VMAF like this:
ffmpeg -hide_banner -f lavfi -i color=red:duration=10:size=1280x720:rate=30 -f lavfi -i color=red:duration=10:size=1280x720:rate=30 -filter_complex "libvmaf" -pix_fmt yuv420p -t 1 -f null
I get:
[Parsed_libvmaf_0 @ 0x600002c10630] VMAF score: 97.428043
Why does VMAF give less the perfect score for the duplicated inputs?
Is there a way around this?