cvRetrieveFrame crahses
- by pooh_bear
I'm trying to write a simple openCV code that create a capture and retrieves the first frame from it.
**CvCapture *m_pCapfile = cvCreateFileCapture(m_aviFileName.c_str());
if (m_pCapfile)
m_frames = cvRound(cvGetCaptureProperty(m_pCapfile, CV_CAP_PROP_FRAME_COUNT));
cvSetCaptureProperty(m_pCapfile, CV_CAP_PROP_POS_FRAMES, 0);
int ret = cvGrabFrame( m_pCapfile);
IplImage *cap = cvRetrieveFrame( m_pCapfile);**
In m_frames is have 153, which is the correct number of frames as far as I know.
cvGrabFrame returns 1 to ret however cvRetrieveFrame crashes.
I tries using cvCaptureFromFile and cvCaptureFromAVI instead of cvCreateFileCapture
In both cases cvRetrieveFrame method crashes.
Any ideas?
Thanks