Picamera

Here



import time
import picamera

VIDEO_DAYS = 1
FRAMES_PER_HOUR = 360
FRAMES = FRAMES_PER_HOUR * 3 * VIDEO_DAYS
file = '/home/pi/camera/frame_%04d.jpg'

def capture_frame(frame):
    with picamera.PiCamera() as cam:
      time.sleep(2)
      cam.capture(file % frame)

# Capture the images
for frame in range(FRAMES):
    start = time.time()
    capture_frame(frame)
    time.sleep(int(60 * 60 / FRAMES_PER_HOUR) - (time.time() - start))

Leave a Reply

Your email address will not be published. Required fields are marked *