title: What does ret and frame mean here?
body: <p>When to use ret and frame? What values do these variables hold?
  I have just started with image processing, so if there are more changes do let me know.</p>
  
  <p>Thank you</p>
  
  <pre><code>import numpy as np
  import cv2
  cap = cv2.VideoCapture('Sample Lap HUL_OB_1.56.641_Graphic.mpg')
  
  # Define the codec and create VideoWriter object
  # fourcc = cv2.cv.CV_FOURCC(*'MJPG')
  out = cv2.VideoWriter('output.mpg',0, 60.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
  # Release everything if job is finished
  cap.release()
  out.release()
  cv2.destroyAllWindows()
  </code></pre>