4

I'm working on software that will create MP4 videos using the MLT Framework. I need to create some unit tests for my processes that will compare a pre-testing creating video with the one that is created. I am using Python for the code. I need to ensure that the content of the videos is the same. What are the ways that I can programmatically compare the two videos?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Mark S.
  • 1,516
  • 1
  • 16
  • 26
  • Both files will be byte by byte equal? – Cesar Canassa Dec 21 '11 at 20:41
  • By "the content of the videos is the same", do you mean "visually about the same", "bit-for-bit identical MPEG streams", or something in between? Keep in mind that the output of an MP4 encoder may not be entirely deterministic. –  Dec 21 '11 at 20:42
  • That's also part of the issue, I'm not sure what the best way to compare them is. I need to make sure that if I create a video that is made up from a 2 clips with a fade transition between the two it will come out the same each time given the same inputs. Since I am doing this for unit testing, I need to do it programatically. So it's probably in between the two choices from @duskwuff. – Mark S. Dec 21 '11 at 20:49

1 Answers1

4

One common metric for comparing video files is SSIM (structural similarity) -- videos with a high SSIM are likely to be "equal".

There are a number of tools available for calculating the SSIM of two video files; one such tool is available at: https://github.com/kahkeng/vqats