Need help with a rather simple night time script - Script Writing - CHDK Forum  

Need help with a rather simple night time script

  • 6 Replies
  • 5734 Views
*

Offline kezug

  • *
  • 38
Need help with a rather simple night time script
« on: 03 / April / 2010, 08:36:45 »
Advertisements
I am using this script to simply take shots every x seconds with a Tv mode I preset.

I am using a G11 for this script.

I am confused as to what   set_tv96_direct -576 actually does.
Is set_tv96_direct for setting Tv(shutter speed)?

What value do I set it to for 30 seconds shutter speed.
What value do I set it to for 1/25 seconds shutter speed.
Or do I just set Tv and then run the script and the script will just operate as Tv is set in my camera?

Also, if in M mode, and I set focus to MF to infinity, then run this script, will each shot's focus be set to infinity (this is what I want).

I got this script from: http://chdk.wikia.com/wiki/UBASIC/Scripts:Long_Exposure_Intervalometer

rem Author - Keoeeit
rem ReAuthor - Chuck
rem USE WITH CAUTION
rem do not run for many hours or days
@title Non-stop Long Exp Timelapse
@param a Interval (Minutes)
@default a 0
@param b Interval (Seconds)
@default b 30
@param c Interval (10th Seconds)
@default c 0
@param d Initial Delay (Seconds)
@default d 3
@param e Noise reduction (0=auto 1=off 2=on)
@default e 1
@param f Capture Raw Image (0 or 1)
@default f 1
@param g ISO (-1=hi,0=auto,1=80,..,5=800)
@default g 1

t=a*60000+b*1000+c*100
 
if t<100 then let t=5000
 
n=1
 
print "Interval shooting."
print "Until you interrupt it."
print "Use with caution."

sleep d*1000
 
rem Display mode off
rem 181 Display mode (Valid for record mode only) 0 = Show info icons, 1 = Do not show info icons, 2 = LCD is off, 3 = EVF.
rem This didn't seem to work for the A560
set_prop 181 2

goto "shot"
 
:shot
  print "Shot number", n
  set_raw_nr e
  set_raw f
  set_iso g
  set_tv96_direct -576
  shoot
  n=n+1
  sleep t
goto "shot"
« Last Edit: 03 / April / 2010, 08:44:21 by kezug »

Re: Need help with a rather simple night time script
« Reply #1 on: 03 / April / 2010, 10:53:56 »

I am confused as to what   set_tv96_direct -576 actually does.
Is set_tv96_direct for setting Tv(shutter speed)?

Yes.
There are 96 units per EV and the reference value is zero = one second.
Negative numbers are longer exposure, postive numbers are shorter exposure.

So, -576 =- 6 * 96  .. the exposure is six EV's longer.
In seconds that is 2^6 = 64 seconds.
Not very user friendly.

Quote
What value do I set it to for 30 seconds shutter speed.

Well, 32 seconds would be one EV less than 64 seconds so it equals -576 + 96 = -480.

Quote
What value do I set it to for 1/25 seconds shutter speed.

1/32 seconds would be + 480, so 1/25 is about 448.

*

Offline kezug

  • *
  • 38
Re: Need help with a rather simple night time script
« Reply #2 on: 03 / April / 2010, 14:40:13 »
I am sure you are explaining this correctly, but I am lost.

Without CHDK, I simply set my Tv to 60", 30", 15" () or 1/25, 1/100, etc.. for fractions of seconds.  Why is it so formulaic here?  Or am I missing something...I was asking for shutter speed, and you were mentioned Ev.

What is the diff between set_tv96_direct and set_tv???

Re: Need help with a rather simple night time script
« Reply #3 on: 03 / April / 2010, 15:26:34 »
Without CHDK, I simply set my Tv to 60", 30", 15" () or 1/25, 1/100, etc.. for fractions of seconds.

With SDM you can use :-

shutter_speed 1/125

(http://stereo.jpn.org/eng/sdm/ubasic.htm)

Quote
Why is it so formulaic here?

Don't know, that is just how CHDK does it.

Quote
I was asking for shutter speed, and you were mentioned Ev.

Exposure depends on aperture (or ND filter in/out position), shutter-speed and ISO.
If aperture and ISO are fixed, the exposure value changes in the way I described when shutter-speed is changed.

Quote
What is the diff between set_tv96_direct and set_tv???

Well, that is a very reasonable question ...

set_tv uses a parameter that is an index to a list of Tv96 values.
Again, index 0 corresponds to a Tv96 of 0.
An index of -12 corresponds to a Tv96 of -384.

In other words, the index is the number of 1/3EV units .. that is units of 32.

So, set_tv -12  and set_tv_direct -384 are the same, except set_tv96_direct overrides exposure on half-press whereas set_tv tries to override it immediately.

As far as I know, that may not always work correctly.

I think there are historical reasons why set_tv exists.

It is all a bit complicated.
« Last Edit: 03 / April / 2010, 15:28:25 by Microfunguy »


*

Offline kezug

  • *
  • 38
Re: Need help with a rather simple night time script
« Reply #4 on: 03 / April / 2010, 20:18:46 »
Damn, you know your stuff...and thangs for carefully explaining it. It seems that I am not the only one scratching their heads on this stuff.

I am a programmer (RPG, Java, C, C++) all I need to do now is understand the camera functions and the meanings of these values and I will be ready to write my own scripts!

*

Offline reyalp

  • ******
  • 14077
Re: Need help with a rather simple night time script
« Reply #5 on: 03 / April / 2010, 21:33:33 »
Don't know, that is just how CHDK does it.
The CHDK *96 functions use the same units the canon firmware does. The canon firmware uses APEX * 96 because that allows use of APEX values (which are by far the most reasonable way to deal with exposure parameters, see http://dougkerr.net/Pumpkin/articles/APEX.pdf for an excellent description.) and integer math (the camera doesn't have an FPU). 96 is particularly convenient, because with a little fudging you can get 1/3 and 1/2 stop increments as integers.
Quote
So, set_tv -12  and set_tv_direct -384 are the same, except set_tv96_direct overrides exposure on half-press whereas set_tv tries to override it immediately.
Not quite. set_tv is an alias for set_user_tv_by_id. The *user* functions operate on the propcases that are set in manual override modes in the canon firmware (Tv, Av, Manual, Long shutter) The camera must support manual modes, and (AFAIK) must be in the appropriate manual mode for these to take effect. On the plus side, they don't confuse the canon firmware, because it is almost exactly the same as setting it using the canon UI. This means that the exif should be correct, and Tv or Av mode should operate as usual.

set_tv96 and set_tv96_direct set a different propcase in the override hook (during half press), which should work on all cameras in all modes, but the canon firmware will be less aware of the setting. _direct means that arbitrary values are accepted, rather than the just increments the canon firmware knows about.

I assume set_tv being an alias for _user is a historical artifact, as indicated by the //FOR COMPATIBILITY comment in ubasic/tokenizer.c

I would guess the whole by_id system is also a leftover.

Note that set_user_tv96 is also available, if you want tot work in APEX*96 units (which you should!).
Quote
It is all a bit complicated.
This is certainly correct  :-[

Damn, you know your stuff...and thangs for carefully explaining it. It seems that I am not the only one scratching their heads on this stuff.

I am a programmer (RPG, Java, C, C++) all I need to do now is understand the camera functions and the meanings of these values and I will be ready to write my own scripts!
When in doubt, Use the source.


Don't forget what the H stands for.

Re: Need help with a rather simple night time script
« Reply #6 on: 08 / April / 2010, 13:17:40 »
I know I'm a little late, but if you download yass02.zip, I included a file I created called Tv-settings.txt.

It should have all the numbers you need for quick reference.

http://chdk.setepontos.com/index.php/topic,4920.0.html

 

Related Topics