using namespace cv; bool try_use_gpu = true; Stitcher::Mode mode = Stitcher::PANORAMA; vector<Mat> imgs; string result_name = "abmks.jpg"; int main(int argc, char* argv[]) { VideoCapture cap1("C:/Users/Austin/Desktop/xxx.avi"); // open the video file for reading VideoCapture cap2("C:/Users/Austin/Desktop/xx.avi"); VideoCapture cap3("C:/Users/Austin/Desktop/x.avi"); double fps1 = cap1.get(CV_CAP_PROP_FPS); //get the frames per seconds of the video double fps2 = cap2.get(CV_CAP_PROP_FPS); double fps3 = cap3.get(CV_CAP_PROP_FPS); //namedWindow("MyVideo1", CV_WINDOW_AUTOSIZE); //create a window called "MyVideo" //namedWindow("MyVideo2", CV_WINDOW_AUTOSIZE); double dWidth = cap1.get(CV_CAP_PROP_FRAME_WIDTH); //get the width of fr ames of the video double dHeight = cap1.get(CV_CAP_PROP_FRAME_HEIGHT); //get the height of frames of the video //printf("%lf , %lf", dWidth, dHeight); Size frameSize(720,480); VideoWriter oVideoWriter("D:/MyVideo3.avi", CV_FOURCC('P', 'I', 'M', '1' ), 24, frameSize, true); //initialize the VideoWriter object while (1) { Mat frame1; Mat frame2; Mat frame3; bool bSuccess1 = cap1.read(frame1); // read a new frame from vid eo bool bSuccess2 = cap2.read(frame2); bool bSuccess3 = cap3.read(frame3); /*if (!bSuccess1) //if not success, break loop { cout << "Cannot read the frame from video file" << endl; break; }*/ //imshow("MyVideo1", frame1); //imshow("MyVideo2", frame2);//show the frame in "MyVideo" windo w //waitKey(100);