Hello,
I want to exactly control shutter speed/exposure time, but not in Tv values but by a timer. For an example I've studied fixedint by
@reyalp Note, there's really two shutters, an electronic shutter and a mechanical shutter. They both work, however the purpose of the mechanical shutter is to avoid a rolling shutter effect on still pictures, and also to make the picture look smoother somehow?
Also, this all applies to CMOS sensors.
As far as I can follow/guess, the sequence goes like this:
hook_shoot.set(10000)
hook_raw.set(10000)
-Enables the shoot and raw hooks. Hook here means 'upon using the hook_xxx command, pause the automatic shooting sequence and run script, until hook.continue()'. The 'shoot hook' pauses just before the shutter opens, the 'raw hook' pauses just before saving the file.
set_tv96_direct(tv)
-This sets the exposure time
press('shoot_half')
repeat sleep(10) until get_shooting() == true
-This waits for the cam to set shooting parameters (exposure and focus). Since Tv was already set, I assume this only works if the shooting mode is 'P'. Otherwise the Tv could be overidden. So the set_tv line is a bit confusing at first unless you know the context. The mechanical shutter is open, and I assume the camera takes a pic with the electronic shutter, just to read out the histogram or scene recognition to set the shooting parameters.
if cont then
press'shoot_full_only'
end
-If you want to use continuous mode, you hold down the shoot button here
for shot=1,ui_shots do
-Start a loop to take a number of shots. Now what follows is the important part:
if not cont then
press('shoot_full_only')
end
-Press the shoot button (assuming it's not in continuous mode)
Close the mechanical shutter then complete and save the shot. Instead, we have:
hook_shoot.wait_ready()
-Here we wait until just before the shutter opens *I'm going to say 'before the electronic shutter opens' which means before the pixels are reset (discharged to 0v) in preparation for accumulating charge from light
if ui_darks then
close_shutter()
end
-If you want to shoot a dark frame, close the mechanical shutter at this point. This only makes sense if it means to close the mechanical shutter, before opening the electronic shutter. It also implies that normally, the mechanical shutter is open at this point, which then implies that the sensor is reset globally and immediately, so there's no rolling shutter problem here.
if not cont then
release('shoot_full_only')
end
-Start to end the shot. Normally the exposure would finish and save automatically at this point, however:
sleep(interval - et)
-Manually wait as part of the Tv. This delay would be in addition to the Tv value set before the shot.
hook_shoot.continue()
-Finish the shot. I assume the mechanical shutter will be closed here (it may already be closed, if there was a dark frame, which means it tries to close an already closed shutter, which apparently doesn't cause any mechanical problems), then close the electronic shutter (which means to read the current charge serially by row of the pixels, which are still exposing until the moment they are read, which is the cause of the rolling shutter effect).
hook_raw.wait_ready()
set_tv96_direct(tv)
hook_raw.continue()
-Stop just before saving the pic, set the Tv, then finish saving the pic. I believe the purpose of this is because of the sequence of the loop; to prepare the Tv for the *next* shot (the first first shot's Tv was set before the loop). However if that's the case, I don't see why set_tv isn't at the very end.
end
-Continue the loop