--[[@title CarLapseV2-- Author: careyer @param a Frame delay (sec)@default a 0@param b Max. TV (1/sec)@default b 125@param c Default ISO (*100)@default c 1@param d Maximum ISO (*100)@default d 8@param e Loop X times (0=endless)@default e 0@param f AutoISO (0=No,1=Yes)@default f 1@param r Focus to Inf.(0=no, 1=yes)@default r 0@param s JPG Q:-1..2=off,best..norm@default s -1@param t JPG resol.(-1=off,see doc)@default t -1@param u Startup Delay (minutes)@default u 0]]require "fb-lib"propcase=require("propcase")-- verbose=1 gives more printout during shootverbose=0min_delay=check_range(a,0,10000)max_tv=sec_to_tv96(check_range(b,1,65))default_sv=ISO_to_sv96(check_range(c,0,21)*100)max_sv=ISO_to_sv96(check_range(d,0,21)*100)maxISO = d*100maxISO_96 = 419if maxISO == 100 then maxISO_96 = 419elseif maxISO == 200 then maxIS0_96 = 507elseif maxISO == 400 then maxISO_96 = 603elseif maxISO == 800 then maxISO_96 = 699elseif maxISO == 1600 then maxISO_96 = 795end -- select focus distance (user specified if parameter r<=0, infinity otherwise):if r>0 then subjdist=65535 else subjdist=get_focus()end-- jpg quality -1=do not change, 0=super fine, 1=fine, 2=normal, jpg_quality=check_range(s, -1, 2)if jpg_quality>-1 then set_prop(propcase.QUALITY, jpg_quality) end-- jpg resolution -1=do not change, others are whatever they are in your camera:-- For a570is Digic III: 0,1,2,3,4,6,8 = L,M1,M2,M3,S,Postcard,W-- For s3is Digic II: 0,1,2, 4, 8 = L,M1,M2, S, W-- We can probably assume those numbers are always the same, but availability may vary.jpg_resolution=check_range(t, -1, 8)if jpg_resolution>-1 then set_prop(propcase.RESOLUTION, jpg_resolution) endstartupdelay=check_range(u, 0, 65535)-- startup delay if requestedif startupdelay>0 then for remaining=startupdelay,1,-1 do print("Sleeping ", remaining, " minutes") sleep(29980) sleep(29990) endend-- enable shot histogramshot_histo_enable(1)-- start counting framescount_frames=1-- store script start time and disk space at the beginning:starttick=get_tick_count()startdiskspace=get_free_disk_space()-- next_shoot keeps the time (in get_tick_count units) when next shot should be taken.-- initialise next_shoot to "shoot now"next_shoot=0-- force manual focus (does this work?)set_prop(propcase.FOCUS_MODE,1)-- disable IS (dunno if this works either)set_prop(propcase.IS_MODE,3)-- use widest available aperture (I'm assuming that cameras that don't have an aperture won't respond to this in any way)set_prop(propcase.USER_AV,get_prop(propcase.MIN_AV))-- disable flashset_prop(propcase.FLASH_MODE,2) -- main loop. the program loops forever unless you interrupt itloopcounter=0repeat loopcounter = loopcounter+1 -- now wait for the time to do next shot repeat sleep(1) tick=get_tick_count() until tick>=next_shoot -- Shoot: Half press and wait until camera is ready press("shoot_half") repeat sleep(1) until get_shooting() == true -- get metered day exposure bv=get_bv96() av=get_av96() tv=get_tv96() -- Check if shutterspeed is slower than allowed value maxTvAllowed = ((1000/b)-1)*96 shoot_sv = default_sv difference = 0 differenceFactor = 0 isoString = 100 if tv<maxTvAllowed then difference = maxTvAllowed - tv differenceFactor = difference/96 if differenceFactor == 1 then isoString = 200 elseif differenceFactor == 2 then isoString = 400 elseif differenceFactor == 3 then isoString = 800 elseif differenceFactor >= 4 then isoString = 1600 end else isoString = 100 end -- make sure maxISO gets not exeeded calculatedISO = default_sv+(96*differenceFactor) if f==1 then if calculatedISO<=maxISO_96 then shoot_sv = calculatedISO else shoot_sv = maxISO_96 isoString = maxISO end end -- sv for this shot, set_prop(propcase.SV,shoot_sv) -- focus to Inf and finally press and release shutter. set_focus(subjdist) press("shoot_full") release("shoot_full") release("shoot_half") -- wait for shooting to finish repeat sleep(1) until get_shooting() ~= true -- print out remaining disk space estimates in terms of frames and time: print(count_frames .. " at ISO " .. isoString) count_frames=count_frames+1 -- we are now ready to shoot, calculate the next shot time next_shoot=tick + min_delay*1000 -- return to top, where we will wait to shoot if (e == loopcounter) then break enduntil 1==2
--[[@title CarLapseV3-- Author: careyer @param a Frame delay (sec)@default a 0@param b Max. TV (1/sec)@default b 125@param c Default ISO (*100)@default c 1@param d Maximum ISO (*100)@default d 16@param e Loop X times (0=endless)@default e 0@param f AutoISO (0=No,1=Yes)@default f 1@param r Focus to Inf.(0=no, 1=yes)@default r 1@param s JPG Q:-1..2=off,best..norm@default s -1@param t JPG resol.(-1=off,see doc)@default t -1@param u Startup Delay (minutes)@default u 0@param g Startup Delay (seconds)@default g 2]]-- Converting thresholdTV to TV96 representation-- rounding to next faster shutterspeed if neededthresholdTV = bthresholdTV96 = 0if thresholdTV == 2 then thresholdTV96 = 96elseif thresholdTV == 3 then thresholdTV96 = 160elseif thresholdTV == 4 then thresholdTV96 = 192elseif thresholdTV == 5 then thresholdTV96 = 224elseif thresholdTV == 6 then thresholdTV96 = 256elseif thresholdTV >= 7 and thresholdTV <=8 then thresholdTV96 = 288elseif thresholdTV >= 9 and thresholdTV <=10 then thresholdTV96 = 320elseif thresholdTV >= 11 and thresholdTV <=13 then thresholdTV96 = 352elseif thresholdTV >= 14 and thresholdTV <=15 then thresholdTV96 = 384elseif thresholdTV >= 16 and thresholdTV <=20 then thresholdTV96 = 416elseif thresholdTV >= 21 and thresholdTV <=25 then thresholdTV96 = 448elseif thresholdTV >= 26 and thresholdTV <=30 then thresholdTV96 = 480elseif thresholdTV >= 31 and thresholdTV <=40 then thresholdTV96 = 512elseif thresholdTV >= 41 and thresholdTV <=50 then thresholdTV96 = 544elseif thresholdTV >= 51 and thresholdTV <=60 then thresholdTV96 = 576elseif thresholdTV >= 61 and thresholdTV <=80 then thresholdTV96 = 608elseif thresholdTV >= 81 and thresholdTV <=100 then thresholdTV96 = 640elseif thresholdTV >= 101 and thresholdTV <=125 then thresholdTV96 = 672elseif thresholdTV >= 126 and thresholdTV <=160 then thresholdTV96 = 704elseif thresholdTV >= 161 and thresholdTV <=200 then thresholdTV96 = 736elseif thresholdTV >= 201 and thresholdTV <=250 then thresholdTV96 = 768elseif thresholdTV >= 251 and thresholdTV <=320 then thresholdTV96 = 800elseif thresholdTV >= 321 and thresholdTV <=400 then thresholdTV96 = 832elseif thresholdTV >= 401 and thresholdTV <=500 then thresholdTV96 = 864elseif thresholdTV >= 501 and thresholdTV <=640 then thresholdTV96 = 896elseif thresholdTV >= 641 and thresholdTV <=800 then thresholdTV96 = 928elseif thresholdTV >= 801 and thresholdTV <=1000 then thresholdTV96 = 960elseif thresholdTV >= 1001 and thresholdTV <=1250 then thresholdTV96 = 992elseif thresholdTV >= 1251 and thresholdTV <=1600 then thresholdTV96 = 1021elseif thresholdTV >= 1601 and thresholdTV <=2000 then thresholdTV96 = 1053end require "fb-lib"propcase=require("propcase")-- verbose=1 gives more printout during shootverbose=0min_delay=check_range(a,0,10000)max_tv=sec_to_tv96(check_range(b,1,65))default_sv=ISO_to_sv96(check_range(c,0,21)*100)max_sv=ISO_to_sv96(check_range(d,0,21)*100)maxISO = d*100-- select focus distance (user specified if parameter r<=0, infinity otherwise):if r>0 then subjdist=65535 else subjdist=get_focus()end-- jpg quality -1=do not change, 0=super fine, 1=fine, 2=normal, jpg_quality=check_range(s, -1, 2)if jpg_quality>-1 then set_prop(propcase.QUALITY, jpg_quality) end-- jpg resolution -1=do not change, others are whatever they are in your camera:-- For a570is Digic III: 0,1,2,3,4,6,8 = L,M1,M2,M3,S,Postcard,W-- For s3is Digic II: 0,1,2, 4, 8 = L,M1,M2, S, W-- We can probably assume those numbers are always the same, but availability may vary.jpg_resolution=check_range(t, -1, 8)if jpg_resolution>-1 then set_prop(propcase.RESOLUTION, jpg_resolution) endstartupdelay=check_range(u, 0, 65535)startupdelaySec = g-- startup delay if requestedif startupdelay>0 then for remaining=startupdelay,1,-1 do print("Sleeping ", remaining, " minutes") sleep(29980) sleep(29990) endendif startupdelaySec>0 then for remaining=startupdelaySec,1,-1 do print("Sleeping ", remaining, " seconds") sleep(1000) endend-- enable shot histogramshot_histo_enable(1)-- start counting framescount_frames=1-- store script start time and disk space at the beginning:starttick=get_tick_count()startdiskspace=get_free_disk_space()-- next_shoot keeps the time (in get_tick_count units) when next shot should be taken.-- initialise next_shoot to "shoot now"next_shoot=0 -- force manual focus (does this work?)set_prop(propcase.FOCUS_MODE,1)-- disable IS (dunno if this works either)set_prop(propcase.IS_MODE,3)-- use widest available aperture (I'm assuming that cameras that don't have an aperture won't respond to this in any way)set_prop(propcase.USER_AV,get_prop(propcase.MIN_AV))-- disable flashset_prop(propcase.FLASH_MODE,2) -- main loop. the program loops forever unless you interrupt itloopcounter=0repeat wait_click(100) if is_pressed "display" then print("Paused by user") repeat wait_click(100) until is_pressed "menu" print("Continued by user") end loopcounter = loopcounter+1 -- now wait for the time to do next shot repeat sleep(1) tick=get_tick_count() until tick>=next_shoot -- Reset ISO to default value (ISO 100) sv96ISO = 419 set_sv96(sv96ISO) -- Measuring TV at default ISO press("shoot_half") repeat sleep(1) until get_shooting() == true -- get metered day exposure bv=get_bv96() av=get_av96() tv=get_tv96() set_focus(subjdist) release("shoot_half") -- Check if TV slower than allowed value and raise ISO if needed shoot_sv = default_sv difference = 0 differenceFactor = 0 sv96ISO = 419 isoString = 100 difference = thresholdTV96 - tv differenceFactor = difference/96 differenceRemainder = difference-(differenceFactor*96) -- Raising ISO and adjusting TV if needed while difference>0 and isoString<maxISO do difference = difference-96 isoString = isoString*2 sv96ISO = sv96ISO+96 tv=tv+96 end -- correcting TV value to match closest TV96 value count = 0 while tv>32 do count = count+1 tv=tv-32 end tvremainder = tv if tvremainder >=16 then tv = (count*32)+32 else tv = count*32 end -- set ISO and TV for next shot, set_sv96(sv96ISO) set_tv96(tv) press("shoot_half") repeat sleep(1) until get_shooting() == true set_focus(subjdist) press("shoot_full") release("shoot_full") release("shoot_half") -- wait for shooting to finish repeat sleep(1) until get_shooting() ~= true -- print out remaining disk space estimates in terms of frames and time: print(count_frames .." ISO " .. isoString ) count_frames=count_frames+1 -- we are now ready to shoot, calculate the next shot time next_shoot=tick + min_delay*1000 -- return to top, where we will wait to shoot if (e == loopcounter) then break enduntil 1==2
Maybe a dumb question, but why not use the AFL (Auto Focus Lock) of the camera ?This is a standard function on the IXUS 70 model.I don't have the camera at hand but i think it is "half press + left"
--[[@title CarLapseV4-- Author: careyer @param a Frame delay (sec)@default a 0@param b Max. TV (1/sec)@default b 125@param c Default ISO (*100)@default c 1@param d Maximum ISO (*100)@default d 16@param e Loop X times (0=endless)@default e 0@param f AutoISO (0=No,1=Yes)@default f 1@param r Focus to Inf.(0=no, 1=yes)@default r 1@param s JPG Q:-1..2=off,best..norm@default s -1@param t JPG resol.(-1=off,see doc)@default t -1@param u Startup Delay (minutes)@default u 0@param g Startup Delay (seconds)@default g 2]]-- Converting thresholdTV to TV96 representation-- rounding to next faster shutterspeed if neededthresholdTV = bthresholdTV96 = 0if thresholdTV == 2 then thresholdTV96 = 96elseif thresholdTV == 3 then thresholdTV96 = 160elseif thresholdTV == 4 then thresholdTV96 = 192elseif thresholdTV == 5 then thresholdTV96 = 224elseif thresholdTV == 6 then thresholdTV96 = 256elseif thresholdTV >= 7 and thresholdTV <=8 then thresholdTV96 = 288elseif thresholdTV >= 9 and thresholdTV <=10 then thresholdTV96 = 320elseif thresholdTV >= 11 and thresholdTV <=13 then thresholdTV96 = 352elseif thresholdTV >= 14 and thresholdTV <=15 then thresholdTV96 = 384elseif thresholdTV >= 16 and thresholdTV <=20 then thresholdTV96 = 416elseif thresholdTV >= 21 and thresholdTV <=25 then thresholdTV96 = 448elseif thresholdTV >= 26 and thresholdTV <=30 then thresholdTV96 = 480elseif thresholdTV >= 31 and thresholdTV <=40 then thresholdTV96 = 512elseif thresholdTV >= 41 and thresholdTV <=50 then thresholdTV96 = 544elseif thresholdTV >= 51 and thresholdTV <=60 then thresholdTV96 = 576elseif thresholdTV >= 61 and thresholdTV <=80 then thresholdTV96 = 608elseif thresholdTV >= 81 and thresholdTV <=100 then thresholdTV96 = 640elseif thresholdTV >= 101 and thresholdTV <=125 then thresholdTV96 = 672elseif thresholdTV >= 126 and thresholdTV <=160 then thresholdTV96 = 704elseif thresholdTV >= 161 and thresholdTV <=200 then thresholdTV96 = 736elseif thresholdTV >= 201 and thresholdTV <=250 then thresholdTV96 = 768elseif thresholdTV >= 251 and thresholdTV <=320 then thresholdTV96 = 800elseif thresholdTV >= 321 and thresholdTV <=400 then thresholdTV96 = 832elseif thresholdTV >= 401 and thresholdTV <=500 then thresholdTV96 = 864elseif thresholdTV >= 501 and thresholdTV <=640 then thresholdTV96 = 896elseif thresholdTV >= 641 and thresholdTV <=800 then thresholdTV96 = 928elseif thresholdTV >= 801 and thresholdTV <=1000 then thresholdTV96 = 960elseif thresholdTV >= 1001 and thresholdTV <=1250 then thresholdTV96 = 992elseif thresholdTV >= 1251 and thresholdTV <=1600 then thresholdTV96 = 1021elseif thresholdTV >= 1601 and thresholdTV <=2000 then thresholdTV96 = 1053end require "fb-lib"propcase=require("propcase")-- verbose=1 gives more printout during shootverbose=0min_delay=check_range(a,0,10000)max_tv=sec_to_tv96(check_range(b,1,65))default_sv=ISO_to_sv96(check_range(c,0,21)*100)max_sv=ISO_to_sv96(check_range(d,0,21)*100)maxISO = d*100-- select focus distance (user specified if parameter r<=0, infinity otherwise):if r>0 then subjdist=65535 else subjdist=get_focus()end-- jpg quality -1=do not change, 0=super fine, 1=fine, 2=normal, jpg_quality=check_range(s, -1, 2)if jpg_quality>-1 then set_prop(propcase.QUALITY, jpg_quality) end-- jpg resolution -1=do not change, others are whatever they are in your camera:-- For a570is Digic III: 0,1,2,3,4,6,8 = L,M1,M2,M3,S,Postcard,W-- For s3is Digic II: 0,1,2, 4, 8 = L,M1,M2, S, W-- We can probably assume those numbers are always the same, but availability may vary.jpg_resolution=check_range(t, -1, 8)if jpg_resolution>-1 then set_prop(propcase.RESOLUTION, jpg_resolution) endstartupdelay=check_range(u, 0, 65535)startupdelaySec = g-- startup delay if requestedif startupdelay>0 then for remaining=startupdelay,1,-1 do print("Sleeping ", remaining, " minutes") sleep(29980) sleep(29990) endendif startupdelaySec>0 then for remaining=startupdelaySec,1,-1 do print("Sleeping ", remaining, " seconds") sleep(1000) endend-- enable shot histogramshot_histo_enable(1)-- start counting framescount_frames=1-- store script start time and disk space at the beginning:starttick=get_tick_count()startdiskspace=get_free_disk_space()-- next_shoot keeps the time (in get_tick_count units) when next shot should be taken.-- initialise next_shoot to "shoot now"next_shoot=0 -- force manual focus (does this work?)set_prop(propcase.FOCUS_MODE,1)-- disable IS (dunno if this works either)set_prop(propcase.IS_MODE,3)-- use widest available aperture (I'm assuming that cameras that don't have an aperture won't respond to this in any way)set_prop(propcase.USER_AV,get_prop(propcase.MIN_AV))-- disable flashset_prop(propcase.FLASH_MODE,2)-- initializing Focus: setting Focus-Lockpress("shoot_half")repeat sleep(1)until get_shooting() == trueset_focus(subjdist)sleep(1000)press("left")sleep(100)release("left")release("shoot_half")-- main loop. the program loops forever unless you interrupt itloopcounter=0repeat wait_click(100) if is_pressed "display" then print("Paused by user") repeat wait_click(100) until is_pressed "menu" print("Continued by user") end loopcounter = loopcounter+1 -- now wait for the time to do next shot repeat sleep(1) tick=get_tick_count() until tick>=next_shoot -- Reset ISO to default value (ISO 100) sv96ISO = 419 set_sv96(sv96ISO) -- Measuring TV at default ISO press("shoot_half") repeat sleep(1) until get_shooting() == true -- get metered day exposure bv=get_bv96() av=get_av96() tv=get_tv96() release("shoot_half") -- Check if TV slower than allowed value and raise ISO if needed shoot_sv = default_sv difference = 0 differenceFactor = 0 sv96ISO = 419 isoString = 100 difference = thresholdTV96 - tv differenceFactor = difference/96 differenceRemainder = difference-(differenceFactor*96) -- Raising ISO and adjusting TV if needed while difference>0 and isoString<maxISO do difference = difference-96 isoString = isoString*2 sv96ISO = sv96ISO+96 tv=tv+96 end -- correcting TV value to match closest TV96 value count = 0 while tv>32 do count = count+1 tv=tv-32 end tvremainder = tv if tvremainder >=16 then tv = (count*32)+32 else tv = count*32 end -- set ISO and TV for next shot, set_sv96(sv96ISO) set_tv96(tv) press("shoot_half") repeat sleep(1) until get_shooting() == true set_focus(subjdist) press("shoot_full") release("shoot_full") release("shoot_half") -- wait for shooting to finish repeat sleep(1) until get_shooting() ~= true -- print out remaining disk space estimates in terms of frames and time: print(count_frames .." ISO " .. isoString ) count_frames=count_frames+1 -- we are now ready to shoot, calculate the next shot time next_shoot=tick + min_delay*1000 -- return to top, where we will wait to shoot if (e == loopcounter) then break enduntil 1==2
--[[@title CarLapseV5-- Author: careyer @param a Frame delay (sec)@default a 0@param b Max. TV (1/sec)@default b 125@param c Default ISO (*100)@default c 1@param d Maximum ISO (*100)@default d 16@param e Loop X times (0=endless)@default e 0@param f AutoISO (0=No,1=Yes)@default f 1@param h Pause on MD (0=No,1=Yes)@default h 1@param p Check every X frame@default p 10@param i MD colums (def: 6)@default i 6@param j MD rows (def: 4)@default j 4@param k MD first colum (def: 3)@default k 3@param l MD last colum (def: 4)@default l 4@param m MD first row (def: 2)@default m 2@param n MD last row (def: 3)@default n 3@param r Focus to Inf.(0=no, 1=yes)@default r 1@param s JPG Q:-1..2=off,best..norm@default s -1@param t JPG resol.(-1=off,see doc)@default t -1@param g Startup Delay (seconds)@default g 2@param u Startup Delay (minutes)@default u 0]]-- Converting thresholdTV to TV96 representation-- rounding to next faster shutterspeed if neededthresholdTV = bthresholdTV96 = 0if thresholdTV == 2 then thresholdTV96 = 96elseif thresholdTV == 3 then thresholdTV96 = 160elseif thresholdTV == 4 then thresholdTV96 = 192elseif thresholdTV == 5 then thresholdTV96 = 224elseif thresholdTV == 6 then thresholdTV96 = 256elseif thresholdTV >= 7 and thresholdTV <=8 then thresholdTV96 = 288elseif thresholdTV >= 9 and thresholdTV <=10 then thresholdTV96 = 320elseif thresholdTV >= 11 and thresholdTV <=13 then thresholdTV96 = 352elseif thresholdTV >= 14 and thresholdTV <=15 then thresholdTV96 = 384elseif thresholdTV >= 16 and thresholdTV <=20 then thresholdTV96 = 416elseif thresholdTV >= 21 and thresholdTV <=25 then thresholdTV96 = 448elseif thresholdTV >= 26 and thresholdTV <=30 then thresholdTV96 = 480elseif thresholdTV >= 31 and thresholdTV <=40 then thresholdTV96 = 512elseif thresholdTV >= 41 and thresholdTV <=50 then thresholdTV96 = 544elseif thresholdTV >= 51 and thresholdTV <=60 then thresholdTV96 = 576elseif thresholdTV >= 61 and thresholdTV <=80 then thresholdTV96 = 608elseif thresholdTV >= 81 and thresholdTV <=100 then thresholdTV96 = 640elseif thresholdTV >= 101 and thresholdTV <=125 then thresholdTV96 = 672elseif thresholdTV >= 126 and thresholdTV <=160 then thresholdTV96 = 704elseif thresholdTV >= 161 and thresholdTV <=200 then thresholdTV96 = 736elseif thresholdTV >= 201 and thresholdTV <=250 then thresholdTV96 = 768elseif thresholdTV >= 251 and thresholdTV <=320 then thresholdTV96 = 800elseif thresholdTV >= 321 and thresholdTV <=400 then thresholdTV96 = 832elseif thresholdTV >= 401 and thresholdTV <=500 then thresholdTV96 = 864elseif thresholdTV >= 501 and thresholdTV <=640 then thresholdTV96 = 896elseif thresholdTV >= 641 and thresholdTV <=800 then thresholdTV96 = 928elseif thresholdTV >= 801 and thresholdTV <=1000 then thresholdTV96 = 960elseif thresholdTV >= 1001 and thresholdTV <=1250 then thresholdTV96 = 992elseif thresholdTV >= 1251 and thresholdTV <=1600 then thresholdTV96 = 1021elseif thresholdTV >= 1601 and thresholdTV <=2000 then thresholdTV96 = 1053end require "fb-lib"propcase=require("propcase")-- verbose=1 gives more printout during shootverbose=0min_delay=check_range(a,0,10000)max_tv=sec_to_tv96(check_range(b,1,65))default_sv=ISO_to_sv96(check_range(c,0,21)*100)max_sv=ISO_to_sv96(check_range(d,0,21)*100)maxISO = d*100-- select focus distance (user specified if parameter r<=0, infinity otherwise):if r>0 then subjdist=65535 else subjdist=get_focus()end-- jpg quality -1=do not change, 0=super fine, 1=fine, 2=normal, jpg_quality=check_range(s, -1, 2)if jpg_quality>-1 then set_prop(propcase.QUALITY, jpg_quality) end-- jpg resolution -1=do not change, others are whatever they are in your camera:-- For a570is Digic III: 0,1,2,3,4,6,8 = L,M1,M2,M3,S,Postcard,W-- For s3is Digic II: 0,1,2, 4, 8 = L,M1,M2, S, W-- We can probably assume those numbers are always the same, but availability may vary.jpg_resolution=check_range(t, -1, 8)if jpg_resolution>-1 then set_prop(propcase.RESOLUTION, jpg_resolution) endstartupdelay=check_range(u, 0, 65535)startupdelaySec = g-- startup delay if requestedif startupdelay>0 then for remaining=startupdelay,1,-1 do print("Sleeping ", remaining, " minutes") sleep(29980) sleep(29990) endendif startupdelaySec>0 then for remaining=startupdelaySec,1,-1 do print("Sleeping ", remaining, " seconds") sleep(1000) endend-- enable shot histogramshot_histo_enable(1)-- start counting framescount_frames=1-- store script start time and disk space at the beginning:starttick=get_tick_count()startdiskspace=get_free_disk_space()-- next_shoot keeps the time (in get_tick_count units) when next shot should be taken.-- initialise next_shoot to "shoot now"next_shoot=0 -- force manual focus (does this work?)set_prop(propcase.FOCUS_MODE,1)-- disable IS (dunno if this works either)set_prop(propcase.IS_MODE,3)-- use widest available aperture (I'm assuming that cameras that don't have an aperture won't respond to this in any way)set_prop(propcase.USER_AV,get_prop(propcase.MIN_AV))-- disable flashset_prop(propcase.FLASH_MODE,2)-- initializing Focus: setting Focus-Lockpress("shoot_half")repeat sleep(1)until get_shooting() == trueset_focus(subjdist)sleep(1000)press("left")sleep(100)release("left")release("shoot_half")-- main loop. the program loops forever unless you interrupt itloopcounter=0mdcounter=0repeat mdcounter=mdcounter+1 wait_click(100) if is_pressed "display" then print("Paused by user") repeat wait_click(100) until is_pressed "menu" print("Continued by user") end loopcounter = loopcounter+1 -- now wait for the time to do next shot repeat sleep(1) tick=get_tick_count() until tick>=next_shoot -- Reset ISO to default value (ISO 100) sv96ISO = 419 set_sv96(sv96ISO) -- Measuring TV at default ISO press("shoot_half") repeat sleep(1) until get_shooting() == true -- get metered day exposure bv=get_bv96() av=get_av96() tv=get_tv96() t = 0 -- Detect Motion --- if h>0 and mdcounter==p then repeat sleep(1) t = md_detect_motion(i, j, 1, 40, 15, 5, 1, t, 1, k, m, l, n, 0, 6, 0) until t>0 mdcounter=0 end release("shoot_half") -- Check if TV slower than allowed value and raise ISO if needed shoot_sv = default_sv difference = 0 differenceFactor = 0 sv96ISO = 419 isoString = 100 difference = thresholdTV96 - tv differenceFactor = difference/96 differenceRemainder = difference-(differenceFactor*96) -- Raising ISO and adjusting TV if needed while difference>0 and isoString<maxISO do difference = difference-96 isoString = isoString*2 sv96ISO = sv96ISO+96 tv=tv+96 end -- correcting TV value to match closest TV96 value count = 0 while tv>32 do count = count+1 tv=tv-32 end tvremainder = tv if tvremainder >=16 then tv = (count*32)+32 else tv = count*32 end -- set ISO and TV for next shot, set_sv96(sv96ISO) set_tv96(tv) press("shoot_half") repeat sleep(1) until get_shooting() == true set_focus(subjdist) press("shoot_full") release("shoot_full") release("shoot_half") -- wait for shooting to finish repeat sleep(1) until get_shooting() ~= true -- print out remaining disk space estimates in terms of frames and time: print(count_frames .." ISO " .. isoString ) count_frames=count_frames+1 -- we are now ready to shoot, calculate the next shot time next_shoot=tick + min_delay*1000 -- return to top, where we will wait to shoot if (e == loopcounter) then break enduntil 1==2
Started by RyeBrye Firmware Dumping
Started by st2000 Creative Uses of CHDK
Started by Edgel « 1 2 » Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by ajayre Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by mcaramb Script Writing