Skip to content

Compare encoding quality with metrics and visual checks

needs review

Metrics are useful only when the reference and distorted streams represent the same frames in the same geometry and color domain. First verify frame rate, timestamps, duration, crop, scale, pixel format, and color conversion.

The first input below is the distorted encode and the second is the reference:

Terminal window
ffmpeg -i distorted.mkv -i reference.mkv \
-lavfi '[0:v][1:v]psnr=stats_file=psnr.log' \
-f null -
Terminal window
ffmpeg -i distorted.mkv -i reference.mkv \
-lavfi '[0:v][1:v]ssim=stats_file=ssim.log' \
-f null -

An FFmpeg build with libvmaf can also calculate VMAF and write structured output:

Terminal window
ffmpeg -i distorted.mkv -i reference.mkv \
-lavfi "[0:v][1:v]libvmaf=log_fmt=json:log_path=vmaf.json" \
-f null -
  • Preserve per-frame logs, not just an average.
  • Inspect the lowest-scoring and visually important frames.
  • Compare multiple metrics that fail in different ways.
  • Perform blind or controlled visual comparisons on representative displays.
  • Record the exact command, build versions, source checksum, and any preprocessing.

A higher aggregate score does not automatically mean that viewers will prefer an encode, and a small score difference may not be meaningful. Use metrics to find tradeoffs and outliers, then confirm them visually.