#include <opencv2\opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
VideoCapture cap("E:\Videos\\Megamind.avi");
if (!cap.isOpened())
return -1;
Mat frame;
while (cap.grab())//下一帧是否为空
{
cap >> frame;
imshow("video", frame);
/* if (waitKey(10) >= 0)
{
break;
}*/
char c = waitKey(20);
if (c == 27)break;
}
//system("pause");
return 0;
}
时间: 2024-10-11 04:47:35