title: cv2.videowriter writes 0 bytes file (python) (opencv)
body: <p>I am currently doing a motion detection project that records down video when motion is detected. Right now there is no error when recording the video but when i check on the video, it is 0 bytes. Any help would be very much appreciated.</p>
  
  <p>This is my code:</p>
  
  <pre><code>camera = cv2.VideoCapture(0)
  fourcc = cv2.VideoWriter_fourcc(*'XVID')
  out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640, 480))
  </code></pre>