title: Video Streaming from IP Camera in Python Using OpenCV cv2.VideoCapture
body: <p>I am trying to get video stream in python from IP camera but i am getting an error. I am Using Pycharm IDE.</p>
  
  <pre><code>import cv2
  scheme = '192.168.100.23'
  
  
  host = scheme
  cap = cv2.VideoCapture('http://admin:Ebmacs8485867@'+host+':81/web/admin.html')
  
  while True:
      ret, frame = cap.read()
  
      # Place options to overlay on the video here.
      # I'll go over that later.
  
      cv2.imshow('Camera', frame)
  
      k = cv2.waitKey(0) &amp; 0xFF
      if k == 27:  # esc key ends process
          cap.release()
          break
  cv2.destroyAllWindows()
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>Error:
  "E:\Digital Image Processing\python\ReadingAndDisplayingImages\venv\Scripts\python.exe" "E:/Digital Image Processing/python/ReadingAndDisplayingImages/ReadandDisplay.py"
  Traceback (most recent call last):
    File "E:/Digital Image Processing/python/ReadingAndDisplayingImages/ReadandDisplay.py", line 14, in &lt;module&gt;
      cv2.imshow('Camera', frame)
  cv2.error: OpenCV(4.0.1) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width&gt;0 &amp;&amp; size.height&gt;0 in function 'cv::imshow'
  
  warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
  warning: http://admin:Ebmacs8485867@192.168.100.23:81/web/admin.html (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
  </code></pre>