If we try to instantiate more than one picamera.PiCamera we get the following error:
mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x912f60 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
...
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources
Would it be possible to use the singleton pattern and have always only one PiCamera instance? Is there any major drawbacks? One I can think right now is that changing the camera properties and init arguments may cause confusing behavior.
I'm curious about this because when I instantiate a camera object running a flask server in debug mode, It runs the code twice for some reason and then crashes because of the camera error. I solved by implementing the singleton myself.
If we try to instantiate more than one
picamera.PiCamera
we get the following error:Would it be possible to use the singleton pattern and have always only one PiCamera instance? Is there any major drawbacks? One I can think right now is that changing the camera properties and init arguments may cause confusing behavior.
I'm curious about this because when I instantiate a camera object running a flask server in debug mode, It runs the code twice for some reason and then crashes because of the camera error. I solved by implementing the singleton myself.