title: How to get image from video using opencv python
body: <p>I want to get image from video and store it in '.jpeg' or '.png' format please help me how to do this with opencv My code is</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import cv2
  vidcap = cv2.VideoCapture('video1.mp4')
  success,image = vidcap.read()
  count = 0;
  print "I am in success"
  while success:
    success,image = vidcap.read()
    cv2.imwrite("frame%d.jpg" % count, image)     # save frame as JPEG file
    if cv2.waitKey(10) == 27:                     # exit if Escape is hit
        break
    count += 1</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here i am trying to get the image from video frame by frame and save it as frame1,frame2,frame3</p>