#include#include using namespace cv; using namespace std; int main(int argc, char** argv) { VideoCapture video; video.open("D:/au/2.mp4"); if (!video.isOpened()) { cout << "open video failed!" << endl; getchar(); return -1; } cout << "open video success!" << endl; Mat frame; namedWindow("video"); for (;;) { if (!video.read(frame)) { break; } int cur = video.get(CAP_PROP_POS_frameS); if (cur > 90) { video.set(CAP_PROP_POS_frameS, 0);//大于90帧数就从新跳转到帧数为0的地方 continue;//继续循环 } if (frame.empty())break; imshow("video", frame); waitKey(30); } waitKey(0); return 0; }



