This method works for all my cameras (haven't test the M3 yet). Even in continuous mode, you can't use this method before the first shot. The camera has to set the first shot (sets svbase).
The camera sets ISO by adding svbase+svdelta. The sum, sv, is stored in props.SV for EXIF purposes. In continuous mode, the camera doesn't modify these parameters. So I assume this equation is true:
sv=svbase+svdelta
The problem with set_iso() in CHDK is that it sometimes changes svbase. In continuous mode, you only want to set svbase on the first shot. After the first shot in continuous mode, set_iso() should switch to my method. That should work for all cameras.
Let's say svnew is the new sv you want to set. You don't want to change svbase, only svdelta. So you add the change you want, (svnew-sv), to svdelta
svdelta=svdelta +(svnew-sv)
then you finish with
sv=svnew
Hi Lapser, love the timelapse videos, hope to get time to try this one day.
Let me try and shed a bit more light on this.
First, sv = svbase + svdelta is correct; but the 'svbase' value is a constant, CHDK never changes this once it has been initially set. Neither does the Canon firmware as far as I can tell.
Under normal conditions, on most cameras, the CHDK set_sv96 function and your script code to set sv96 actually do the very same thing.
To prove this consider the following.
Terminology:
- cam_sv, cam_svdelta - property values for sv and svdelta currently set in the camera
- sv - target sv value we want to override to for the next shot
In both cases the first sv0 override is done using set_sv96 (CHDK code).
The result is
cam_sv0 = sv0
cam_svdelta0 = sv0 - svbase
For the next override, sv1, the CHDK set_sv96 code will set:
cam_sv1 = sv1
cam_svdelta1 = sv1 - svbase
The script version does this
cam_sv1 = sv1
cam_svdelta1 = sv1 - cam_sv0 + cam_svdelta0
Substituting values we get
cam_svdelta1 = sv1 - sv0 + sv0 - svbase
or
cam_svdelta1 = sv1 - svbase
The above works
provided the value of cam_svdelta remains intact.Herein lies the problem for the G1X.
For Tv < 1.3 seconds the above holds and both methods should produce the same result.
When Tv >= 1.3 seconds, then at ISO 400, the camera does strange things.
It should result in:
svbase = 576 (constant)
cam_sv = 603
cam_svdelta = 96
It actually end up with
svbase = 576 (constant)
cam_sv = 603
cam_svdelta =
0The camera shoots at 1 stop lower ISO; and then digitally boosts the exposure of the CR2 & JPG images (while recording the original requested ISO in the EXIF).
The raw_hook metering sees the underexposed image so the metering calculates a 1 stop lower value.
This is where the two methods now diverge.
For ISO 403 (the next increment):
- CHDK set_sv96 sets cam_sv = 604 and cam_svdelta = 97
- Script set sv96 sets cam_sv = 604; but cam_svdelta = 1
For the CHDK version, this time firmware does not alter cam_svdelta so it remains at 97 and shoots at ISO 403; but it still digitally boosts the CR2 & JPG images. So the raw_hook meter is correct; but the images are overexposed by 1 stop.
For the script version, the camera is now shooting at 1 stop lower and still boosting the images. The raw_hook meter is off by 1 stop; but the images are the correct brightness.
In summary, for the G1X with Tv >= 1.3s and ISO >= 400:
CHDK set_sv96 - saved CR2/JPG overexposed by 1 stop, metering should be correct (except at ISO 400)
Script set sv96 - saved CR2/JPG correct exposure, metering underexposed by 1 stop
Phil.