andersson4003
So when I run a stream function (seen below), my camera starts a stream and all is good. BUT after running it a few times a day and after a couple of days it stops working and I get this error code:
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM) mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/picamera/camera.py", line 456, in _init_camera self._camera = mo.MMALCamera() File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2279, in init super(MMALCamera, self).init() File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 631, in init mmal_check( File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check raise PiCameraMMALError(status, prefix) picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory
After allocating more memory to the GPU the script runs as espected again BUT after a few days it happens again! Why is this and how do i fix it? Rebooting does nothing.
def main():
StreamProps = ps.StreamProps
StreamProps.set_Page(StreamProps,HTML)
address = (raspberry_ip, port)
StreamProps.set_Mode(StreamProps,'picamera')
with picamera.PiCamera(resolution='640x480', framerate=30) as camera:
output = ps.StreamOut()
StreamProps.set_Output(StreamProps,output)
camera.rotation = 0
camera.start_recording(output, format='mjpeg')
try:
server = ps.Streamer(address, StreamProps)
print('Server started at','http://'+address[0]+':'+str(address[1]))
server.serve_forever()
finally:
camera.stop_recording()