print(cv2.isOpened())
fourcc = cv2.cv.CV_FOURCC(*'XVID')
out = cv2.VideoWriter('output_video.avi', fourcc, 20.0, (640, 360))
print(out.isOpened())
cap.release()
out.release()
How to install python opencv through Conda?