import cv2

cameraCapture = cv2.VideoCapture(0)
fps = 30
size = (int(cameraCapture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cameraCapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
videoWriter = cv2.VideoWriter('out/my_output_vid.avi', cv2.VideoWriter_fourcc('X', 'V', 'I', 'D'), fps, size)

success, frame = cameraCapture.read()
numFramesRemaining = 10 * fps - 1
while success and numFramesRemaining>0:
    videoWriter.write(frame)
    success, frame = cameraCapture.read()
    numFramesRemaining -= 1
cameraCapture.release()
06b88a2a146e510e75024f267efdf6be2c7f42e2
<mask token>

<mask token>
while success and numFramesRemaining > 0:
    videoWriter.write(frame)
    success, frame = cameraCapture.read()
    numFramesRemaining -= 1
cameraCapture.release()

<mask token>
cameraCapture = cv2.VideoCapture(0)
fps = 30
size = int(cameraCapture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cameraCapture.
    get(cv2.CAP_PROP_FRAME_HEIGHT))
videoWriter = cv2.VideoWriter('out/my_output_vid.avi', cv2.
    VideoWriter_fourcc('X', 'V', 'I', 'D'), fps, size)
success, frame = cameraCapture.read()
numFramesRemaining = 10 * fps - 1
while success and numFramesRemaining > 0:
    videoWriter.write(frame)
    success, frame = cameraCapture.read()
    numFramesRemaining -= 1
cameraCapture.release()

import cv2
cameraCapture = cv2.VideoCapture(0)
fps = 30
size = int(cameraCapture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cameraCapture.
    get(cv2.CAP_PROP_FRAME_HEIGHT))
videoWriter = cv2.VideoWriter('out/my_output_vid.avi', cv2.
    VideoWriter_fourcc('X', 'V', 'I', 'D'), fps, size)
success, frame = cameraCapture.read()
numFramesRemaining = 10 * fps - 1
while success and numFramesRemaining > 0:
    videoWriter.write(frame)
    success, frame = cameraCapture.read()
    numFramesRemaining -= 1
cameraCapture.release()

import cv2

cameraCapture = cv2.VideoCapture(0)
fps = 30
size = (int(cameraCapture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cameraCapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
videoWriter = cv2.VideoWriter('out/my_output_vid.avi', cv2.VideoWriter_fourcc('X', 'V', 'I', 'D'), fps, size)

success, frame = cameraCapture.read()
numFramesRemaining = 10 * fps - 1
while success and numFramesRemaining>0:
    videoWriter.write(frame)
    success, frame = cameraCapture.read()
    numFramesRemaining -= 1
cameraCapture.release()