Integration Testing and Comparing Videos

August 21, 2013 - 3 minute read -
compare testing gsoc

Commits:

Integration Tests:

I added an extra module which tests the set_compose_mode. This is the first one in the series of tests in which the output video has to be compared to ensure that everything goes as it is expected. i.e. If a PIP mode change has to occur, the test should ensure that it occurs.

Comparing the Output Video

For each test I do the following:

  • I compare key frames of a video to pre-stored frames. eg. If I am testing for changing PIP mode, I will have a two frames - one before the change and one after it. Now if the code which generates these frames from the video is run over the test video, it should generate same frames.
  • For generating key frames, I use ffmpeg. Using ffmpeg's inbuilt key frame selector produces black frames in between which makes comparison difficult. So I conduct the test for 6 seconds. First 3 seconds original video is present. At 3 second exact time from start, the change is made. So the next 3 seconds have the modified output refecting the change. So I take frames at 1.5 and 4.5 second marks. Doing this ensures that I get only those which are indeed needed.
  • After I have both the frames, I use scipy to calculate the zero norm of the two images. Zero norm is difference of the number of zeroes in the images. If the images are identical, the difference of will be exactly 0. Zero norm can take values between 0.0 and 1.0, with 1.0 being the case where the images are not at all similar.

Things to do-

  • Integrate this video comparison into the integration tests
  • Complete tests for all other methods.
  • Add running tests through Travis CI
  • Coverage with coveralls
  • Documentation with readthedocs

Comments Section

Feel free to comment on the post but keep it clean and on topic.

blog comments powered by Disqus