title: OpenCV VideoCapture does not work in Flask project but works in basic example
body: <p>Im trying to stream a simple Video Capture to a Web Browser with the Flask framework.</p>
  
  <p>Im using the code from <a href="https://github.com/desertfury/flask-opencv-streaming" rel="nofollow noreferrer">here</a> to stream the Camera feed.</p>
  
  <p>When I start the server it shows this error:</p>
  
  <blockquote>
    <p>[ WARN:0] global /io/opencv/modules/videoio/src/cap_v4l.cpp (887) open VIDEOIO(V4L2:/dev/video0): can't open camera by index</p>
  </blockquote>
  
  <p>But when I run a sample code like this it works fine:</p>
  
  <pre><code>import cv2
  cap = cv2.VideoCapture(0)
  while True:
  
  ret, frame = cap.read()
  cv2.imshow('frame',frame)
  if cv2.waitKey(1) &amp; 0xFF == ord('q'):
      break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>Does somebody know a fix for this?
  It would be super helpful to me if you could also provide an alternative on how to send a video stream like this to an android device, as this was my initial goal.
  Thank You!</p>