Commits

Eric Pavey committed 2e77459

Modified timelapse.py

  • Participants
  • Parent commits dcae831

Comments (0)

Files changed (1)

pi_camera/timelapse.py

 import argparse
 
 def main(captureTime=1.0, movieDuration=60, framerate=30, resolution=(1280,720), 
-        format='jpeg', quality=85, startTime=None):
+        quality=85, startTime=None):
     """
-    Record images to a /time-lapse folder based on the captureTime and movieDuration
+    Record jpeg images to a /time-lapse folder based on the captureTime and movieDuration
     values, + any extra passed in args.  Saved files will overwrite any previous 
     files left in that folder.
+    
+    Note, I've been unable to get any other image format types to work, it locks
+    up the system with no errors.
 
     Parameters:
     captureTime : float : Default 1.0 : How long should te recording go on for in HOURS.
     resolution : (x, y) : Default (1280, 720) : The resolution to capture at, 
         default is 720p.  The cam can go higher of course, but this tends to fill 
         up my sd card.
-    format : string : Default 'jpeg' : Any valid image format, see the docs:
-        http://picamera.readthedocs.org/en/release-1.3/api.html#picamera.PiCamera.capture
     quality : int : Default 85 : If the format is 'jpeg', set the quality, from 
         1 to 100.
     startTime : datetime.datetime / None : If not none, an instance of a datetime.datetime
         with picamera.PiCamera() as camera:
             print "Starting camera..."
             camera.resolution = resolution
-            camera.format = format
             if format == 'jpeg':
                 camera.quality = quality
             camera.start_preview()
             time.sleep(2)
             startT = time.time()
             print "Capture begin:"
-            for filename in camera.capture_continuous('%s/timelapse{counter:04d}.%s'% (timelapseDir, format)):
+            for filename in camera.capture_continuous('%s/timelapse{counter:04d}.jpeg'% (timelapseDir)):
                 print('\tCaptured %s' % filename)
                 time.sleep(interval) 
                 timeNow = time.time()