I was testing this code, and I found that if you set [debug=True] in Flask, for some reason the cv2.VideoCapture doesn't like to start