title: opencv Unable to stop the stream: Inappropriate ioctl for device
body: <p>I just want to convert video to frame images.</p>
  
  <p>Using this simple code</p>
  
  <pre><code>import cv2
  vidcap = cv2.VideoCapture('gog.mp4')
  success,image = vidcap.read()
  count = 0
  success = True
  while success:
    success,image = vidcap.read()
    print 'Read a new frame: ', success
    cv2.imwrite("frame%d.jpg" % count, image)
    count += 1
  </code></pre>
  
  <p>output is</p>
  
  <blockquote>
    <p>Unable to stop the stream: Inappropriate ioctl for device</p>
  </blockquote>
  
  <p>I am using python  2.7.6 on ubuntu server.</p>