title: How to get video frame by frame from stream using openCV and python
body: <p>I'm using VLC media player to stream .mp4 video using http. Streaming works fine (i was able to attach to this stream using another instance of VLC).
  Now I want to connect to this stream using OpenCV with python 2.7 and get video frame by frame.</p>
  
  <p>This is modified tutorial code (which works perfectly fine with local file):</p>
  
  <pre><code>&lt;code&gt;
  import numpy as np
  import cv2    
  address = '10.0.0.71' # this is my stream ip address
  port = 8080 # this is stream port
  
  # should I use socket somehow?
  # found this somewhere, no idea what this do
  # import socket
  # msocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) 
  # msocket.connect((address, port))
  
  cap = cv2.VideoCapture('file.mp4') # how to use VideoCapture with online stream?     
  
  # just showing video to screen
  while(cap.isOpened()):
      ret, frame = cap.read()
      cv2.imshow('frame', frame)
  
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p></p>
  
  <p>Please help.</p>