rem Fudgey's Fast/Slow/Video Motion Detector with masks. For models with no video button.rem See MDFB-080914.txt for documentation.rem Trunk autobuild 509 or higher (or compatible) required.@title Fast MD 080914@param a Columns@default a 6@param b Rows@default b 4@param c Threshold (0-255)@default c 10@param g Burst/Review/Video time (s)@default g 0@param d Compare Interval (ms)@default d 7@param h Pixel Step (pixels)@default h 6@param f Channel (0U,1Y,2V,3R,4G,5B)@default f 1@param n Timeout (10s of seconds)@default n 30@param e Trigger Delay (0.1 sec)@default e 5@param i Masking (0=No 1=Mask 2=Use)@default i 0@param j - Mask Columns Left@default j 0@param k - Mask Columns Right@default k 0@param l - Mask Rows Top@default l 0@param m - Mask Rows Bottom@default m 0@param o Shoot fast=0,slow=1,test=2@default o 0if a<1 then a=1if b<1 then b=1if i<0 then i=0if i>2 then i=2if j<0 then j=0if k<0 then k=0if l<0 then l=0if m<0 then m=0if j>a then j=aif k>a then k=aif l>b then l=bif m>b then m=bif g<0 then g=0if f<0 then f=1if f>5 then f=1if f=0 then print "Channel: U chroma"if f=1 then print "Channel: Luminance"if f=2 then print "Channel: V chroma"if f=3 then print "Channel: Red"if f=4 then print "Channel: Green"if f=5 then print "Channel: Blue"if n<1 then n=1e=e*100g=g*1000n=n*10000P=get_video_buttonif P=1 then goto "VideoButtonError"P=get_modeif P=1 then goto "PlayModeError"rem get_mode returns 2 if a we are in video mode (and the camera has no video button)if P=2 then p=1 else p=0P=get_flash_modeif P=2 then goto "SkipFlashWarning" print "WARNING: Flash is not" print "disabled. May cause " print "odd behavior. ":SkipFlashWarningif o=0 and p=1 then goto "fast_video_md"if o=1 and p=1 then goto "slow_video_md"if o=1 and p=0 then goto "slow_md"if o=2 then goto "test_md"print "Fast react photo MD":fast_md_loop t=0 do release "shoot_half" press "shoot_half" do P=get_shooting until P=1 md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 9, h, e until t>0 let X=get_tick_count :contloop1 let U=get_tick_count let V=(U-X) if V<g then goto "contloop1" release "shoot_full" release "shoot_half" do P=get_shooting until P<>1goto "fast_md_loop":slow_mdprint "Slow react photo MD":slow_md_loop t=0 do md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 0, h, e until t>0 if g>0 then goto "contshoot2" else shoot goto "slow_md_loop" :contshoot2 press "shoot_full" let X=get_tick_count :contloop2 let U=get_tick_count let V=(U-X) if V<g then goto "contloop2" release "shoot_full" release "shoot_half" do P=get_shooting until P<>1goto "slow_md_loop":fast_video_mdif g<1 then g=1000print "Fast react video MD":fast_video_md_loop t=0 do release "shoot_half" press "shoot_half" sleep 1000 md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 9, h, e until t>0 rem press "shoot_full" was done by md_detect_motion print "starting video record" sleep 300 release "shoot_full" let X=get_tick_count :fastvideowaitloop let U=get_tick_count let V=(U-X) if V<g then goto "fastvideowaitloop" click "shoot_full" print "ending video record" rem Need to wait or shoot_half won't work and loop will work like slow react loop: sleep 1000goto "fast_video_md_loop":slow_video_mdif g<1 then g=1000rem Focusing takes time => add a second to make length argument a bit more accurate.g=g+1000print "Slow react video MD":slow_video_md_loop t=0 do md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 0, h, e until t>0 press "shoot_full" sleep 300 release "shoot_full" print "starting video record" let X=get_tick_count :slowvideowaitloop let U=get_tick_count let V=(U-X) if V<g then goto "slowvideowaitloop" click "shoot_full" print "ending video record"goto "slow_video_md_loop":test_md print "MD test, no shooting." N=0:test_md_loop t=0 do md_detect_motion a, b, f, n, d, c, 1, t, i, j+1, l+1, a-k, b-m, 0, h, e until t>0 N=N+1 print t, "cells, trigger ", Ngoto "test_md_loop":PlayModeError print "MDFB script ERROR:" print "Not in REC mode, exiting."end:VideoButtonError print "MDFB script ERROR:" print "Incompatible camera! Try" print "MDFB VideoButtonModels" print "version."end
I just tried posting the text file that accompanied the script but it exceeded the 7500 character limit. If you PM me your email address I can send you the zip file with everything in it.
Started by scipio General Help and Assistance on using CHDK stable releases
Started by srg General Help and Assistance on using CHDK stable releases
Started by weswitt General Help and Assistance on using CHDK stable releases
Started by polarapfel Script Writing
Started by GeekStyle59 General Help and Assistance on using CHDK stable releases