Open chrisbenseler opened 4 years ago
Hi chrisbenseler,
It is a weird issue since I did not face this with Ubuntu 18.04 and Windows 10, it seems cv2.VideoCapture() follows the same logic as cv2.imshow() like in the github issue here: https://github.com/skvark/opencv-python/issues/134
It seems these calls must be from the main thread only and flask (or waitress in this case) creates a thread per each request which causes this issue, I suppose disallowing threaded mode would fix the issue.
Changing the serve() command to include the parameter 'threads=0' or 'threads=1' (not sure which) might solve the issue: https://docs.pylonsproject.org/projects/waitress/en/stable/arguments.html
Or replacing the waitress.serve() with the flask app.run() method with parameter 'threaded=False' might work.
I will try to install a MacOS virtual machine soon and try to help but I can't promise anything as I am currently having a bit of a workload.
When trying to use the live feature, the video does not open and the app crashes. On a MacOS (10.14.5)
The log outputs:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
Any idea?