Ask Your Question

Revision history [back]

OpenCV 2.4.3 VideoCapture not working on *.avi file input

I am running two openCV versions on my system: - Visual Studio 2010 - Windows 7 x64 - OpenCV 2.3.1 and OpenCV 2.4.3 running - Using precompiled .lib and .dll files for my system

Im trying to compare GPU functionality between CPU and GPU performance. However, using the VideoCapture C++ interface for reading frame by frame, doesn't work anymore in version 2.4.3. Reading a frame and directly displaying it into a named window, results in a blank screen. No errors are produced but the frame isn't correctly imported and seems to be corrupt.

Anyone has an idea on what could be the problem?

Code to recreate the exact problem:

// Input path of video file
std::string path = "D:\\outputVideo\\outputVideo.avi";
VideoCapture capture(path);
Mat frame;
// Retrieve a single frame from the capture
capture.read(frame);
// Display the frame
imshow(window_name, frame);
// Wait until key is pressed, before closing the window
int c = waitKey(0);