NakulLakhotia / Live-Streaming-using-OpenCV-Flask

A Flask Web-App to stream live from local webcam or CCTV (rtsp link)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a comment

mauringo opened this issue · comments

commented

Hi man,

COOL example!

Actually it might be possible that in debug mode the web camera isn't working right. debug=Flase solved for me.
You can add a comment

if name == 'main':
app.run(debug=True) - #try debug=False if not working otherwise

Or do the following:-

if os.environ.get('WERKZEUG_RUN_MAIN') or Flask.debug is False:
camera = cv2.VideoCapture(0)

as suggested in the link here. https://stackoverflow.com/questions/61047207/opencv-videocapture-does-not-work-in-flask-project-but-works-in-basic-example