ich habe aus zwei verschiedenen Skripten ein Timelapse Skript geschaffen, was sowohl einfache Timelapse Aufnahmen machen kann, als auch HDR Timelapse mit der Serienbildfunktion der Kamera. Das heißt, sofern die Kamera eine schnelle Serienbildfunktion besitzt, sind sehr schnell aufeinander folgende Belichtungsreihen möglich, was ein kleines Intervall der Timelapse ermöglicht. Die folgenden beiden Skripte habe ich kombiniert:
1. http://chdk.wikia.com/wiki/Lua/Scripts: ... _pre-focus
2. viewtopic.php?t=1006
Aufgrund meiner noch sehr geringen Kenntnisse über alle speziellen Funktionen von CHDK und der grundlegenden Funktionsabfolge der Kamera, ist dieses Skript lediglich aus den beiden anderen kombiniert. Einzige Ausnahme ist der Einbau der 10tel Sekunden Abstufung. Der komplette Dank geht an die Entwickler der oben genannten Skripte.
Allerdings ist es nicht für jeden möglich, einfach zwei Skripte zu kombinieren, denn auch dazu gehört ein wenig Erfahrung. Deswegen habe ich mir gedacht, teile ich mein Skript mit euch. Vielleicht kann der ein oder andere etwas damit Anfangen. Besonders Vorteilhaft ist das Skript für alle Kameras, die eine Highspeed Serienbildfunktion besitzen. Dieses bietet große Geschwindigkeitsvorteile gegenüber dem Custom Timer der originalen Firmware.
Um die Funktionen des Skripts komplett zu verstehen, empfehle ich euch den Artikel im Wiki des ersten Skriptes zu lesen (http://chdk.wikia.com/wiki/Lua/Scripts: ... _pre-focus). Folgende Einstellungen bietet mein fertiges Skript:
- Secs/frame: Alle wieviele Sekunden soll ein Bild gemacht werden?
- 10thSecs/frame: Zur Einstellung des Intervalls auf 10tel Sekunden genau. Somit sind Intervalle von z.B. 2,5 Sekunden möglich
- Sequence hours: Wieviele Stunden soll eure Aufnahme gehen
- Sequence minutes: Wieviele Minuten soll eure Aufnahme gehen (Wird zu den Stunden addiert)
- HDR img amout: Ist dieser Wert auf 0, ist der HDR Modus deaktiviert. Ansonsten werden soviele Bilder in Serie geschossen, wie hier eingestellt wurde. Beachte: Hierzu muss der Serienbild-Modus der Kamera aktiv sein, sonst kommt hier eine entsprechende Meldung! Und außerdem muss die Reihe unter Reihe im fortlauf. Modus bei Extra-Foto-Einstellungen aktiviert werden.
- Endless?: Soll die Aufnahme endlos sein? 0 = Nein, 1 = Ja. Beachte: Der Endlosmodus ist mit Vorsicht zu genießen.
- Focus: 0 = Jedes mal, 1 = Am Anfang. Je nach Auswahl wird entweder einmal zu beginn der Belichtungsreihe Fokusiert, oder vor jeder Aufnahme
Display off frame: Nach wievielen Bildern soll das Display ausgeschaltet werden. Ist allerdings nicht bei jeder Kamera komplett möglich. 0 = Nie ausschalten
Ich selbst besitze eine SX220 HS und habe deswegen das Intervall Skript für die SX-Reihe genommen. Wenn bei euch das Ausschalten des Displays bei anderen Modellen nicht funktionieren sollte, muss das andere Skript genommen werden. Wenn ihr mir das mitteilt, kann ich es gerne anpassen.
Da aber auch für den Autofocus eine andere "property number" Verwendet wurde, habe ich hier direkt einmal 2 Versionen des Skripts bereitgestellt, auch wenn die beiden sich nur in der Zahl 18 und 67 unterscheiden. Die mit der Zahl 18 für die SX Reihe, die mit der anderen Zahl für alle anderen Reihen. Ich habe rudis Verbesserungsvorschlag befolgt. Jetzt gibt es nur noch ein Skript, was in allen Kameras funktionieren sollte. Danke rudi!
Ich konnte das Skript bis jetzt nur mit meiner SX220 HS testen, auf der es einwandfrei Funktioniert (nur die Display abschalten Funktion habe ich nicht getestet). Habe das Skript aber bereits einem Kollegen gegeben, der es auf der S3 IS testen wird und mir entsprechend Feedback geben wird.
Hier die Version des Skripts, einfach als hdrtl.lua (hdrtl kann durch einen beliebigen Namen ersetzt werden) speichern und in den CHDK/SCRIPTS Ordner eurer Kamera kopieren:
Syntax: [ Download ] [ Verstecken ]
Benutze Lua Syntax Highlighting
--[[
Author: Patrick Denzler (Patistar)
Added features:
- a 10th seconds parameter for the interval to allow more precise settings
- HDR img amout: This is the amount of image the script should take every intervall. To use this function you have to switch the mode of your camera to the continuous mode.
- Sunset mode: scripts increases the tv slower than it's getting darker. this will make a reel sunset feeling in the timelapse
Important:
For a real HDR Timelapse you have to activate the Bracketing in Continuous Mode in the Extra Photo Operations and set the Bracketing type and value to any of your choice in addition.
This Script is a modifcation of the Accurate Intervalometer with power-saving and pre-focus Script and the Turbo-Intervall Script.
The author of the Turbo-Intervall Script is: msl (from chdk-treff.de)
The author and the specifications of the Accurate Intervalometer with power-saving and pre-focus Script can be found below:
Author: Fraser McCrossan
Modification for SX100 IS: Anar Ibragimoff
An accurate intervalometer script, with pre-focus and screen power off options.
Features:
- input is frame interval plus total desired run-time (or "endless")
- displays frame count, frame total and remaining time after each frame
(in endless mode, displays frame count and elapsed time)
- honours the "Print" button during frame delays (so you can
get it running then turn off the display to save power)
- can turn off the display a given number of frames after starting
(might take a couple of frames longer to cycle to correct mode)
- can pre-focus before starting then go to manual focus mode
- use SET button to exit
Additional notes:
- To use "display off" feature, you need to configure your camera
to turn display off on "Print" button (in standard camera's menu)
- For additional power save I'd recommend to turn off preview after shoots (in standard camera's menu)
See bottom of script for main loop.
]]
--[[
@title (HDR) Time-lapse
@param s Secs/frame
@default s 5
@param t 10thSecs/frame
@default t 0
@param h Sequence hours
@default h 0
@param m Sequence minutes
@default m 5
@param c HDR img amount: 0=Off
@default c 0
@param u Sunset mode: 0=Off
@default u 0
@param q Sunet Bv Interval
@default q 3
@param v Sunset Bv Startvalue
@default v 1200
@param e Endless? 0=No 1=Yes
@default e 0
@param f Focus: 0=Every 1=Start
@default f 0
@param d Display off frame 0=never
@default d 0
--]]
-- convert parameters into readable variable names
secs_frame, milisecs_frame, hours, minutes, hdr, sunset, sunset_interval, sunset_startvalue, endless, focus_at_start, display_off_frame = s, t, h, m, c, (u > 0), q, v, (e > 0), (f > 0), d
props = require "propcase"
-- derive actual running parameters from the more human-friendly input
-- parameters
function calculate_parameters (seconds_per_frame, hours, minutes, start_ticks)
local ticks_per_frame = 1000 * secs_frame + 100 * milisecs_frame -- ticks per frame
local total_frames = (hours * 3600 + minutes * 60) / secs_frame -- total frames
local end_ticks = start_ticks + total_frames * ticks_per_frame -- ticks at end of sequence
return ticks_per_frame, total_frames, end_ticks
end
-- prints the status of the script on the screen
function print_status (frame, total_frames, ticks_per_frame, end_ticks, endless)
local free = get_jpg_count()
if endless then
local h, m, s = ticks_to_hms(frame * ticks_per_frame)
print("#" .. frame .. ", " .. h .. "h " .. m .. "m " .. s .. "s")
else
local h, m, s = ticks_to_hms(end_ticks - get_tick_count())
print(frame .. "/" .. total_frames .. ", " .. h .. "h" .. m .. "m" .. s .. "s/" .. free .. " left")
end
end
-- converts ticks to hours, minutes and seconds
function ticks_to_hms (ticks)
local secs = (ticks + 500) / 1000 -- round to nearest seconds
local s = secs % 60
secs = secs / 60
local m = secs % 60
local h = secs / 60
return h, m, s
end
-- sleep, but using wait_click(); return true if a key was pressed, else false
function next_frame_sleep (frame, start_ticks, ticks_per_frame)
-- this calculates the number of ticks between now and the time of
-- the next frame
local sleep_time = (start_ticks + frame * ticks_per_frame) - get_tick_count()
if sleep_time < 1 then
sleep_time = 1
end
wait_click(sleep_time)
return not is_key("no_key")
end
-- delay for the appropriate amount of time, but respond to
-- the display key (allows turning off display to save power)
-- return true if we should exit, else false
function frame_delay (frame, start_ticks, ticks_per_frame)
-- this returns true while a key has been pressed, and false if
-- none
while next_frame_sleep (frame, start_ticks, ticks_per_frame) do
-- honour the display button
if is_key("print") then
click("print")
end
-- if set key is pressed, indicate that we should stop
if is_key("set") then
return true
end
end
return false
end
-- click "print" to turn on/off display
function seek_display_mode()
click "print"
end
-- switch to autofocus mode, pre-focus, then go to manual focus mode
function pre_focus()
local focused = false
local try = 1
while not focused and try <= 5 do
print("Pre-focus attempt " .. try)
press("shoot_half")
sleep(2000)
if get_prop(props.FOCUS_STATE) > 0 then
focused = true
set_aflock(1)
end
release("shoot_half")
sleep(500)
try = try + 1
end
return focused
end
if focus_at_start then
if not pre_focus() then
print "Unable to reach pre-focus"
end
end
-- If continuous mode is off, stop!
if hdr > 0 then
if get_drive_mode() ~= 1 then
print("No continuous mode!!!")
sleep(2000)
exit_alt()
sleep(2000)
end
end
start_ticks = get_tick_count()
ticks_per_frame, total_frames, end_ticks = calculate_parameters((secs_frame+(milisecs_frame/10)), hours, minutes, start_ticks)
frame = 1
print "Press SET to exit"
while endless or frame <= total_frames do
print_status(frame, total_frames, ticks_per_frame, end_ticks, endless)
-- hdr shoot?
if hdr > 0 then
pics = get_exp_count()
press("shoot_half")
press("shoot_full")
while get_exp_count() - pics < hdr - 1 do
sleep(1)
end
release("shoot_full")
release("shoot_half")
-- sunset shoot?
elseif sunset then
press("shoot_half")
repeat sleep(10) until get_shooting() == true
-- get actually brightness
bv = get_bv96()
-- if it's darker than the start value to increase tv increase it
if bv < sunset_startvalue then
-- if faktor is not set yet calcuate the first faktor, else calculate a newfaktor to compare it in the next if
if faktor == nil then
faktor = (sunset_startvalue - bv)/sunset_interval
else
newfaktor = (sunset_startvalue - bv)/sunset_interval
end
-- if newfaktor is set and newfaktor is bigger than the old faktor increase the old factor, else do nothing
if newfaktor ~= nil and (newfaktor > faktor) then
faktor = faktor + 1
end
-- calculate and set tv
tv = 1120 - (faktor*2)
set_tv96_direct( tv )
else
set_tv96( 1120 )
end
print("Bv: ", bv, " Faktor: ", faktor, " TV: ", tv)
press("shoot_full")
release("shoot_full")
release("shoot_half")
-- kein hdr shoot
else
shoot()
end
if display_off_frame > 0 and frame >= display_off_frame then
seek_display_mode()
end
if frame_delay(frame, start_ticks, ticks_per_frame) then
print "User quit"
break
end
frame = frame + 1
end
-- restore display mode
if display_off_frame > 0 then
seek_display_mode()
end
-- restore focus mode
set_aflock(0)
Author: Patrick Denzler (Patistar)
Added features:
- a 10th seconds parameter for the interval to allow more precise settings
- HDR img amout: This is the amount of image the script should take every intervall. To use this function you have to switch the mode of your camera to the continuous mode.
- Sunset mode: scripts increases the tv slower than it's getting darker. this will make a reel sunset feeling in the timelapse
Important:
For a real HDR Timelapse you have to activate the Bracketing in Continuous Mode in the Extra Photo Operations and set the Bracketing type and value to any of your choice in addition.
This Script is a modifcation of the Accurate Intervalometer with power-saving and pre-focus Script and the Turbo-Intervall Script.
The author of the Turbo-Intervall Script is: msl (from chdk-treff.de)
The author and the specifications of the Accurate Intervalometer with power-saving and pre-focus Script can be found below:
Author: Fraser McCrossan
Modification for SX100 IS: Anar Ibragimoff
An accurate intervalometer script, with pre-focus and screen power off options.
Features:
- input is frame interval plus total desired run-time (or "endless")
- displays frame count, frame total and remaining time after each frame
(in endless mode, displays frame count and elapsed time)
- honours the "Print" button during frame delays (so you can
get it running then turn off the display to save power)
- can turn off the display a given number of frames after starting
(might take a couple of frames longer to cycle to correct mode)
- can pre-focus before starting then go to manual focus mode
- use SET button to exit
Additional notes:
- To use "display off" feature, you need to configure your camera
to turn display off on "Print" button (in standard camera's menu)
- For additional power save I'd recommend to turn off preview after shoots (in standard camera's menu)
See bottom of script for main loop.
]]
--[[
@title (HDR) Time-lapse
@param s Secs/frame
@default s 5
@param t 10thSecs/frame
@default t 0
@param h Sequence hours
@default h 0
@param m Sequence minutes
@default m 5
@param c HDR img amount: 0=Off
@default c 0
@param u Sunset mode: 0=Off
@default u 0
@param q Sunet Bv Interval
@default q 3
@param v Sunset Bv Startvalue
@default v 1200
@param e Endless? 0=No 1=Yes
@default e 0
@param f Focus: 0=Every 1=Start
@default f 0
@param d Display off frame 0=never
@default d 0
--]]
-- convert parameters into readable variable names
secs_frame, milisecs_frame, hours, minutes, hdr, sunset, sunset_interval, sunset_startvalue, endless, focus_at_start, display_off_frame = s, t, h, m, c, (u > 0), q, v, (e > 0), (f > 0), d
props = require "propcase"
-- derive actual running parameters from the more human-friendly input
-- parameters
function calculate_parameters (seconds_per_frame, hours, minutes, start_ticks)
local ticks_per_frame = 1000 * secs_frame + 100 * milisecs_frame -- ticks per frame
local total_frames = (hours * 3600 + minutes * 60) / secs_frame -- total frames
local end_ticks = start_ticks + total_frames * ticks_per_frame -- ticks at end of sequence
return ticks_per_frame, total_frames, end_ticks
end
-- prints the status of the script on the screen
function print_status (frame, total_frames, ticks_per_frame, end_ticks, endless)
local free = get_jpg_count()
if endless then
local h, m, s = ticks_to_hms(frame * ticks_per_frame)
print("#" .. frame .. ", " .. h .. "h " .. m .. "m " .. s .. "s")
else
local h, m, s = ticks_to_hms(end_ticks - get_tick_count())
print(frame .. "/" .. total_frames .. ", " .. h .. "h" .. m .. "m" .. s .. "s/" .. free .. " left")
end
end
-- converts ticks to hours, minutes and seconds
function ticks_to_hms (ticks)
local secs = (ticks + 500) / 1000 -- round to nearest seconds
local s = secs % 60
secs = secs / 60
local m = secs % 60
local h = secs / 60
return h, m, s
end
-- sleep, but using wait_click(); return true if a key was pressed, else false
function next_frame_sleep (frame, start_ticks, ticks_per_frame)
-- this calculates the number of ticks between now and the time of
-- the next frame
local sleep_time = (start_ticks + frame * ticks_per_frame) - get_tick_count()
if sleep_time < 1 then
sleep_time = 1
end
wait_click(sleep_time)
return not is_key("no_key")
end
-- delay for the appropriate amount of time, but respond to
-- the display key (allows turning off display to save power)
-- return true if we should exit, else false
function frame_delay (frame, start_ticks, ticks_per_frame)
-- this returns true while a key has been pressed, and false if
-- none
while next_frame_sleep (frame, start_ticks, ticks_per_frame) do
-- honour the display button
if is_key("print") then
click("print")
end
-- if set key is pressed, indicate that we should stop
if is_key("set") then
return true
end
end
return false
end
-- click "print" to turn on/off display
function seek_display_mode()
click "print"
end
-- switch to autofocus mode, pre-focus, then go to manual focus mode
function pre_focus()
local focused = false
local try = 1
while not focused and try <= 5 do
print("Pre-focus attempt " .. try)
press("shoot_half")
sleep(2000)
if get_prop(props.FOCUS_STATE) > 0 then
focused = true
set_aflock(1)
end
release("shoot_half")
sleep(500)
try = try + 1
end
return focused
end
if focus_at_start then
if not pre_focus() then
print "Unable to reach pre-focus"
end
end
-- If continuous mode is off, stop!
if hdr > 0 then
if get_drive_mode() ~= 1 then
print("No continuous mode!!!")
sleep(2000)
exit_alt()
sleep(2000)
end
end
start_ticks = get_tick_count()
ticks_per_frame, total_frames, end_ticks = calculate_parameters((secs_frame+(milisecs_frame/10)), hours, minutes, start_ticks)
frame = 1
print "Press SET to exit"
while endless or frame <= total_frames do
print_status(frame, total_frames, ticks_per_frame, end_ticks, endless)
-- hdr shoot?
if hdr > 0 then
pics = get_exp_count()
press("shoot_half")
press("shoot_full")
while get_exp_count() - pics < hdr - 1 do
sleep(1)
end
release("shoot_full")
release("shoot_half")
-- sunset shoot?
elseif sunset then
press("shoot_half")
repeat sleep(10) until get_shooting() == true
-- get actually brightness
bv = get_bv96()
-- if it's darker than the start value to increase tv increase it
if bv < sunset_startvalue then
-- if faktor is not set yet calcuate the first faktor, else calculate a newfaktor to compare it in the next if
if faktor == nil then
faktor = (sunset_startvalue - bv)/sunset_interval
else
newfaktor = (sunset_startvalue - bv)/sunset_interval
end
-- if newfaktor is set and newfaktor is bigger than the old faktor increase the old factor, else do nothing
if newfaktor ~= nil and (newfaktor > faktor) then
faktor = faktor + 1
end
-- calculate and set tv
tv = 1120 - (faktor*2)
set_tv96_direct( tv )
else
set_tv96( 1120 )
end
print("Bv: ", bv, " Faktor: ", faktor, " TV: ", tv)
press("shoot_full")
release("shoot_full")
release("shoot_half")
-- kein hdr shoot
else
shoot()
end
if display_off_frame > 0 and frame >= display_off_frame then
seek_display_mode()
end
if frame_delay(frame, start_ticks, ticks_per_frame) then
print "User quit"
break
end
frame = frame + 1
end
-- restore display mode
if display_off_frame > 0 then
seek_display_mode()
end
-- restore focus mode
set_aflock(0)
Erstellt in 0.012 Sekunden, mit GeSHi 1.0.8.9
Falls es noch Fragen oder Probleme gibt, könnt ihr euch gerne bei mir melden. Am besten hier im Thread!
Liebe Grüße aus Australien
Patrick