c++,opencv播放视频

#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;
}

上一篇:opencv——播放视频


下一篇:php中mysqli_fetch_assoc()和mysqli_fetch_row()的区别