CHDK Wiki
Register
Advertisement

Using property case values[]

(Fix This : as of March 2011 there are four differenct sets of property case values identified - these vary by camera model. The prop_case values give here are only for prop_case 1 )

When, Where, and How to use the property case variables

The property cases allow you to control and/or assess many more camera features or parameters than the current CHDK script command set presently allows. In this section I’ve tried to categorize some of the more useful properties by the nature of how you might use them.

As a general reminder, the format of Fingalo's uBasic commands to access the property cases is:

 get_prop p v and set_prop p v
    where p= the property case number and v = the value of that property.

The Property case exploration page has a fuller description of the property cases that have been uncovered, and lists the values that are returned when reading these properties under different conditions. Note also that the property numbers are probably valid only for the Digic II cameras (and the value of the properties should be confirmed in your camera, if your camera is not an S3).


1. Properties that you can read *and* can effectively set, and thereby allow you to do things that CHDK can’t otherwise do (either CHDK has no function to control it, or you can get an additional range)

23 Image quality (jpg compression): 0, 1, 2 from best to worst quality
24 Image resolution: 0, 1, 2, 4, 8 for L, M1, M2, S, W  (these are S3
      designations: L is full resolution, M1 and M2 are progressively lower
      resolutions, S is 640x480, and W is a “wide screen” format: full
      resolution width, but less than full resolution height).
16 flash state  0=AUTO, 1=ON, 2=OFF.  Note: regardless of the button
      setting, if the flash has not been raised, then this property reports
      a 2 (i.e., OFF).  However, if it reports 0 or 1, you can nonetheless
      prevent a flash by setting this property to “2”.
25 & 26 Exposure compensation: you can set this to a much wider range than
      the native camera firmware allows (it has been test as far as +/- 4
      stops; the native camera range limit is +/- 2 stops).  Note: you must
      set both 25&26 to the same value.  The units of these properties are
      + or - 96 units per full stop (in other words -32 for -1/3 stop,
      -64 for -2/3 stop, -96 for -1 full stop, etc, and positive values for
      over-exposure settings) 
32 Exposure bracket range: like #25&26, you can go beyond the native
      camera limit (Set using units similar to 25 & 26: 96 =  +/- 1 stop)


2. Properties that you can read *and* can effectively set (and CHDK can control it only by a more awkward sequence of button pushes)

206 White Balance 0=OFF, 1-11 for various setting
    2,3,4,207,208,209,210 Custom MyColors setting
34 Focus bracket range: set to either 2 for the smallest range, 1 for
      medium, and 0 for the largest focus bracket range.  (CHDK could do
      this with button pushes: this is more direct)


3. Properties you could read and effectively set, but CHDK already has a command to control it effectively.

21 ISO 0=auto,1-hi-Iso, or actual iso.  CHDK has a get/set_iso
      command, although it uses a different range of arguments 
      (-1,0,1,2,3,4,5 for hi-iso, auto, then 50(80), 100, 200, 400, 800).
      Either one works the same.  You can also change the ISO by reading
      this property, and then use one or more click “iso” commands to change
      it (thus ensuring that the camera is fully aware of the change).


4. Properties you can NOT set, but you can read in order to determine the state, so that you can more reliably change the parameter using button pushes.

6   Drive mode:  0 = single shot, 1 = continuous, 2 = timer
8   Hi-speed continuous: 1 = OFF (!), 0 = ON (!)  (note the reversed logic)
12  Manual Focus mode: 1 = manual, 0 = auto
67  Focus ok: 1=YES, 0=NO.  Use this after a click “shoot_half” to
       determine whether the camera has set the proper focus before you
       activate focus lock (with button clicks appropriate for your camera).
36  Bracket mode:  0=NONE, 1 = exposure, 2 = focus.
126 Video Frame rate (15, 30 or 60 fps)
127 Video resolution 2 for 640x480; 1 for 320x240
128 Video resolution 1 for 640x480; 0 for 320x240
11  Macro mode:  0=NO, 1=Macro, 5=super macro.
4   Self-timer delay (in milliseconds).  Not settable, but you can use
       with button pushes to change
181 Display mode (Valid for record mode only) You can change this value 
       by pressing Disp button.
       0 = Show info icons, 1 = Do not show info icons, 
       2 = LCD is off, 3 = EVF.

One of the problems with using menu button pushes (and then up/down and left/right) to change some variables is that menu value settings are sometimes cyclical: once you reach the highest value it rolls over to the lowest. So if you don't know what the starting value is, you can't change it. By reading the state of that parameter first, you can figure it out. Note: if your script intends to return repeatedly to the FUNC menu, keep in mind that the camera remembers where you last were in the menu, so that if you activate it again, the "cursor" now starts where you left it. So make sure you either remember where you were, or have your script return the top of the menu before you exit it.


5. Properties you can NOT set, but you can read, and it gives you information you can use for decision-making.

0  Shooting mode dial: allows you to determine if you are in Auto, P,
      Tv, Av, M, or C mode, or any of the “special modes”.  (currently there
      is nothing you can do to change it, other than to display a message on
      the screen to tell the user to switch it)
205 shoot in progress: in P, Tv, and Av mode, this property gets set
      to one (1) some time (100-300 msec) after a click “shoot_full”
      command, then returns to zero (0) at a time where (it seems) it is
      then safe to issue a new click “shoot_full” command.  (note: it does
      not change at all after a “shoot” command, and it is set absolutely to
      one if you do an AE lock, so it is strongly recommended that you use
      this only under these specific conditions.)  See Alain’s HDR script in
      the user script area for an application.
177 intervalometer #of shots.  If this is 0, then you are not in
      intervalometer mode.  Otherwise, this property contains the number of
      shots to be taken in the sequence.  You could use this to determine if
      you succeeded in activating this feature.  (Setting this property to a
      different number does NOT change the number of shots it takes, nor
      does setting this to a non-zero number activate this function.)

Again, see the Property case exploration page for additional important details about these properties.


A general note of caution: Setting a property to change some state of the camera leaves the camera in that state, but the camera is not fully aware of it. This is also true of at least some CHDK commands, such as set_iso: when the script exits you can take shots at that ISO setting, but the camera display (and the button-push sequence) behaves as if you did not change it. This is not the case where you change a parameter by doing button “clicks”. For example, if you start a script when the ISO is at 100, and you change the ISO to 400 by either using the “set_iso 4” command or “set_prop 21 400” command, any shots during the script, *and* any shots taken after exiting the script will be shot at 400. But the camera display will say that the ISO setting is still 100. Changing modes (like P to Av) will cause the ISO to reset to 100, and the camera will also get back in sync if you hit the ISO button (it will go to ISO 200). This is NOT the case if your script uses ‘click “ISO”’ twice to change the ISO from 100 to 400: in that case, the display will read ISO 400, and that setting will be retained if you, for example, change modes.

The moral is, it probably is better to do things with button pushes, particularly if your intention is to use the script to put the camera in a particular mode for use outside the purview of the script.

Advertisement