def camera_save(file_name, seconds=3, fps=60):
    camera_capture = cv2.VideoCapture(0)
    size = (int(camera_capture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(camera_capture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
    video_writer = cv2.VideoWriter(file_name, cv2.VideoWriter_fourcc('I', '4', '2', '0'), fps, size)
    (success, frame) = camera_capture.read()
    num_frames_remaining = ((seconds * fps) - 1)
    while (success and (num_frames_remaining > 0)):
        video_writer.write(frame)
        (success, frame) = camera_capture.read()
        num_frames_remaining -= 1
    camera_capture.release()
def camera_save(file_name, seconds=3, fps=60):
    camera_capture = cv2.VideoCapture(0)
    size = (int(camera_capture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(camera_capture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
    video_writer = cv2.VideoWriter(file_name, cv2.VideoWriter_fourcc('I', '4', '2', '0'), fps, size)
    (success, frame) = camera_capture.read()
    num_frames_remaining = ((seconds * fps) - 1)
    while (success and (num_frames_remaining > 0)):
        video_writer.write(frame)
        (success, frame) = camera_capture.read()
        num_frames_remaining -= 1
    camera_capture.release()