VideoCapture cap(0);
int fps = cap.get(CV_CAP_PROP_FPS);
Size size = Size(cap.get(CV_CAP_PROP_FRAME_WIDTH), cap.get(CV_CAP_PROP_FRAME_HEIGHT));
VideoWriter writer("922.avi", CV_FOURCC('X', 'V', 'I', 'D'), fps, size);
Mat frame;
while (cap.isOpened())
{
cap >> frame;
if (frame.empty())
{
printf("frame is empty!\n");
break;
}
writer.write(frame);
imshow("image", frame);
if (waitKey(33) == 27)
break;
}
int fps = cap.get(CV_CAP_PROP_FPS);
Size size = Size(cap.get(CV_CAP_PROP_FRAME_WIDTH), cap.get(CV_CAP_PROP_FRAME_HEIGHT));
VideoWriter writer("922.avi", CV_FOURCC('X', 'V', 'I', 'D'), fps, size);
Mat frame;
while (cap.isOpened())
{
cap >> frame;
if (frame.empty())
{
printf("frame is empty!\n");
break;
}
writer.write(frame);
imshow("image", frame);
if (waitKey(33) == 27)
break;
}