Wikia

CHDK Wiki

UBASIC/Scripts:Time Lapse Photography

Talk3
575pages on
this wiki

< UBASIC

Revision as of 05:48, January 20, 2012 by Fe50 (Talk | contribs)

A really simple script for time lapse photography (as a replacement for the one in movie mode). Takes pictures at the given interval (using get_tick_count for accuracy), or as fast as it can (if the interval is too short).

Although this theoretically allows you to take time-lapse photos as large as you like, I recommend setting the image size down a bit, especially if you're shooting under 2 sec/shot, cause the camera takes a while to process/save the image, which might screw up your timing.

Works great on A560, S90 with the 100c fw and with the IXUS 60. Worked great!

NOTE: On my PowerShot SD1000, you can only shoot pics that require flash in auto-flash mode and pics that don't require flash in no-flash mode. It does not take photos if your camera is in auto-flash mode but does not need to flash. If you try, the camera kind of stalls and doesn't do anything. Solution: set the flash mode to whatever you're expecting on your route. If you're attaching your camera to your bike, turn flash off before you start taking photos.

rem Time Lapse Photography
 rem Step 1: Mount camera on bike
 rem Step 2: Click "shoot" button
 rem Step 3: Profit!
 
 @title Time Lapse Photos
 @param a Interval (secs)
 @default a 1
 @param b Interval (1/100 sec) 
 @default b 0
  
 i=a*1000 + b*100
 if i<100 then let i=100
 t=get_tick_count
 
 rem Shot counter
 n=1
 
 print "Time Lapse Photos"
 
 sleep 1000
 goto "shot"
 
 :shot
   t=get_tick_count 
   print "Shot", n 
   shoot
   n=n+1
   rem Wait i msecs, including the
   rem time it takes to shoot. 
   rem Shoots as fast as possible if
   rem each shot takes longer than
   rem i msecs. 
   d= i - get_tick_count + t
   if d<0 then let d=0
   sleep d
   goto "shot"

User add >>

Improvement, to save energy between shots (last shot is displayed) and exit by SET. Created for A480, not tested on others. Also worked on A460, SX130IS.

rem Time Lapse Photography (OQ 4)
 
 @title Time Lapse Photos (OQ 4)
 @param a Interval (secs)
 @default a 10
 @param b +Interval (1/100 sec) 
 @default b 0
 
 i=a*1000 + b*100
 if i<100 then let i=100
 t=get_tick_count

 rem Shot counter
 n=1

 print "Time Lapse Photos"

 sleep 1000
 goto "shot"

 :shot
  t=get_tick_count 
  print "Shot", n 
  shoot
  n=n+1
  rem Wait i msecs, including the
  rem time it takes to shoot. 
  rem Shoots as fast as possible if
  rem each shot takes longer than
  rem i msecs. 
  d= i - get_tick_count + t
  if d<0 then let d=0
  click "display"
  sleep d
  if is_key "set" then goto "exit"
  goto "shot"
  
 :exit
 print "End"
 end

Around Wikia's network

Random Wiki