Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
photo:chdk-scripts [2008/06/05 21:05] 127.0.0.1 external edit |
photo:chdk-scripts [2013/09/19 16:40] (current) |
||
---|---|---|---|
Line 3: | Line 3: | ||
Don't forget you can use zoom to change increment when setting script parameters values (+1, +10, +100, ...). | 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 | + | 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 in the discussion area at the bottom of the page and I will update the descriptions. |
Line 11: | Line 11: | ||
==== Night 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. | + | 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. High ISO also enables dark frame substraction for noise reduction, whatever the exposure time is (it really reduces noise due to high ISO). |
- | '' | + | <source photo/bracket-night.bas 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 | + | |
- | </code> | + | |
==== EV Bracketing ==== | ==== EV Bracketing ==== | ||
- | '' | + | * Internal modification of EV shift/ |
- | <code sdlbasic> | + | * Exposure time can be greater than 1" to ensure sufficient exposure (uses '' |
- | rem Author: cyril42e < | + | * Temporarily enables RAW |
- | 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 | + | <source photo/bracket-ev.bas sdlbasic> |
- | 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 | + | |
- | </code> | + | |
==== Focus Bracketing ==== | ==== Focus Bracketing ==== | ||
+ | * dynamically computes the steps using the DOF calculator | ||
- | '' | + | <source photo/bracket-focus.bas 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 | + | |
- | </code> | + | |
===== Intervalometers ===== | ===== Intervalometers ===== | ||
- | |||
==== Built-in Intervalometer ==== | ==== Built-in Intervalometer ==== | ||
Line 181: | Line 35: | ||
Canon SD1000/ | Canon SD1000/ | ||
- | '' | + | <source photo/interval-builtin.bas 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 | + | |
- | </code> | + | |
==== Accurate Intervalometer ==== | ==== Accurate Intervalometer ==== | ||
Line 205: | Line 41: | ||
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. | 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. | ||
- | '' | + | <source photo/interval-accurate.bas 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 | + | |
- | </code> | + | |
==== Continuous Intervalometer ==== | ==== Continuous Intervalometer ==== | ||
Line 283: | Line 47: | ||
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. | 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. | ||
- | '' | + | <source photo/interval-continuous.bas 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 | + | |
- | </code> | + | |
===== Misc ===== | ===== Misc ===== | ||
Line 378: | Line 53: | ||
==== Night shot ==== | ==== 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 | + | 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 |
- | '' | + | This script: |
- | <code sdlbasic> | + | * asks the camera the exposure settings it suggests (will keep ISO and aperture) |
- | rem Author: cyril42e < | + | * recomputes |
- | rem Camera: SD1000_IXUS70 | + | * waits a 2" |
- | rem Description: | + | * shoots |
- | @title Long exposure night shot | + | Tips: |
+ | * You can control with the "Dark frame" entry of the " | ||
- | rem prepare the shot : shoot_half | + | <source photo/night-shot.bas sdlbasic> |
- | 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 | + | |
- | </code> | + | |
==== Open shutter ==== | ==== Open shutter ==== | ||
- | This script aims at having the shutter opened the most possible time, eg to shot lightning. Exposition is computed with '' | + | This script aims at having the shutter opened the most possible time, eg to shot lightning. Exposition is computed with '' |
- | '' | + | This script: |
- | <code sdlbasic> | + | * sets automatically continuous mode on the SD1000 using the GUI (as I wasn't able to write the propcase), |
- | rem Author: cyril42e < | + | * sets automatically the desired picture size on DIGIC III cameras |
- | rem Camera: SD1000_IXUS70, should work with other cameras | + | * disables black frame subtraction |
- | rem Description: | + | * computes the appropriate |
- | rem (combination | + | * shoots continuously for a given time (if continuous |
+ | * restores the modified settings | ||
- | @title Continuous Intervalometer | + | <source photo/open-shutter.bas sdlbasic> |
- | @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 | + | |
- | </code> | + | |
==== Motion shot ==== | ==== Motion shot ==== | ||
+ | * takes one shot, or a burst of shots, or a movie after movement is detected | ||
- | '' | + | <source photo/motion-shot.bas 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 | + | |
- | </ | + | |
- | + | ||