Tutorial

Retrieve Video File SSIM Value with ffmpeg

The SSIM (Structural Similarity Index) value is a measure of image or video similarity. FFmpeg can be used to retrieve this value for a given video file.

Install ffmpeg (if not already installed):

Open Command Prompt or Terminal

Open a Command Prompt or Terminal and navigate to the folder where the video you want to convert is located.

Calculate SSIM value with ffmpeg:

ffmpeg -i src.mp4 -i compressed.mp4 -lavfi ssim -f null -

Example Output:

[Parsed_ssim_0 @ 0000024cfac4d400] SSIM Y:0.990714 (20.321925) U:0.991228 (20.569242) V:0.991626 (20.770597) All:0.990952 (20.434485)

This output shows the SSIM value for the video you just analyzed with FFmpeg. The expression "SSIM Y: 0.990714" means that the SSIM value for the Y channel of the video is 0.990714. This value is on a scale from 0 to 1, with 1 representing a perfect match.

The numbers in parentheses (20.321925) are the SSIM metric values on another scale. These values are calculated from the SSIM indices and can be used to evaluate the similarity of images or videos on a consistent scale.

The same applies to the U and V channels (U:0.991228, V:0.991626) and the overall similarity (All:0.990952). The higher these values are, the more similar the two videos are.