This is an old revision of the document!


CHDK scripts for Canon SD1000/IXUS70

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.

bracket-night.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: SD1000_IXUS70 and DIGIC III cameras
rem Description: Takes successively three shots at low iso, with flash, and high iso, so that the best shot can be kept afterward
 
@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 "shooting low iso"
	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 "shooting flash"
	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 "shooting high iso"
	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

bracket-ev.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications
rem Description: EV Bracketing
 
@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 "shot",n,"of",b,"at",e,"/3 EV"
	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

bracket-focus.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: all
rem Description: Focus bracketing
 
@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",c,"mm"
		shoot
	endif
 
	p=c
	c=n
	d=d*e
	n=c+d
wend
 
end

Intervalometers

Built-in Intervalometer

Canon SD1000/IXUS70 has a built-in time lapse movie feature. However the interval can only be 1s or 2s. There are time lapse scripts, but they often are too slow for intervals shorter than 1s. Actually the built-in time lapse feature can deal with any interval, given in the property case #265. This script just changes this property.

interval-builtin.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: SD1000_IXUS70 (and maybe other DIGIC III cameras with built-in time lapse video feature)
rem Description: Allows custom built-in time-lapse movie interval
 
@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.

interval-accurate

rem Author: cyril42e <cyril42@gmail.com> (based on Divalent's "accurate intervalometer" script)
rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications
rem Description: Accurate intervalometer that uses get_tick_count function
 
@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,0,1,2,3,4,6,8 = keep,L,M1,M2,M3,S,PC,W)
@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 "change picture size before"
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 "Shot", n, "of", a
 
:loop
for n=2 to a
	s=t+d
	do
		wait_click 50
		is_key k "set"
		is_key l "shoot_half"
		if k=1 or l=1 then goto "end"
		t=get_tick_count
	until t>=s
  shoot
  print "Shot", n, "of", a
next n
 
if i=1 then goto "loop"
 
: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 640×480 resolution. This script uses the continuous mode to take pictures at any resolution with interval ~0.5 to 0.8s.

interval-continuous.bas

rem Author: cyril42e <cyril42@gmail.com> (based on Divalent'd "fast intervalometer" script)
rem Camera: SD1000_IXUS70, should work with other cameras with suggested modifications
rem Description: Uses continuous mode to do a fast intervalometer 
rem (but without control over interval, and without focus&exposure update between shots)
 
@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,0,1,2,3,4,6,8 = keep,L,M1,M2,M3,d,PC,W)
@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
:set_continuous
while e<>1 and i<5
	click "down"
	i=i+1
	get_prop 102 e
wend
click "set"
if e<>1 then goto "set_continuous"
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 "change picture size before"
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 "shoot_half"
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 "shoot_full"
v=get_tick_count
v=v+b
do
	wait_click 50
	is_key k "set"
	is_key l "shoot_half"
	if k=1 or l=1 then goto "end"
	u=get_tick_count
until u>=v
release "shoot_full"
sleep 100
release "shoot_half"
 
: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/compensation.

night-shot.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications
rem Description: Auto sets long exposure (> 1") for night shots with tripod, with 2s delay
 
@title Long exposure night shot
 
rem prepare the shot : shoot_half
press "shoot_half"
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), sv (iso speed), and av (aperture)
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
t=b+s-a-e
print "new tv96:",t
set_tv96_direct t
sleep 200
 
rem release and press again shoot_half to take into account new value
release "shoot_half"
sleep 200
get_tv96 t
print "set tv96:",t
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",g,"ms"
 
end

Open shutter

This script aims at having the shutter opened the most possible time, eg to shot lightning. Exposition is computed with night-shot.bas script so that exposure is ok. Dark frame substraction is canceled, but you can shot in RAW, shot one dark frame, and substract afterwards.

open-shutter.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: SD1000_IXUS70, should work with other cameras with suggested modifications
rem Description: Continuously take long exposure shots 
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
:set_continuous
while e<>1 and i<5
	click "down"
	i=i+1
	get_prop 102 e
wend
click "set"
if e<>1 then goto "set_continuous"
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 "change picture size before"
rem == END
 
rem #####################
rem ## COMPUTE EXP
rem prepare the shot : shoot_half
press "shoot_half"
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), sv (iso speed), and av (aperture)
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 "shoot_half"
 
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 "shoot_half"
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 "shoot_full"
v=get_tick_count
v=v+b
do
	wait_click 50
	is_key k "set"
	is_key l "shoot_half"
	if k=1 or l=1 then goto "end"
	u=get_tick_count
until u>=v
release "shoot_full"
sleep 100
release "shoot_half"
 
:end
rem restore
rem == IF DIGIC III
set_prop 218 y
rem == ENDIF
set_raw_nr 0
 
end

Motion shot

motion-shot.bas

rem Author: cyril42e <cyril42@gmail.com>
rem Camera: SD1000_IXUS70 and DIGIC III cameras, should work on DIGIC II with suggested modifications
rem Description: Triggers a shot when movement is detected. Auto focus/exposure is done each shot, but you can lock them before
 
@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:shot|2:log|4:dump|8:press)
@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:U,1:Y,2:V,3:R,4:G,5:B)
@default k 1
@param l Region Mode (0:no,1:incl,2:excl)
@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 "shoot_half"
	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 "shoot_full"
	if q>0 then print shot
	release "shoot_half"
	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
photo/chdk-scripts.1212699927.txt.gz · Last modified: 2013/09/19 16:42 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0