CHDK Forum

Using CHDK => CHDK Releases => Topic started by: a710is on 18 / January / 2008, 15:39:50

Title: Manual focus in video mode
Post by: a710is on 18 / January / 2008, 15:39:50
this feature seems to have appeared but which builds have it?
Title: Re: Manual focus in video mode
Post by: a710is on 26 / January / 2008, 06:55:16
so I'm asking again. is manual focus in video mode supported in any builds?
Title: Re: Manual focus in video mode
Post by: Barney Fife on 26 / January / 2008, 10:24:59
Deleted
Title: Re: Manual focus in video mode
Post by: a710is on 26 / January / 2008, 12:08:51
ewavr is said to have added it in the build which would be better

http://chdk.setepontos.com/index.php/topic,323.msg2270.html#msg2270

But I'm still hoping that it's possible to change sound format in video mode to 16 bit 22 kHz or something like that, now when I can use optical zoom and manual focus with Ewavr's latest builds

http://chdk.setepontos.com/index.php/topic,318.msg2110.html#msg2110

Tryed Zoom-Video on Allbest build with my A620 and it doesn't work correctly. My findings:

- set_zoom_rel command doesn't refocurs while zooming in video mode, while it does in Ewavr's build.
  So after zooming in or out, video is not in focus anymore
- I added some set_focus commands, associated with keys up and down, to enable manual focusing in video mode.
  They work on Ewavr's build, but on Allbest build, they don't work at all


maybe both a supporting build and a script are needed. I hope vit40 will reply to this topic, or I'll contact him. also hopefully Allbest will add support and maybe he or ewavr will post here as well.
I don't know about S3 but on the A710 manual focus change definitely doesn't work while filming, I can only set it before recording. Canon policy I guess.  :( .
Title: Re: Manual focus in video mode
Post by: vit40 on 29 / January / 2008, 04:56:06
I'm using Ewavr's build and my script, which is development of Zoom-Video script, so I can use zoom and manual focus. It doesn't work with allbest build at the moment, as I described. Allbest said he will check his build to trace the problem
Title: Re: Manual focus in video mode
Post by: kamil on 11 / February / 2008, 21:43:23
I wrote script with MF & video, it's working with Allbest fine.
http://chdk.setepontos.com/index.php/topic,417.0.html (http://chdk.setepontos.com/index.php/topic,417.0.html)

Remember that small focus is impossible with big zoom so camera lost any small focus while zooming.
Title: Re: Manual focus in video mode
Post by: a710is on 12 / February / 2008, 04:46:38
It's great :D
it works flawlessly
is it possible to change the script so that when you keep a focus buttons pressed, it changes focus at short (defineable) intervals so that it at least appears to change from small focus to big focus more smoothly?
cause now it wether changes focus almost instantly or you have to keep pressing those up/down buttons which also shakes the camera.
also, having the camera start recording at a certain focus position
and macro style focus doesn't seem to work

anyway, great job :)
Title: Re: Manual focus in video mode
Post by: a710is on 12 / February / 2008, 05:33:33
I don't have a exp_corr button so I have customized the script for a710 to allow using the second auto focus setting instead of a zoom step button (left)
so in this version the left button focuses to a custom position instead of setting a custom zoom step.
the help may contain errors, I was kind of superficial :)
the a710 zoom has one more step but I've left it like that cause I don't like the way the lens stop when they get to 6x zoom so I've let it only go to 5.3 when pressing the right button

Code: [Select]
rem Author kamil, script ver. 2.0 (customized by someone else), allbuild, works on a710is,...
@title zoom and focus in video
@param a auto focus /erase/
@default a 11
@param b auto focus /left/
@default b 1
@param d step zoom /set/ - at start
@default d 3
@param e step zoom /right/
@default e 13
@param f auto zoom /display/
@default f 1
@param g auto focus /display/
@default g 2
@param h auto zoom /menu/
@default h 11
@param i auto focus /menu/
@default i 10
@param j help (1-on)

if j=1 then gosub "help"

get_prop 12 q
if q=0 then set_prop 12 1

z=d

rem zoom range, change this value if your zoom is different
k=13

get_focus u
o=0

do
o=o+1
p=o*o*(o+1)*(o+1)+90
until u<p

v=o

press "shoot_half"
sleep 800
click "shoot_full"
print "HALF SHOOT - stop record"
:loop
wait_click
if is_key "zoom_in" then goto "in"
if is_key "zoom_out" then goto "out"
if is_key "up" then goto "add_focus"
if is_key "down" then goto "min_focus"
if is_key "left" then goto "focus_2"
if is_key "set" then z=d
if is_key "right" then z=e
if is_key "erase" then goto "focus_1"
if is_key "display" then goto "zoom_focus_1"
if is_key "menu" then goto "zoom_focus_2"
if is_key "shoot_half" then goto "end"
goto "loop"

:in
if z<0 then let z=1
if z>k then let z=k
set_zoom_rel z
get_zoom t
print "zoom", t; "/" k
goto "loop"

:out
if z<0 then let z=1
if z>k then let z=k
set_zoom_rel -z
get_zoom t
print "zoom", t; "/" k
goto "loop"

:focus_1
v=a
gosub "focus_dance"
goto "loop"

:focus_2
v=b
gosub "focus_dance"
goto "loop"

:zoom_focus_1
if g>0 then gosub "focus_zoom_focus_1"
if f>0 then gosub "zoom_zoom_focus_1"
if g>0 then gosub "focus_zoom_focus_1"
goto "loop"

:focus_zoom_focus_1
v=g
gosub "focus_dance"
return

:zoom_zoom_focus_1
set_zoom f
print "zoom", f; "/" k
return

:zoom_focus_2
if i>0 then gosub "focus_zoom_focus_2"
if h>0 then gosub "zoom_zoom_focus_2"
if g>0 then gosub "focus_zoom_focus_2"
goto "loop"

:focus_zoom_focus_2
v=i
gosub "focus_dance"
return

:zoom_zoom_focus_2
set_zoom h
print "zoom", h; "/" k
return

:add_focus
v=v+1
gosub "focus_dance"
goto "loop"

:min_focus
v=v-1
gosub "focus_dance"
goto "loop"

:focus_dance
u=(v*v*v*v)+90
if v>=11 then u=65535
if v<1 then let v=1
if v>11 then let v=11
set_focus u
get_focus t
print "focus", v; "/11 ("t; " mm)"
return

:end
click "shoot_full"
end

end

:help
print "Use with CAUTION"
print "working on A710is"
print "maybe others too"
print "or you need modify this"
print " - [ click ANY KEY ] - "
wait_click
print "script. Zoom and focus"
print "values could be different"
print "lines to modify:"
print "31,132,133"
print " - [ click ANY KEY ] - "
wait_click
print "keys:"
print "UP/DOWN - focusing"
print "ZOOM IN/ZOOM OUT -zooming"
print "SET/RIGHT - zoom set"
print " - [ click ANY KEY ] - "
wait_click
print "LEFT/ERASE - focus set"
print "DISPL/MENU - zoom & focus"
print "You can disable focus"
print "or zoom setting by enter"
print " - [ click ANY KEY ] - "
wait_click
print "0 parameter"
print "focus has 11 steps"
print "zoom has 15 steps"
print "Use DISPLAY & MENU"
print " - [ click ANY KEY ] - "
wait_click
print "for best & fast results."
print "Press SHOOT HALF"
print "to stop recording"
print "Because of zoom and"
print " - [ click ANY KEY ] - "
wait_click
print "focusing noises"
print "i suggest record the"
print "sound with another"
print "recorder and join with"
print " - [ click ANY KEY ] - "
wait_click
print "nandub for example"
print "enter 0 in help param"
print "and play the game :)"
print " - [ click ANY KEY ] - "
wait_click
cls
return
Title: Re: Manual focus in video mode
Post by: kamil on 19 / February / 2008, 11:59:04
is it possible to change the script so that when you keep a focus buttons pressed, it changes focus at short (defineable) intervals so that it at least appears to change from small focus to big focus more smoothly?

Good idea. It is possible i think. I will work on it :)

[add day after:]
No, its impossible to make it so nice as we want. CHDK inform only about key pressed, not key release. You can put key_release but You cant get it.

Quote
also, having the camera start recording at a certain focus position and macro style focus doesn't seem to work

Before recording get AF with half pressed shot button and then press Manual Focus.

Here you can find another script for video. There is nice idea of using half shot button.
http://chdk.wikia.com/wiki/UBASIC/Scripts:_Easy_Zoom_%26_MF_while_Video_Recording (http://chdk.wikia.com/wiki/UBASIC/Scripts:_Easy_Zoom_%26_MF_while_Video_Recording)

Thanks for Your applause  :) it's nice to know that my work is needful. I'm glad that i can help.
Title: Re: Manual focus in video mode
Post by: kamil on 21 / February / 2008, 08:39:21
You dont must to change script to make display and menu keys only for focusing. The idea of this script is to make it most configurable by parameters. So if you enter "0" in "auto zoom /display/" parameter then auto zoom is off and "display" works like a "erase" key (only to set a focus). If You set "0" in "auto focus /display/" then display works only for auto zoom. It's written in help but very laconicall.

BTW i correct some features and there is 2.5 version :)
- there was na error in focusing by "menu" button
- nice visualisation of important parameters

In the future i must think about half shoot button. Maybe it will be good idea to give up stop recording. You can always stop record by escape from script and press shoot. But it generate noise and shock :/ . Maybe another focus step (not only +/- 1) will be good idea?
Title: Re: Manual focus in video mode
Post by: vit40 on 21 / February / 2008, 10:51:28
Kamil,

I like idea to stop recording with full press of the shutter, so I tried your script. But when I fully press the shutter to stop recording, my A620 writes *** INTERRUPTED ***, script is stopped, put recording isn't (red dot is still on, counter is still counting). On next full press of the shutter, recording stops, but script is started again (with no effect, unfortunatelly). Is it the same with your camera (which one) ?

Title: Re: Manual focus in video mode
Post by: kamil on 22 / February / 2008, 05:26:20
Yes! All scripts are interruped by full shutter pressing. It's chdk suitability. It's stop recording because script press the shutter at start. It's not bug. I meant full press, print, full press. It brutally escape from script and stop recording. But now i have another idea. Somethink like double click will be better.