VMAF, PSNR and SSIM are objective video quality metrics. Each one compares an encoded video against its original and gives a score for how much quality was lost. PSNR measures raw pixel error. SSIM measures how well structure and contrast are kept. VMAF, developed by Netflix, combines several measurements using machine learning to predict how a human viewer would rate the video, on a scale of 0 to 100.
These metrics let you compare encoder settings with numbers instead of squinting at screenshots. The sections below explain what each one actually measures, how to read the scores, how to run them with FFmpeg, and the traps that make results misleading.
Full-reference metrics: the common idea
All three are full-reference metrics. They need the pristine source and the encoded version, aligned frame for frame at the same resolution. They score each frame and then pool the frame scores, usually by averaging, into one number. They can't tell you whether a video looks good in isolation. They can only tell you how close it is to its reference.
That makes them ideal for answering questions such as "does CRF 22 lose much compared with CRF 18?" or "is preset slow worth it over medium?". They are less useful for comparing videos from different sources.
PSNR: Peak Signal-to-Noise Ratio
PSNR calculates the mean squared error between source and encoded pixels and expresses it on a logarithmic decibel scale. Higher is better. For typical 8-bit lossy video, scores in the high 30s to mid 40s dB generally mean good quality, and lossless output gives an infinite score. These ranges are only rough guides and vary with content.
Strengths: it is simple, fast, well understood and reproducible, and good for spotting large differences or regressions.
Weaknesses: it treats every pixel error equally, which isn't how people see. Slight blurring across a whole frame can score worse than an ugly block artefact in one spot. Encoders tuned for psychovisual quality (for example x264's default psy-rd) can score lower PSNR while looking better, because they keep grain and texture instead of smoothing it away.
SSIM: Structural Similarity Index
SSIM compares local windows of the image for luminance, contrast and structure, on the idea that the eye is tuned to structure rather than absolute pixel values. Scores range up to 1.0 (identical). Good encodes usually land above roughly 0.95, and very high-quality encodes often score above 0.98. Because the useful differences are crammed close to 1.0, SSIM is sometimes shown in decibels as well. FFmpeg prints both.
SSIM matches human judgement better than PSNR for many distortions, but it still misses some, and it doesn't account for motion between frames. MS-SSIM (multi-scale) is a common variant that evaluates several resolutions.
VMAF: Video Multimethod Assessment Fusion
VMAF was developed by Netflix with academic partners and released as open source (libvmaf). It computes several elementary features, including visual information fidelity at several scales, a detail-loss measure and a simple motion feature. It then combines them with a support vector machine model trained on scores from human viewers. The result, from 0 to 100, aims to predict the mean opinion score a viewer would give.
Some practical points:
- The model matters. The default model assumes a 1080p display viewed from about three times the screen height. There is a separate 4K model for viewing from closer up. Absolute scores from different models aren't comparable.
- Don't compare across resolutions directly. The VMAF project specifically warns against comparing the score of a 480p encode with that of a 1080p encode. To judge a lower-resolution encode, scale it back up to the reference resolution before scoring.
- Interpreting scores. Very roughly, scores in the 90s are generally considered excellent and hard to tell from the source in normal viewing. Many practitioners target somewhere in the low to mid 90s for high-quality delivery. Differences of a point or two are usually hard to see. Research on "just noticeable difference" steps suggests the visible threshold varies with content and conditions, so treat any fixed rule with caution.
- It can be gamed. Sharpening or contrast enhancement can push VMAF up without real improvement. libvmaf includes a "NEG" (no enhancement gain) model variant for codec comparisons where that matters.
Quick comparison
| PSNR | SSIM | VMAF | |
|---|---|---|---|
| Measures | Pixel error | Local structure, contrast, luminance | Learned blend of features, predicting human ratings |
| Scale | dB, higher is better | Up to 1.0 | 0-100 |
| Matches perception | Weakly | Moderately | Best of the three for typical compression artefacts |
| Speed | Very fast | Fast | Slower |
| FFmpeg filter | psnr | ssim | libvmaf (build must include it) |
Running the metrics with FFmpeg
In these examples, the encoded file comes first and the original second. Both must have the same resolution and frame count, and start at the same frame.
PSNR:
ffmpeg -i encoded.mp4 -i original.mp4 -lavfi psnr -f null -
SSIM:
ffmpeg -i encoded.mp4 -i original.mp4 -lavfi ssim -f null -
VMAF (in current FFmpeg the first input is the distorted video and the second is the reference):
ffmpeg -i encoded.mp4 -i original.mp4 -lavfi libvmaf -f null -
The summary score is printed at the end of the console output. To check whether your FFmpeg build includes VMAF, run ffmpeg -filters and look for libvmaf. Many builds include it, but not all.
Common pitfalls
- Misaligned frames. If the encode dropped, added or shifted frames, for example after a frame rate change or a trim that wasn't frame-accurate, every score will be badly wrong. Check the frame counts match.
- Different resolutions. Scale the encode to the reference size inside the filter graph before comparing.
- Colour range or format mismatches. A limited-range versus full-range mismatch, or a pixel format change, lowers scores for reasons unrelated to compression.
- Mixing up the inputs. PSNR is symmetric, but VMAF is not. Put the distorted file first.
Using metrics well
Metrics are best for relative decisions on the same source. Encode a representative clip at several settings, score each one, and plot quality against file size. The point where the curve flattens, so that extra bits barely raise VMAF, is usually your sweet spot. This is exactly how you can choose a CRF value objectively, or decide whether CRF or two-pass serves a delivery better.
Look at the minimum or low-percentile frame scores as well as the average. A good average can hide a few badly damaged scenes, such as fades, fast pans or dark shots. Finally, watch the worst-scoring sections yourself. Metrics are a guide to where to look, not a replacement for your eyes. They are especially useful when you compare hardware and software encoders, as in our NVENC vs x264 comparison, or tune a quality-first compression setup.
Doing it with Movie Encoder
Movie Encoder's Quality Lab runs real test encodes of a sample at several settings, for example CRF 18-26, and measures PSNR, SSIM and VMAF for each one. VMAF is available when the FFmpeg build includes libvmaf. The Lab compares file size and encoding time too, shows the results as charts, and includes a side-by-side A/B view so you can check the numbers by eye.
When you've found the setting you like, you can apply it directly to your encode or batch queue.
Frequently asked questions
What is a good VMAF score?
Scores in the 90s are generally considered excellent, and many people target the low to mid 90s for high-quality delivery. The right target depends on content, viewing conditions and the model used.
Which is better, PSNR or SSIM?
SSIM usually tracks human judgement better than PSNR because it looks at structure rather than raw pixel error. VMAF tends to match perception better than either for typical compression artefacts.
Why is my VMAF score unexpectedly low?
Common causes are frames that are out of alignment, different resolutions, colour range mismatches, or putting the reference and encoded files in the wrong order.
