imutils VideoStream returns NoneType while integrating with flask
问题 So i want to create a video stream using imutils VideoStream and put it on the web. This is the Code: camera_web.py from flask import Flask, render_template, Response from imutils.video import VideoStream from imutils.video import FPS import cv2 app = Flask(__name__) vs = VideoStream(src=0).start() @app.route('/') def index(): """ Video streaming home page """ return render_template('index.html') def gen(): rval, frame = vs.read() cv2.imwrite('t.jpg', frame) yield (b'--frame\r\n' b'Content