Differences
This shows you the differences between two versions of the page.
photo:chdk-scripts [2008/06/05 21:05] 127.0.0.1 external edit |
photo:chdk-scripts [2013/09/19 16:40] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== CHDK scripts for Canon SD1000/ | ||
- | |||
- | Don't forget you can use zoom to change increment when setting script parameters values (+1, +10, +100, ...). | ||
- | |||
- | Unless said otherwise, these scripts have only been tested on SD1000_IXUS70. If you have tested successfully one of them on other cameras, tell me at crteknologies@free.fr and I will update the descriptions. | ||
- | |||
- | |||
- | |||
- | ===== Bracketing ===== | ||
- | |||
- | ==== Night bracketing ==== | ||
- | |||
- | When shooting live subject or without a tripod by night, you don't necessarily know if the best way is to use flash or not, and high ISO or not. This script takes successively three shots with low ISO, flash, and high ISO, so that you can choose afterward which one is the best one. | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70 and DIGIC III cameras | ||
- | rem Description: | ||
- | |||
- | @title Night bracketting (ISO+flash) | ||
- | @param a take_lowiso | ||
- | @default a 1 | ||
- | @param b take_flash | ||
- | @default b 1 | ||
- | @param c take_highiso | ||
- | @default c 1 | ||
- | |||
- | rem save flash | ||
- | get_prop 143 f | ||
- | rem save iso | ||
- | get_prop 149 i | ||
- | |||
- | rem set flash off | ||
- | set_prop 143 2 | ||
- | rem set iso auto normal | ||
- | set_prop 149 0 | ||
- | rem shoot | ||
- | if a=1 then | ||
- | print " | ||
- | shoot | ||
- | do | ||
- | get_prop 206 z | ||
- | until z=0 | ||
- | endif | ||
- | |||
- | if b=1 then | ||
- | rem set flash on | ||
- | set_prop 143 1 | ||
- | rem shoot | ||
- | print " | ||
- | shoot | ||
- | do | ||
- | get_prop 206 z | ||
- | until z=0 | ||
- | rem set flash off | ||
- | set_prop 143 2 | ||
- | endif | ||
- | |||
- | rem set iso auto hi | ||
- | set_prop 149 1 | ||
- | rem shoot | ||
- | if c=1 then | ||
- | print " | ||
- | shoot | ||
- | do | ||
- | get_prop 206 z | ||
- | until z=0 | ||
- | endif | ||
- | |||
- | rem restore flash | ||
- | set_prop 143 f | ||
- | rem restore iso | ||
- | set_prop 149 i | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | |||
- | ==== EV Bracketing ==== | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications | ||
- | rem Description: | ||
- | |||
- | @title EV Bracketing | ||
- | @param a Range (1/3 EV, even) | ||
- | @default a 12 | ||
- | @param b Number of shots (odd) | ||
- | @default b 3 | ||
- | |||
- | rem check input | ||
- | if a<2 then b=2 | ||
- | if a%2 = 1 then a = a+1 | ||
- | if b<3 then b=3 | ||
- | if b%2 = 0 then b = b+1 | ||
- | rem step | ||
- | c=a/(b-1) | ||
- | rem save ev | ||
- | rem == IF DIGIC III | ||
- | get_prop 207 o | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 26 o | ||
- | rem == END | ||
- | rem go to first ev | ||
- | e = -(a/2) - c | ||
- | rem shoot | ||
- | for n=1 to b | ||
- | e = e+c | ||
- | f = e*32 | ||
- | rem == IF DIGIC III | ||
- | set_prop 207 f | ||
- | rem == ELSE IF DIGIC II | ||
- | rem set_prop 25 f | ||
- | rem set_prop 26 f | ||
- | rem == END | ||
- | print " | ||
- | shoot | ||
- | next n | ||
- | rem restore ev | ||
- | rem == IF DIGIC III | ||
- | set_prop 207 o | ||
- | rem == ELSE IF DIGIC II | ||
- | rem set_prop 25 o | ||
- | rem set_prop 26 o | ||
- | rem == END | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ==== Focus Bracketing ==== | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: all | ||
- | rem Description: | ||
- | |||
- | @title Focus Bracketing | ||
- | @param a Min Dist (mm) | ||
- | @default a 60 | ||
- | @param b Max Dist (mm) | ||
- | @default b 6000 | ||
- | @param c Min focus (mm) | ||
- | @default c 60 | ||
- | @param d First step (mm) | ||
- | @default d 10 | ||
- | @param e Coef step | ||
- | @default e 2 | ||
- | |||
- | if a<60 then a=60 | ||
- | if b<70 then b=70 | ||
- | |||
- | rem prev dist, next dist | ||
- | p=c | ||
- | n=c+d | ||
- | |||
- | while p<b | ||
- | if n>a then | ||
- | set_focus c | ||
- | print "shoot at", | ||
- | shoot | ||
- | endif | ||
- | |||
- | p=c | ||
- | c=n | ||
- | d=d*e | ||
- | n=c+d | ||
- | wend | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ===== Intervalometers ===== | ||
- | |||
- | |||
- | ==== Built-in Intervalometer ==== | ||
- | |||
- | Canon SD1000/ | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70 (and maybe other DIGIC III cameras with built-in time lapse video feature) | ||
- | rem Description: | ||
- | |||
- | @title Time lapse interval | ||
- | @param a interval_ms | ||
- | @default a 500 | ||
- | |||
- | rem set the interval | ||
- | set_prop 265 a | ||
- | sleep 200 | ||
- | rem read the interval and display it for verification | ||
- | get_prop 265 b | ||
- | print "val: ",b | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ==== Accurate Intervalometer ==== | ||
- | |||
- | A lot of intervalometers use the sleep command, but this is not precise and it does not take into account the time necessary to shoot (up to several seconds with metering). This script uses the get_tick_count command so is a lot more reliable. | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications | ||
- | rem Description: | ||
- | |||
- | @title Accurate Intervalometer | ||
- | @param a Number of shots | ||
- | @default a 200 | ||
- | @param b Delay (min) | ||
- | @default b 0 | ||
- | @param c Delay (sec) | ||
- | @default c 0 | ||
- | @param e Interval (min) | ||
- | @default e 0 | ||
- | @param f Interval (sec) | ||
- | @default f 5 | ||
- | @param g Interval (0.1 sec) | ||
- | @default g 0 | ||
- | @param i Endless (0/1) | ||
- | @default i 1 | ||
- | @param z Picture Size (-1, | ||
- | @default z 3 | ||
- | |||
- | print "stop this script using" | ||
- | print "set or shoot_half keys," | ||
- | print "not shoot_full" | ||
- | |||
- | rem == IF DIGIC III | ||
- | get_prop 218 y | ||
- | if z<>-1 and y<>z then | ||
- | set_prop 218 z | ||
- | endif | ||
- | rem == ELSE | ||
- | rem print " | ||
- | rem == END | ||
- | |||
- | if a<1 then a=1 | ||
- | h=b*60000+c*1000 | ||
- | if h<0 then h=0 | ||
- | d=e*60000+f*1000+g*100 | ||
- | if d<1 then d=1 | ||
- | |||
- | n=1 | ||
- | sleep h | ||
- | t=get_tick_count | ||
- | shoot | ||
- | print " | ||
- | |||
- | :loop | ||
- | for n=2 to a | ||
- | s=t+d | ||
- | do | ||
- | wait_click 50 | ||
- | is_key k " | ||
- | is_key l " | ||
- | if k=1 or l=1 then goto " | ||
- | t=get_tick_count | ||
- | until t>=s | ||
- | shoot | ||
- | print " | ||
- | next n | ||
- | |||
- | if i=1 then goto " | ||
- | |||
- | :end | ||
- | rem restore | ||
- | rem == IF DIGIC III | ||
- | set_prop 218 y | ||
- | rem == ENDIF | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ==== Continuous Intervalometer ==== | ||
- | |||
- | Classic intervalometers cannot be faster than ~2s interval, except built-in intervalometer but which is limited to 640x480 resolution. This script uses the continuous mode to take pictures at any resolution with interval ~0.5 to 0.8s. | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70, | ||
- | rem Description: | ||
- | rem (but without control over interval, and without focus& | ||
- | |||
- | @title Continuous Intervalometer | ||
- | @param a Delay (min) | ||
- | @default a 0 | ||
- | @param b Delay (sec) | ||
- | @default b 0 | ||
- | @param c Duration (min) | ||
- | @default c 2 | ||
- | @param d Duration (sec) | ||
- | @default d 0 | ||
- | @param z Picture Size (-1, | ||
- | @default z 3 | ||
- | |||
- | rem == IF SD1000_IXUS70 | ||
- | print "stop this script using" | ||
- | print "set or shoot_half keys," | ||
- | print "not shoot_full" | ||
- | |||
- | get_prop 102 e | ||
- | i=0 | ||
- | : | ||
- | while e<>1 and i<5 | ||
- | click " | ||
- | i=i+1 | ||
- | get_prop 102 e | ||
- | wend | ||
- | click " | ||
- | if e<>1 then goto " | ||
- | rem == ELSE | ||
- | rem print "set continuous mode before" | ||
- | rem == END | ||
- | |||
- | rem == IF DIGIC III | ||
- | get_prop 218 y | ||
- | if z<>-1 and y<>z then | ||
- | set_prop 218 z | ||
- | endif | ||
- | rem == ELSE | ||
- | rem print " | ||
- | rem == END | ||
- | |||
- | |||
- | rem convert to ms | ||
- | d=c*60000+d*1000 | ||
- | if d<2000 then d=2000 | ||
- | b=a*60000+b*1000 | ||
- | if b<2000 then b=2000 | ||
- | |||
- | sleep b | ||
- | |||
- | rem first get camera to lock in focus and exposure | ||
- | press " | ||
- | do | ||
- | rem == IF DIGIC III | ||
- | get_prop 206 f | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 205 f | ||
- | rem == ENDIF | ||
- | until f=1 | ||
- | sleep 100 | ||
- | |||
- | rem shoot continous | ||
- | press " | ||
- | v=get_tick_count | ||
- | v=v+b | ||
- | do | ||
- | wait_click 50 | ||
- | is_key k " | ||
- | is_key l " | ||
- | if k=1 or l=1 then goto " | ||
- | u=get_tick_count | ||
- | until u>=v | ||
- | release " | ||
- | sleep 100 | ||
- | release " | ||
- | |||
- | :end | ||
- | rem restore | ||
- | rem == IF DIGIC III | ||
- | set_prop 218 y | ||
- | rem == ENDIF | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ===== Misc ===== | ||
- | |||
- | ==== Night shot ==== | ||
- | |||
- | My Casio S600 has a very good night mode, that uses very long exposure time with low ISO. It allows to take beautiful shots by night with a tripod. Canon SD1000 never set exposure time greater than 1" in automatic mode, and in in manual mode you have to try several time to find the good exposure time. This script automatically computes exposure time so that exposure is correct, and is able to set exposure time greater than 1" (and even greater than 15"). There is also a 2" delay so that the camera is well stabilized on its tripod when the shot is taken. You can adjust exposure with exposure shift/ | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications | ||
- | rem Description: | ||
- | |||
- | @title Long exposure night shot | ||
- | |||
- | rem prepare the shot : shoot_half | ||
- | press " | ||
- | rem wait ready to shot | ||
- | do | ||
- | rem == IF DIGIC III | ||
- | get_prop 206 c | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 205 c | ||
- | rem == ENDIF | ||
- | until c=1 | ||
- | rem read bv (luminance), | ||
- | get_bv96 b | ||
- | get_sv96 s | ||
- | get_av96 a | ||
- | rem == IF DIGIC III | ||
- | get_prop 207 e | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 26 e | ||
- | rem == ENDIF | ||
- | rem set tv (exposure time) : tv = bv + sv - av (- ev) (apex) | ||
- | get_tv96 t | ||
- | print "old tv96:", | ||
- | t=b+s-a-e | ||
- | print "new tv96:", | ||
- | set_tv96_direct t | ||
- | sleep 200 | ||
- | |||
- | rem release and press again shoot_half to take into account new value | ||
- | release " | ||
- | sleep 200 | ||
- | get_tv96 t | ||
- | print "set tv96:", | ||
- | rem wait additional 2s so that we are sure the camera is still on its tripod | ||
- | sleep 2000 | ||
- | f=get_tick_count | ||
- | shoot | ||
- | do | ||
- | rem == IF DIGIC III | ||
- | get_prop 206 c | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 205 c | ||
- | rem == ENDIF | ||
- | until c=0 | ||
- | g=get_tick_count | ||
- | g=g-f | ||
- | print "shot length", | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ==== Open shutter ==== | ||
- | |||
- | This script aims at having the shutter opened the most possible time, eg to shot lightning. Exposition is computed with '' | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70, | ||
- | rem Description: | ||
- | rem (combination of interval-continuous.bas and night-shot.bas with dark frame substraction removal) | ||
- | |||
- | @title Continuous Intervalometer | ||
- | @param a Delay (min) | ||
- | @default a 0 | ||
- | @param b Delay (sec) | ||
- | @default b 0 | ||
- | @param c Duration (min) | ||
- | @default c 2 | ||
- | @param d Duration (sec) | ||
- | @default d 0 | ||
- | |||
- | rem ##################### | ||
- | rem ## CONFIG | ||
- | set_raw_nr 1 | ||
- | |||
- | rem == IF SD1000_IXUS70 | ||
- | print "stop this script using" | ||
- | print "set or shoot_half keys," | ||
- | print "not shoot_full" | ||
- | |||
- | get_prop 102 e | ||
- | i=0 | ||
- | : | ||
- | while e<>1 and i<5 | ||
- | click " | ||
- | i=i+1 | ||
- | get_prop 102 e | ||
- | wend | ||
- | click " | ||
- | if e<>1 then goto " | ||
- | rem == ELSE | ||
- | rem print "set continuous mode before" | ||
- | rem == END | ||
- | |||
- | rem == IF DIGIC III | ||
- | get_prop 218 y | ||
- | if z<>-1 and y<>z then | ||
- | set_prop 218 z | ||
- | endif | ||
- | rem == ELSE | ||
- | rem print " | ||
- | rem == END | ||
- | |||
- | rem ##################### | ||
- | rem ## COMPUTE EXP | ||
- | rem prepare the shot : shoot_half | ||
- | press " | ||
- | rem wait ready to shot | ||
- | do | ||
- | rem == IF DIGIC III | ||
- | get_prop 206 C | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 205 C | ||
- | rem == ENDIF | ||
- | until C=1 | ||
- | rem read bv (luminance), | ||
- | get_bv96 B | ||
- | get_sv96 S | ||
- | get_av96 A | ||
- | rem == IF DIGIC III | ||
- | get_prop 207 E | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 26 E | ||
- | rem == ENDIF | ||
- | rem set tv (exposure time) : tv = bv + sv - av (- ev) (apex) | ||
- | get_tv96 T | ||
- | T=B+S-A-E | ||
- | set_tv96_direct T | ||
- | sleep 200 | ||
- | rem release | ||
- | release " | ||
- | |||
- | rem convert to ms | ||
- | d=c*60000+d*1000 | ||
- | if d<2000 then d=2000 | ||
- | b=a*60000+b*1000 | ||
- | if b<2000 then b=2000 | ||
- | |||
- | |||
- | rem ##################### | ||
- | rem ## WAIT DELAY AND SHOOT | ||
- | sleep b | ||
- | |||
- | rem first get camera to lock in focus and exposure | ||
- | press " | ||
- | do | ||
- | rem == IF DIGIC III | ||
- | get_prop 206 f | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 205 f | ||
- | rem == ENDIF | ||
- | until f=1 | ||
- | sleep 100 | ||
- | |||
- | rem shoot continous | ||
- | press " | ||
- | v=get_tick_count | ||
- | v=v+b | ||
- | do | ||
- | wait_click 50 | ||
- | is_key k " | ||
- | is_key l " | ||
- | if k=1 or l=1 then goto " | ||
- | u=get_tick_count | ||
- | until u>=v | ||
- | release " | ||
- | sleep 100 | ||
- | release " | ||
- | |||
- | :end | ||
- | rem restore | ||
- | rem == IF DIGIC III | ||
- | set_prop 218 y | ||
- | rem == ENDIF | ||
- | set_raw_nr 0 | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | ==== Motion shot ==== | ||
- | |||
- | '' | ||
- | <code sdlbasic> | ||
- | rem Author: cyril42e < | ||
- | rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications | ||
- | rem Description: | ||
- | |||
- | @title Motion Shot | ||
- | @param a Columns | ||
- | @default a 4 | ||
- | @param b Rows | ||
- | @default b 3 | ||
- | @param c Threshold (0-255) | ||
- | @default c 10 | ||
- | @param d Compare Interval (ms) | ||
- | @default d 20 | ||
- | @param e Pix-Step (speed vs accuracy) | ||
- | @default e 10 | ||
- | @param f Action Internal (1: | ||
- | @default f 1 | ||
- | @param g Action Script (1:shot) | ||
- | @default g 0 | ||
- | @param h Draw Grid (0/1) | ||
- | @default h 0 | ||
- | @param i Timeout (ms) | ||
- | @default i 60000 | ||
- | @param j Delay (ms) | ||
- | @default j 1000 | ||
- | @param k Measure Mode (0: | ||
- | @default k 1 | ||
- | @param l Region Mode (0: | ||
- | @default l 0 | ||
- | @param m Region Left | ||
- | @default m 1 | ||
- | @param n Region Right | ||
- | @default n 1 | ||
- | @param o Region Top | ||
- | @default o 1 | ||
- | @param p Region Bottom | ||
- | @default p 1 | ||
- | |||
- | while 1 | ||
- | press " | ||
- | q=0 | ||
- | md_detect_motion a, b, k, i, d, c, h, q, l, m, o, n, p, f, e, j | ||
- | if q>0 or g then click " | ||
- | if q>0 then print shot | ||
- | release " | ||
- | do | ||
- | rem == IF DIGIC III | ||
- | get_prop 206 z | ||
- | rem == ELSE IF DIGIC II | ||
- | rem get_prop 205 z | ||
- | rem == ENDIF | ||
- | until z=0 | ||
- | wend | ||
- | |||
- | end | ||
- | </ | ||
- | |||
- | |||
- | |||