I am trying to make a long exposure time lapse camera using a RPi HQ camera and RPi zero W, in python.

The code for my camera is (for a 30 sec exposure time):

import subprocess
filename = str(input("GIVE THE IMAGE A NAME: ")) 
cmd = f'raspistill - ISO 800 -ss 30000000 -o /home/pi/Pictures/{filename}.png' 
subprocess.call(cmd, shell=True) 

But it takes around 3-5 minutes to take the image, and the image appears to have the correct exposure time, so I think raspistill is working in the background before it takes the image. I expect there to be some delay while the RPi processes the command, but I don't see how it can take several minutes.

I repeated this in terminal, and it took about the same time to take the image.

What is causing this delay, and how can I fix it?

  • Will it be very different if you change exposure to say 1 sec or 0.1 sec?
    – Vadim
    Sep 22, 2022 at 8:26
  • 1
    A 1 sec exposure works ok, but there is still some lag, just not anywhere near as much as a 30 sec exposure
    – Jake
    Sep 22, 2022 at 9:10
  • I've seen similar readout overheads but for high end cameras... What you also may experiment is taking 30 images with 1s exposure and see if it is faster. If it is you may try averaging them to get 30s exposure. However, such readout overhead might be a fundamental issue coming from camera's electronics or driver or their combination. You may want to try using python picamera module, which should be able to do the same but without calling shell command. See projects.raspberrypi.org/en/projects/…
    – Vadim
    Sep 22, 2022 at 11:16
  • I have tried to use PiCam, but I run into issues where it won't expose for any longer than 5 seconds
    – Jake
    Sep 23, 2022 at 0:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.