Hi, I am having an issue with OpenCV version 2.1, 2.0 on windows VS2008.
I am attempting to open an uncompressed .avi video to grab frames from it. The VideoCapture class works to capture from an attached camera, and it compiles, making me think it is not a location/missing file error. The code is:

#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
//In a function
VideoCapture vid("C:/Pete/video/myvid.avi");

This line breaks every time, with any file path. The error is:

Unhandled exception at 0x7855bdbc in VineModel.exe: 0xC0000005: Access violation reading location 0xcccccccc.

And the debugger takes me to the pointed at line

_Myt& __CLR_OR_THIS_CALL assign(const _Elem *_Ptr)
	{	// assign [_Ptr, <null>)
	_DEBUG_POINTER(_Ptr);
	return (assign(_Ptr, _Traits::length(_Ptr)));
	}// <----This line is pointed to

Any idea's would be appreciated. Thanks

Looks like you're accessing a NULL pointer. Are you sure your file opened correctly (and exists for that matter) ?

I have solved the problem: The OpenCV library needed to be rebuilt. It now successfully reads and grabs frames from file. It was a null pointer, but it was the function not existing in the library (just in the header) rather than the filename.
Thanks.

This might be a stupid question, but how do you rebuild the library, because it doesn't work if I rebuild my project. (I'm working in VS2008)

This question has already been answered. Start a new discussion instead.