Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app = Flask(__name__)
- video_stream = VideoCamera()
- @app.route('/')
- def index():
- return render_template('index.html')
- def gen(camera):
- while True:
- frame = camera.get_frame()
- yield (b'--framern'
- b'Content-Type: image/jpegrnrn' + frame + b'rnrn')
- @app.route('/video_feed')
- def video_feed():
- return Response(gen(video_stream),
- mimetype='multipart/x-mixed-replace; boundary=frame')
- if __name__ == '__main__':
- app.run(host='127.0.0.1', debug=True,port="5000")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement