Created
July 7, 2014 18:48
-
-
Save alaudet/f5f50109896ab2ee63f8 to your computer and use it in GitHub Desktop.
Timelapse pictures using Picamera module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# take snapshots to create a timelapse video | |
import time | |
import picamera | |
method = raw_input("Select timelapse in seconds or minutes (S or M):> ") | |
if "s" in method or "S" in method: | |
seconds = int(raw_input("Enter photo interval in seconds: >: ")) | |
elif "m" in method or "M" in method: | |
minutes = int(raw_input("Enter photo interval in minutes: >: ")) | |
seconds = minutes * 60 | |
else: | |
print "Invalid entry" | |
exit(0) | |
with picamera.PiCamera() as camera: | |
camera.start_preview() | |
time.sleep(2) | |
for filename in camera.capture_continuous('img{counter:03d}.jpg'): | |
print('Captured %s' % filename) | |
time.sleep(seconds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment