title: streaming m3u8 file with opencv
body: <p>I am trying to capture a live stream from a GoPro using cv2 in python with the following code:</p>
  
  <pre><code>VIDEO_URL = "http://10.5.5.9:8080/live/amba.m3u8"
  cam = cv2.VideoCapture(VIDEO_URL)
  cv2.namedWindow("GoPro",cv2.CV_WINDOW_AUTOSIZE)
  while True:
      f, im = cam.read()
      cv2.imshow("GoPro",im)
      if cv2.waitKey(5) == 27:
          break
  cam.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>but receive the following errors:</p>
  
  <pre><code>WARNING: Couldn't read movie file http://10.5.5.9:8080/live/amba.m3u8
  OpenCV Error: Assertion failed (size.width&gt;0 &amp;&amp; size.height&gt;0) in imshow, file     /tmp/opencv-MRl1/opencv-2.4.7.1/modules/highgui/src/window.cpp, line 261
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "gopro_simple.py", line 167, in live_stream
      cv2.imshow("GoPro",im)
  cv2.error: /tmp/opencv-MRl1/opencv-2.4.7.1/modules/highgui/src/window.cpp:261: error: (-215) size.width&gt;0 &amp;&amp; size.height&gt;0 in function imshow
  </code></pre>
  
  <p>The stream works in vlc, and the code works with a webcam, so it looks like the problem is that opencv doesn't like the .m3u8 format.  Any ideas / suggestions of how to fix this would be greatly appreciated.  Thanks.</p>