#include <iostream>
#include "opencv2\opencv.hpp"
using namespace cv;
using namespace std;
int main(void)
{
VideoCapture capture("aaa.avi");
Mat frame;
if(! capture.isOpened())
{
cout << "Not Open" << endl;
return 1;
}
namedWindow("Original Camera");
cout<<"<ESC> - quit the program"<<endl;
while(capture.grab())
{
capture >> frame;
if( (waitKey(33) & 255) == 27 )
{
capture.release();
break;
}
imshow("Original Camera",frame);
// waitKey(0);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSAib3BlbmN2MlxvcGVuY3YuaHBwIgoKdXNpbmcgbmFtZXNwYWNlIGN2Owp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4odm9pZCkKewogICAgVmlkZW9DYXB0dXJlIGNhcHR1cmUoImFhYS5hdmkiKTsKICAgIE1hdCBmcmFtZTsKCiAgICBpZighIGNhcHR1cmUuaXNPcGVuZWQoKSkKICAgIHsKICAgICAgICBjb3V0IDw8ICJOb3QgT3BlbiIgPDwgZW5kbDsKICAgICAgICByZXR1cm4gMTsKICAgIH0KCiAgICBuYW1lZFdpbmRvdygiT3JpZ2luYWwgQ2FtZXJhIik7CiAgICBjb3V0PDwiPEVTQz4gLSBxdWl0IHRoZSBwcm9ncmFtIjw8ZW5kbDsKCiAgICB3aGlsZShjYXB0dXJlLmdyYWIoKSkKICAgIHsKICAgICAgICBjYXB0dXJlID4+IGZyYW1lOwogICAgICAgIGlmKCAod2FpdEtleSgzMykgJiAyNTUpID09IDI3ICkKICAgICAgICB7CiAgICAgICAgICAgIGNhcHR1cmUucmVsZWFzZSgpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgaW1zaG93KCJPcmlnaW5hbCBDYW1lcmEiLGZyYW1lKTsKLy8gICAgICAgIHdhaXRLZXkoMCk7CiAgICB9CgogICAgcmV0dXJuIDA7Cn0KCg==