2👍
Use a separate thread for the cv2 function call and the app should work like a charm. From what I figure..infinite loading is probably because the video never ceases recording and hence the code further up ahead is never taken into account, ergo an infinite loading page. Threads should probably do it.
🙂 🙂
1👍
Am I right that you dream about Django application able to capture video from your camera? This will not work (at least not in a way you expect).
Did you check any stack traces left by your web server (the one hosts Django app or the one started as Django built-in)?
I suggest you start playing with OpenCV a bit just from Python command line. If you’re on Windows use IDLE. Observe behaviour of your calls from there.
Django application is running inside WSGI application server where there are several constraints what a module of particular type can and cannot do. I didn’t try to repeat what you’ve done (I don’t have camera I can access).
Proper way of handling camera in web application requires browser side handling in JavaScript.
Small disclaimer at the end: I’m not saying you cannot use OpenCV at all in Django application, but attempt to access the camera is not a way to go.