#include #include #include #include #include using namespace cv; using namespace std; int main(int argc, char** argv) { int count=100; string str = argv[1]; string res=str.substr(10); VideoCapture capture(stoi(res), CAP_V4L2); capture.set(CAP_PROP_FOURCC, VideoWriter::fourcc('U','Y','V','Y')); capture.set(CAP_PROP_FRAME_WIDTH, 3840); capture.set(CAP_PROP_FRAME_HEIGHT, 2160); while (count) { Mat frame; capture >> frame; if (frame.empty()) { break; } int h = frame.rows; int w = frame.cols; const char *name = "video"; namedWindow(name, 0); imshow(name, frame); waitKey(30); count--; } return 0; }