Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 19055

Re: OpenCV projects ?

$
0
0

This is my code for video

=========================================================================================

#include <highgui.h>

#include <cv.h>

#include <time.h>

#include <stdio.h>

int main(int argc, char** argv)

{

        char path[255];

        CvCapture* capture = cvCaptureFromCAM(1);

        IplImage* frame = cvQueryFrame( capture );

        CvVideoWriter *writer = cvCreateVideoWriter("/home/kishan/video.avi",CV_FOURCC('M','J','P','G'), 5 ,cvSize(320,240), 1);

        while(1)

        {

                frame = cvQueryFrame(capture);

                if(!frame) break;

                cvWriteFrame(writer, frame);

                char c = cvWaitKey(33);

                if(c==27) break;

        }

        cvReleaseCapture(&capture);

}

======================================================================================================

 

I have debug it using GDB.. It shows me "illegal instruction from /usr/lib/libavcodec.0.53"

I am not able to find out solution for this error


Viewing all articles
Browse latest Browse all 19055

Trending Articles