I am swapping from EmguCV to OpenCV so that I can try some of the OpenCV functions that are not yet wrapped by EmguCV. However I'm failing to load my simple test video file, which loads without issue in EmguCV. Looking at the EmguCV source code I notice that they call the OpenCV C functions rather than C++ to initialise capture from a file (or a webcam) so I wrote the following test code (with help from http://stackoverflow.com/a/10260047/575530). Here is my simple code
VideoCapture cap ("sample.wmv");
if(!cap.isOpened())
{
OutputDebugString("Failed to open in C++");
CvCapture* capture = cvCaptureFromAVI("sample.wmv");
if (!capture)
{
OutputDebugString(" but opened in C\n");
}
else
{
OutputDebugString(" in C++ and C\n");
cvReleaseCapture(&capture);
}
return -1;
}
You've probably guessed the punch-line of this 'joke' but the output from that simple fragment of code is
Failed to open in C++ but opened in C
Why? What is going on?
(I'm running OpenCV 2.4.6 on a Windows 8 and a Windows 8.1 machine.)