![]() nd_header('Content-Length', len(frame))Ĭlass StreamingServer(socketserver.ThreadingMixIn, server.HTTPServer): nd_header('Content-Type', 'multipart/x-mixed-replace boundary=FRAME') nd_header('Cache-Control', 'no-cache, private') nd_header('Content-Length', len(content)) # New frame, copy the existing buffer's content and notify allĬlass StreamingHandler(server.BaseHTTPRequestHandler): This is the code I've adapted ( ): import io I've tried various edits, but it won’t respond to a GPIO input to tell it to stop streaming and then move on to the camera capture part of the script. ![]() ![]() But the serve_forever command means that it’s permanently streaming (unsurprisingly!) and won't move out of it to go back to capture. I've managed to get the button to work to move from capture mode to streaming mode, and the streaming script appears to work perfectly. I’ve managed to get the PIR sensor and automatic camera capture working, but I’d like to have a streaming mode in the same script which allows me to view the camera feed on my phone when I’m first positioning the camera to check it’s got a good view (toggled by a button wired to one of the GPIO pins). I’m very new to Python and have been struggling with the code for a wildlife camera project on the Pi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |