-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flask.... #33
Comments
Ahh ... there's actually a couple of good reasons I deliberately avoided Flask for this project, the second of which is rather important:
Basically, it is possible to make a Flask application that does the same thing as pistreaming: just break out the stuff in do_GET into various handlers. Not sure if Flask has anything specific for websockets - so you might want to keep ws4py around or not, depending. However, what you have to be very careful about is that the application never forks (or spawns another copy of itself), and I'm not exactly certain where one would handle starting the recording and shutting down things (given Flask just returns a WSGI application, it's unclear where global init/cleanup goes - there's probably some simple answer though!). You also have to be fairly careful that camera control is handled from the initializing thread (it is possible to do camera control from multiple threads, but you can easily deadlock if you do it from the recording thread which is implicitly started). All in all, if I wanted to stick pistreaming into a larger web-application - I'd be more tempted to reverse proxy it from the existing script rather than deal with shoe-horning it into a framework which wants to do things that the camera firmware really won't like. |
Dear author! Very much I ask you to give a hint how to implement your server code on a python on Flask. Most newbies on a python like me, master the server code exactly by means Flask. Please help). 'm sorry I'm from Russia and I do not speak English well. If he expressed his request as something bad. Excuse me)...
The text was updated successfully, but these errors were encountered: