531f7122703fb142c180e03bec9f4fca5894892a
[opencv] / tests / swig_python / highgui / seek_frame_mpeg4.py
1 #! /usr/bin/env python
2
3 """
4 This script checks HighGUI's frame seeking functionality
5 on a MPEG4-compressed .mp4 file.
6 """
7
8 # name if this test and it's requirements
9 TESTNAME = "seek_frame_mp4"
10 REQUIRED = []
11 ERRORS=[0.042,0.025,0.026,0.025,0.024,0.024,0.026,0.024,0.025,0.024,0.028,0.023,0.024,0.024,0.024,0.024,0.025,0.023,0.027,0.024,0.030,0.025,0.026,0.026,0.026,0.026,0.026,0.024,0.027]
12
13 # needed for sys.exit(int), .works file handling and check routine
14 import sys
15 import works
16 import seek_test
17
18 # check requirements and delete old flag file, if it exists
19 if not works.check_files(REQUIRED,TESTNAME):
20         sys.exit(77)
21
22 # name of file we check here
23 FILENAME='mpeg4.mp4'
24
25 # run check routine
26 result=seek_test.seek_frame_ok(FILENAME,ERRORS)
27
28 # create flag file for following tests
29 works.set_file(TESTNAME)
30
31  # return result of test routine
32 sys.exit(result)