How to set the camera settings "permanently" with uBasic or LUA? - Script Writing - CHDK Forum  

How to set the camera settings "permanently" with uBasic or LUA?

  • 12 Replies
  • 2684 Views
How to set the camera settings "permanently" with uBasic or LUA?
« on: 05 / February / 2011, 16:12:41 »
Advertisements
Hello folks, please could anyone help me with a surely beginners problem I have?

I have a Canon SX200IS, which, when I set the ISO-value by normal menu, will remember the ISO value until next time I start the camera. In practice: I turn on the camera, set MANUAL mode, the camera shows eg. ISO 80. Now I set ISO to eg. 400. Then I turn off the cam and when turning on again the camera remembered the ISO value and shows ISO 400.

Now here is my problem: Can I set the camera values via script so that the camera remebers the value? I wrote my first  working script that takes some pictures with different ISO values, but:

When the ISO is eg. 80 when starting the script the camera falls back to that "initial" ISO 80 after every picture taken, my script sets every ISO value properly, but at the end the camera is set to the ISO value where it was before.

What I am trying to achieve: I want to make scripts, that put the camera into specified states that will be kept even after the script finished, so that the value shows up in the cameras menu and thus will be the valid value when I take photos without using a script.

Is this possible?

Thank you very much!

Here is my script that sets the ISO value temporarily for ech photo taken but does not really set the ISO value:



-------- ISO is set to e.g. 80

@title Press shutter
@param c ammount_pics
@default c 5


cls

for J=1 to c
        get_iso giso
        print "Got ISO ", giso
        set_iso J
        shoot
        cls
        sleep 500
next J


end


------ ISO is still 80, but why?
« Last Edit: 05 / February / 2011, 16:19:17 by Karmaschinken »

Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #1 on: 05 / February / 2011, 19:24:30 »
Why do you need changing iso at all? You will get almost identical shots except different amount of noise. Or in manual mode you will get over- or underexposured images but with no extra details in lights or shades. Because in digital camera iso is only nominal coefficient between sensor output and numerical values of pixels in resulting file. It's like if you adjust levels in photoshop. If you want hdr, you'd better change exposure compensation or shutter speed.

And why do you need permanent effect for your script? I can't imagine situation where it could be useful.

Maybe clicking buttons will help you http://chdk.wikia.com/wiki/UBASIC/TutorialScratchpad#Camera_Operation_Commands , but exact combination of keys may depend on shooting mode.

Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #2 on: 05 / February / 2011, 21:10:30 »
« Last Edit: 05 / February / 2011, 21:21:29 by Karmaschinken »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #3 on: 06 / February / 2011, 06:58:49 »
As far as I know there's no such feature ready to be used, but in Lua you can read and write arbitrary files in any way you please, so it's fully possible to write a script to harvest camera settings, save them in a file and then read the file and then have the script change those settings accordingly. This configuration file could be written in lua script syntax instead of something homebrew; then it could be loaded simply with "require".

Doing such thing in a universally (all settings, all camera models) is probably a lot of work and needs compromises (e.g. a CHDK override is not the same thing as having Canon setting set that way, and you may only be able to reproduce some settings in a script unless you emulate keypresses, which will be highly camera model dependent), but for just one script using a limited range of settings it shouldn't be a problem.


Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #4 on: 06 / February / 2011, 18:42:54 »
« Last Edit: 06 / February / 2011, 18:47:36 by Karmaschinken »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #5 on: 07 / February / 2011, 15:10:11 »

Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #6 on: 07 / February / 2011, 15:51:09 »

*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #7 on: 07 / February / 2011, 15:58:26 »
@fudgey

Seems to be normal, at least, my ixus870 uses the exact same code ...
I'll do a test compile with the 2's changed to 1's

wim

edit: behaves as expected, a little slower at wheeling the menu, otherwise fine.

@Karmaschinken, let me know if you want one for testing.

« Last Edit: 07 / February / 2011, 16:14:30 by whim »


Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #8 on: 07 / February / 2011, 16:57:15 »
Yes I do! Please! Can you explain, why one would keep 2 ticks instead of 1 as the second parameter for the functions. It seems to be senseless wheeling 2 ticks, no?

Thanks a lot!

*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: How to set the camera settings "permanently" with uBasic or LUA?
« Reply #9 on: 07 / February / 2011, 17:04:01 »
@Karmaschinken

What camera / firmware ? And do you want it here or at German forum ?  :D

wim

nvm .. sx200 has only 2 identical firmware's
« Last Edit: 07 / February / 2011, 17:13:52 by whim »

 

Related Topics