I would like to be able to take a single video, run it through ffmpeg, and have it spit out a log containing the SSIM of each frame with respect to the previous - that is, I want the SSIM scores comparing the previous frame to the current one.

I am attempting to do so by running ffmpeg with the same video input twice, with the second input skipping ahead by one frame.

ffmpeg -i .\a.mp4 -i .\a.mp4 -filter_complex "[1:v]select=gte(n\,1)[f]" -map 0:v:0 -map "[f]" -lavfi ssim -f null -

When attempting to run this, I am given the error:

Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_ssim_0

Is there a way I can correct this so that the second input skips one frame and both are run through -lavfi ssim?

1 Answer 1


You have to perform all filtering in a single filtergraph.

ffmpeg -i .\a.mp4 -i .\a.mp4 -filter_complex "[0:v]setpts=N/FR/TB[v0];[1:v]select=gte(n\,1),setpts=N/FR/TB[v1];[v0][v1]ssim=f=stats.log" -f null -

  • ffmpeg says Filter setpts has an unconnected output is this normal?
    – est
    Apr 28 at 6:37
  • No see edited answer
    – Gyan
    Apr 28 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.