This is the very basic script for making trip video for S3.
--[[
@title Cycled Video intervalometer
@param b video length in seconds
@default b 300
@param v buffer wait time in 1/1000sec
@default v 4000
@param c number of videos, >2
@default c 4
@param p print log (1==enabled)
@default p 0
@param k delete all files from SD
@default k 0
--]]
--[[
Req:
just free SD card,
Canon S3 camera,
Predfined shooting parameters in chosen mode
No photos or other files in DCIM - they will be killed
Only current CANONxxx folder in DCIM allowed (it can be deleted by "Erase all" or CHDK File Browser)
if script fails or jamm, try to increase buffer wait time
mailto: wild_creator@inbox.ru
--]]
a=1
if k==1 then
dir = os.listdir("A/DCIM", false)
count = table.getn(dir)
for i=1,count do
dirr = os.listdir("A/DCIM/"..dir[i], false)
[admin: avoid swearing please] = table.getn(dirr)
for j=1,[admin: avoid swearing please] do
s="A/DCIM/"..dir[i].."/"..dirr[j]
if p==1 then print ("Removing: "..s) end
os.remove(s)
end
end
end
while true do
if p==1 then print("cycle start") end
if p==1 then print(a) end
press("video")
sleep(1000)
release("video")
if p==1 then print("recording..") end
sleep(b*1000)
if p==1 then print("stopping rec...") end
click("video")
sleep(200)
if p==1 then print("waiting for buffer...") end
sleep(v)
a=a+1
if a==c+1 then
if p==1 then print("video files limit") end
a=c
dir = os.listdir("A/DCIM", false)
count = table.getn(dir)
s=dir[count]
s="A/DCIM/"..s
dir = os.listdir(s,false)
count = table.getn(dir)
s=s.."/"
if p==1 then print("removing "..dir[1]) end
os.remove(s..dir[1])
if p==1 then print("removing "..dir[2]) end
os.remove(s..dir[2])
if p==1 then print("waiting for buffer...") end
sleep(v)
end
if p==1 then print("cycle end") end
end
This script keep defined No of video files on SD, and automatically delete old ones.