<p>Short answer: the VMAF engine isn't comparing pixel to pixel. The engine calculates some objective metrics for each stream (subject and reference); the final VMAF score then is <em>a prediction of a machine learning model</em>, hence the imperfect score.</p>
<p>Long answer: read the discussion at <a href="https://github.com/Netflix/vmaf/issues/76" rel="nofollow noreferrer">https://github.com/Netflix/vmaf/issues/76</a></p>

CC BY-SA 4.0
2023-10-26T04:18:59.480Z
2023-10-26T04:18:59.480Z
Gyan
<p>I'm testing ways to compare image similarity using ffmpeg. I'm looking at using SSIM, PSNR and VMAF.<br>
For reference, I'm running the comparison with duplicated sources and expect a score of 100%.<br><br>
Running SSIM like this:<br>
<code>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 &quot;ssim&quot; -pix_fmt yuv420p -t 1 -f null</code><br>
Gives a perfect score:<br> <code>[Parsed_ssim_0 @ 0x6000015844d0] SSIM Y:1.000000 (inf) U:1.000000 (inf) V:1.000000 (inf) All:1.000000 (inf)</code><p>
Running PSNR like this:<br>
<code>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 &quot;PSNR&quot; -pix_fmt yuv420p -t 1 -f null</code><br>
Gives a perfect score:<br> <code>[Parsed_psnr_0 @ 0x600001478630] PSNR y:inf u:inf v:inf average:inf min:inf max:inf</code><p>
Running <strong>VMAF</strong> like this:<br>
<code>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 &quot;libvmaf&quot; -pix_fmt yuv420p -t 1 -f null</code><br>
I get:<br> <code>[Parsed_libvmaf_0 @ 0x600002c10630] VMAF score: 97.428043</code><p>
Why does VMAF give less the perfect score for the duplicated inputs?<br>Is there a way around this?</p>

<ffmpeg>
Why does VMAF show lower then 100 on same image?
o_ren
# Why does VMAF show lower then 100 on same image?

(Asked by: username_0 on 2023-10-25)

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?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2023-10-26. Score: 2

Short answer: the VMAF engine isn't comparing pixel to pixel. The engine calculates some objective metrics for each stream (subject and reference); the final VMAF score then is *a prediction of a machine learning model*, hence the imperfect score.

Long answer: read the discussion at <https://github.com/Netflix/vmaf/issues/76>


---

