The most advanced time-lapse script (hopefully) - Script Writing - CHDK Forum

The most advanced time-lapse script (hopefully)

  • 5 Replies
The most advanced time-lapse script (hopefully)
« on: 15 / June / 2012, 15:38:50 »
Hi all,

A time-lapse script again? You may ask.
Yes, because there are still several features missing from different scripts, and I thought that I will unite them into one.

But...of course I'm stuck at the beginning.

The code at this moment:
Code: [Select]
rem focusing with option to fail-safe focus method
set_aflock 0
h = get_hyp_dist
f = h+5000
set_focus f
sleep 1000
get_focus x
if z <> f then gosub "backup_focus"
set_aflock 1

Because I want to create videos, where the focus is fixed (MUCH less mechanical stress, and no moving focus between pictures), I had the thought that I call the help of get_hyp_dist function. Basically this should give back the distance where everything should be clear. Then I add some more value to it just to debug, and set this value as focus distance. I wait 1 sec, so the focus could be set mechanically. After that I just read out the focus, but it turn out that it is not set. This information came from the chdk debug tool.

When I try the script at the camera, it is clear that focus is not set by that command. What I miss?


Re: The most advanced time-lapse script (hopefully)
« Reply #1 on: 15 / June / 2012, 15:56:13 »
What is 'z' ?

I am not sure what you are trying to do, why not just lock autofocus before you shoot the sequence ?
« Last Edit: 15 / June / 2012, 15:58:06 by Microfunguy »

Re: The most advanced time-lapse script (hopefully)
« Reply #2 on: 15 / June / 2012, 16:23:04 »
When you are debugging it is good idea to simplify things step by step to see what causes an error.

Did you try to just use set_focus itself with constant value without other commands? Does it work? Try to print more things to check, whether all commands return good values (get_hyp_dist, get_zoom for example).

And as Microfunguy said - maybe is much more easy to use MF on camera and set the focus before script is run? I usually do this for nightly timelapses (however, I forgot this a few times).
if (2*b || !2*b) {

Compile error: poor Yorick

Re: The most advanced time-lapse script (hopefully)
« Reply #3 on: 15 / June / 2012, 16:31:48 »
I did not actually say that, though you could simply use manual focus.

At wide-angle and slightly more, everything from one metre to infinity will be in focus.
Adding another 5m makes no difference.

Re: The most advanced time-lapse script (hopefully)
« Reply #4 on: 15 / June / 2012, 16:44:41 »
The 'z' should be 'x'. I've corrected it, but the source of the problem that set_focus is not working.
And as I mentioned, I just add the 5m to focus to debug. This is how I've found that set_focus cannot set the distance.

Of course I debug by step by step. That's why I know that set_focus is now working (also on the camera itself, which is an ixus 850 is). I've haven't tried set_focus itself with a constant value. I do it now.
My main goal is that I don't need to make such procedures like now when I start a timelapse picture set. Setting and fix the focus before it now a little unnecessary complicated.

Mod: changing "set_focus f " to "set_focus 6000" didn't helped. :-(

Re: The most advanced time-lapse script (hopefully)
« Reply #5 on: 16 / June / 2012, 02:59:29 »
Seems like something is broken on your CHDK port. Do you use stable 1.0 version of the CHDK or trunk? If you are not sure, where did you download it from?

Does CHDK focus overrides work? I mean set in CHDK menu, not by script. You can also try any focus bracketing script to compare results...
if (2*b || !2*b) {

Compile error: poor Yorick


Related Topics