title: Error During Saving a video using python and opencv
body: <p>This is the code to save video from the web cam</p>
  
  <pre><code>import numpy  
  import cv2 
  cap = cv2.VideoCapture(0)
  
  # Define the codec and create VideoWriter object 
  fourcc = cv2.VideoWriter_fourcc(*'XVID')  
  out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640,480))
  while(cap.isOpened()):
      ret, frame = cap.read()
      if ret==True:
          frame = cv2.flip(frame,0)
          # write the flipped frame
          out.write(frame)
          cv2.imshow('frame',frame)
          if cv2.waitKey(1) &amp; 0xFF == ord('q'):
              break
      else:
          break
  
  cap.release() 
  out.release() 
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>When I Run It In python it gives the following error</p>
  
  <pre><code>&gt; raceback (most recent call last):    File
  &gt; "C:\Users\Prakash\Desktop\Image Proccessing\c.py", line 6, in &lt;module&gt;
  &gt; fourcc = cv2.VideoWriter_fourcc(*'XVID')  AttributeError: 'module'
  &gt; object has no attribute 'VideoWriter_fourcc'
  </code></pre>
  
  <p>Please help me solve this error</p>