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.
Calculate PSNR or SSIM
Section titled “Calculate PSNR or SSIM”The first input below is the distorted encode and the second is the reference:
ffmpeg -i distorted.mkv -i reference.mkv \ -lavfi '[0:v][1:v]psnr=stats_file=psnr.log' \ -f null -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:
ffmpeg -i distorted.mkv -i reference.mkv \ -lavfi "[0:v][1:v]libvmaf=log_fmt=json:log_path=vmaf.json" \ -f null -Interpret the results
Section titled “Interpret the results”- 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.