1. Read the video
2. Save the video
I’m going to use this class
CV2. VideoWriter (videooutpath fourcc, 20.0, (1280960), True)
Videooutpath Output file name
Fourcc = cv2. VideoWriter_fourcc(* ‘XVID’) is the specified encoder
20.0 is the frame rate
(1280,960) is the video size
True refers to color
General encoder: “DIVX”,” MJPG”, “XVID”, “X264”
Note: use *’ mp4V ‘if you want to open it on a MacBook
3. Frame by frame
With the first two foundations, it’s easy
The above is all the content of this article, using the method introduced in the article can achieve the routine video frame by frame save, cut off and other operations, interested in learning more programming skills can watch the teaching video to continue learning ~