VideoWriter video("D:/opencv/video_gather/video.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 30, Size(frame_width, frame_height), true );
时间: 2024-01-19 07:02:05 浏览: 86
opencv--video-write.rar_OpenCV videowrite_opencv write avi
This line of code creates a VideoWriter object named "video" that opens a video file located at "D:/opencv/video_gather/video.avi". The codec used to encode the video is "MJPEG" (specified by the fourcc function), with a frame rate of 30 frames per second and a frame resolution of "frame_width" by "frame_height" pixels. The last parameter, "true", indicates that the video file will be written in color (as opposed to grayscale).
阅读全文