title: Reading stream from IP camera with cv2.VideoCapture()
body: <p>Referring to this similar question <a href="https://stackoverflow.com/questions/21702477/how-to-parse-mjpeg-http-stream-from-ip-camera">How to parse mjpeg http stream from ip camera?</a> I was able to read the stream from IP camera, by using <code>requests</code>:</p>
  
  <pre><code>stream = requests.get('http://&lt;user&gt;:&lt;pass&gt;@&lt;addr&gt;:&lt;port&gt;/videostream.cgi', stream=True)
  
  bytez = ''
  while True:
      bytez += stream.raw.read(16384)
      ...
  </code></pre>
  
  <p>and it works beautifully, but would like to get there by using <code>cv2.VideoCapture()</code> instead requests.</p>
  
  <p>I tried variations in a manner of:</p>
  
  <pre><code>cap = cv2.VideoCapture()
  cap.open('http://&lt;user&gt;:&lt;pass&gt;@&lt;addr&gt;:&lt;port&gt;/videostream.cgi?.mjpg')
  
  while(True):
      ret, frame = cap.read()
      ...
  </code></pre>
  
  <p>but wasn't able to get anything, but Exception about empty frame.</p>
  
  <p>How to read IP camera stream with cv2.VideoCapture()?</p>