picamera icon indicating copy to clipboard operation
picamera copied to clipboard

capture_continious is stuck after capturing one frame with the new HQ camera

Open yvodelaere opened this issue 5 years ago • 1 comments

The capture_continious function gets stuck after one image is captured. This is not the case with the V1 camera, but is does happen with the HQ camera. The code from the basic recipe is used to capture continious images (every second):

from time import sleep from picamera import PiCamera

camera = PiCamera()
camera.start_preview()
sleep(2)
for filename in camera.capture_continuous('img{counter:03d}.jpg'):
    print('Captured %s' % filename)
    sleep(1) # wait 1 second

When i interrupt the program using ctrl +c, the following traceback is shown:

File "timeLapse.py", line 7, in <module>
   for filename in camera.capture_continuous('img{counter:03d}.jpg'):
 File "/usr/lib/python3/dist-packages/picamera/camera.py", line 1692, in captur                                                                                                                                                             e_continuous
   if not encoder.wait(self.CAPTURE_TIMEOUT):
 File "/usr/lib/python3/dist-packages/picamera/encoders.py", line 393, in wait
   result = self.event.wait(timeout)
 File "/usr/lib/python3.7/threading.py", line 552, in wait
   signaled = self._cond.wait(timeout)
 File "/usr/lib/python3.7/threading.py", line 300, in wait
   gotit = waiter.acquire(True, timeout)


Does anybody know how to fix this?


yvodelaere avatar May 08 '20 17:05 yvodelaere

After specifying a sensor mode (in my case sensor_mode=2) in the constructor of PiCamera, the problem does not occur. So the issue is fixed for me.

yvodelaere avatar May 12 '20 13:05 yvodelaere