3 This script will test highgui's video reading functionality
6 # name of this test and it's requirements
7 TESTNAME = "cvGrabFrame"
8 REQUIRED = ["cvCreateFileCaptureRGBA"]
11 # needed for sys.exit(int) and .works file handling
16 # path to imagefiles we need
17 PREFIX=os.path.join(os.environ["srcdir"],"../../opencv_extra/testdata/python/videos/")
20 # check requirements and delete old flag file, if it exists
21 if not works.check_files(REQUIRED,TESTNAME):
24 # import the necessary things for OpenCV
29 # create a video reader using the tiny video 'uncompressed.avi'
30 video = cvCreateFileCapture(PREFIX+"uncompressed.avi")
32 # call cvGrabFrame to grab a frame and save return value
33 res = cvGrabFrame(video)
36 print "(ERROR) Couldn't call cvGrabFrame()."
39 # ATTENTION: We do not release the video reader, window or any image.
40 # This is bad manners, but Python and OpenCV don't care...
42 # create flag file for sollowing tests
43 works.set_file(TESTNAME)