Is it possible to stream video from https:// (e.g. YouTube) into python with OpenCV?
<p><a href="http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html" rel="noreferrer">This link</a> has a tidy little example of how to use python's OpenCV library, <code>cv2</code> to stream data from a camera into your python shell. I'm looking to do some experiments and would like to use the following YouTube video feed: <code>https://www.youtube.com/watch?v=oCUqsPLvYBQ</code>. </p>

<p>I've tried adapting the example as follows: </p>

<pre><code>import numpy as np
import cv2

cap = cv2.VideoCapture('https://www.youtube.com/watch?v=oCUqsPLvYBQ')

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Display the resulting frame
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) &amp; 0xFF == ord('q'):
        break
</code></pre>

<p>Which produces the error: </p>

<pre><code>WARNING: Couldn't read movie file https://www.youtube.com/watch?v=oCUqsPLvYBQ
OpenCV Error: Assertion failed (size.width&gt;0 &amp;&amp; size.height&gt;0) in imshow, file /tmp/opencv20160107-29960-t5glvv/opencv-2.4.12/modules/highgui/src/window.cpp, line 261
</code></pre>

<p>Is there a simple fix that would allow me to stream this video feed into my python shell via <code>cv2</code>? Not absolutely committed to <code>cv2</code>, either, if there are other libraries out there that will accomplish the same purpose. </p>