describe :
import cv2
vc = cv2.VideoCapture('./src.webm')
videoWriter = cv2.VideoWriter('./dst.avi', cv2.VideoWriter_fourcc(*'MJPG'), 30, (640,480))
rval=vc.isOpened()
c = 0
while rval:
rval, frame = vc.read()
# Every time 10 Frame take a picture and put it into the video
if (c % 10 == 0):
# If you save it as an image, use the following code
# cv2.imwrite('YOUR_PATH'+str(c) + '.jpg', frame)
# Compress the original image
img = cv2.resize(frame,(640,480))
videoWriter.write(img)
c = c + 1
vc.release()
videoWriter.release()