Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PiCameraRuntimeError: Timed out waiting for capture to end with V2 camera #284
When setting up V2 camera I increased the resolution in my capture SW.
Strange thing for me is it runs perfectly for 5-10 hours and then gets into non-recoverable trouble.
2016/05/11 19:48:15 Error: Traceback (most recent call last):
2016/05/11 19:49:15 Error: Traceback (most recent call last):
Probably not the same, but there is an issue being discussed on the forums where the sensor stops responding after a few hours - https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=147744
I'd expect PiCamera to check the return value from mmal_component_enable and fail earlier than this, but is your use case repeatedly opening and closing the camera, or running with the same instance?
only once i create an instance (camera) of the picamera.
Here a snapshot of that part of the code:
with picamera.PiCamera() as camera: saveLogData("Initialise picamera") camera.resolution = (video_width, video_height) camera.framerate = video_framerate camera.rotation = 0 camera.hflip = True camera.vflip = video_vflip camera.video_stabilization = video_stabilization camera.annotate_background = video_annotate_background camera.annotate_frame_num = video_annotate_frame_num camera.CAPTURE_TIMEOUT = 60 # seconds # this is the video where motion detection is executed on camera.start_recording('/dev/null', splitter_port=2, resize=(motion_width,motion_height) ,format='h264', motion_output=DetectMotion(camera, size=(motion_$ # setup thread to keep auto tracking of daytime for exposure daytimechkthread = threading.Thread(target=keepTrackofDayTime, args=[camera]) daytimechkthread.start() # setup webcam feed file snapfilename = filepathsnap + "/" + snapshot_capture_filename snapf = open(snapfilename,'wb') FNT="default" saveLogData("starting main loop picamera") try: while True: timeisnow = dt.datetime.now().strftime('%Y%m%d-%H%M%S') # latest text to show in camera image camera.annotate_text = timeisnow + " " + movement_mode_annotation + exposure_mode_annotation + " " + "md %d, mq %d" % (motion_detected, motion_quite) if getMotionLevel() == 1: # init motion is set setMotionLevel(2) # motion in progress if getMotionLevel() == 2: # motion in progress webcamCaptures(snapf,camera,filepath + "/" + timeisnow + ".jpg") elif getMotionLevel() == 3: # motion progress is stopped webcamCaptures(snapf,camera,filepath + "/" + timeisnow + ".jpg") setMotionLevel(0) # no motion in progress webcamCaptures(snapf,camera) #standard picture for security cam feed except: ErrorHandling() finally: snapf.close() camera.stop_recording(splitter_port=2) setMotionLevel(0) # no motion in progress saveLogData("we have stopped with picam")
I get this trying to get the exposure time up to near 10 seconds, it looks like the various things (even in capture continuous ) that precede and follow a capture can exceed the limit built in to the python support. Up to about 8 seconds seems seems to be safe, the it keels over fairly quickly.
6by9 suggested in this pi forum thread that the limit needs to increase.