0

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

0

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];[0v][1v]ssim=f=stats.log" -f null -

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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