using C++ opencv on ubuntu : cvCaptureFromAVI() doesn't work


Staff member
I'm trying to use OpenCV library on pandaboard ubuntu 12.04.

So I installed Opencv2.4.2 version and the code is beneath.

#include <stdio.h>
#include <stdlib.h>
#include "opencv2/opencv.hpp"

int main*int argc, char** argv)
    cvNamedWindow("origin", CV_WINDOW_AUTOSIZE);

    CvCapture *capture = cvCaptureFromAVI("hkleecv-desktop:/home/hkleecv/OpenCV-2.4.2/samples/cpp/captured.avi");

    IplImage *frameOrigin;

    if(!capture0 return 1;

    int key = 0;
    int fps = (int)cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);

    while(key != 'q')
        frameOrigin = cvQueryFrame(capture);

        cvShowImage("origin", frameOrigin);

        key = cvWaitKey(1000/fps);




The problem is this program can't grab frames from the avi file.
(this code worked well on VS2010 C++)

when I run the program on the shell with gdb, it just return message "Inferior 1 (process nnnn) exited with code 01"

I googled about this error and found a page posted by someone who had similar problem as me, but cvCaptureFromAVI() isn't working currently.

<li><a href="" rel="nofollow"></a></li>
<li><a href="" rel="nofollow"></a></li>

can someone tell me what can I do from here to make cvaptureFromAVI() work?