1 | initial version |
size = cvSize(
(int)cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH),
(int)cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT)
);
fps = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
writer = cvCreateVideoWriter(
"Live Stream",
CV_FOURCC('M', 'J', 'P', 'G'),
fps,
size,
1
);
while(1)
{
IplImage* frame = cvQueryFrame(capture);
if(!frame)
break;
cvWriteFrame(writer,frame);
cvShowImage("Live Stream", frame);
c = cvWaitKey(33);
if(c == 27)
{
cvReleaseVideoWriter(&writer);
break;
}
}
(and promise, to use the c++ api, the next time ;)