Timelapse with variable shutter speed - page 4 - Completed and Working Scripts - CHDK Forum

Timelapse with variable shutter speed

  • 151 Replies
  • 103219 Views
*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Timelapse with variable shutter speed
« Reply #30 on: 26 / April / 2008, 17:59:35 »
Advertisements
Here is the movie, assembled up to the point where the camera started to get wrong frames (clik on image)



It's absolutely not bad.

The exposure is not smoothed, so you can see some ups-and-downs in brightness, otherwise, the camera compensates almost perfectly for the increasing darkness, with exposures varying from 1/2000" to 2.5"

The very last part is nice, with the lights of Florence turning on in the valley.

It's a shame it's so short, but that is when the camera starts getting it wrong :-(

« Last Edit: 26 / April / 2008, 18:13:27 by fbonomi »

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Timelapse with variable shutter speed
« Reply #31 on: 28 / April / 2008, 05:56:34 »
Indeed, the last part is very good, the blue colour of the sky and the lights of the city. Well done.

So, fbonomi, can we use the script you posted? Is it still buggy?

Continue with this good work!

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Timelapse with variable shutter speed
« Reply #32 on: 28 / April / 2008, 06:53:52 »
yes it is!

I think I have understood the problem, I will try it again tonight and post it.

I can only test it properly once every 24 hours (at best)

:-)

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Timelapse with variable shutter speed
« Reply #33 on: 28 / April / 2008, 18:18:59 »
Another version of the script.

It is now working, but there is still much space for improvements

The logic is the following:

1) Standard Mode: we start with a default ISO setting (Default Sv, default 100 ISO) and the camera shoots changing Tv accordingly.
2) Guess Mode: when the scene is too dark (Below Guess mode Limit, default -200, this means that the camera would need to expose more than 4 seconds) we probably cant' rely any more on reading the CCd on the fly, therefore we just keep exposing more and more every shot (Tv is increased by "Slope in guess mode", default 5)
3) Guess mode with high sensitivity: when exposure gets too long (limit Tv, default 20 secs) the camera does not make longer exposure, but rather increases sensibility, going up to "Limit Sv" (default 776, ISO 800)

The program logs quite some information in the PR_SCREEN.TXT file (in CHDK/SCRIPTS)

All values (in the log file and in the parameters) are in the APEX*96 format

Feel free to test this script, as always it would be very useful for me to receive the log file


Code: [Select]
@title Sunset3

@param a Delay (sec)
@default a 5

@param b Limit Tv
@default b -414
rem (-414=20 sec; -384=15 sec; -320=10 sec; -224=5 sec.)

@param c Default Sv
@default c 480
rem (480=100)

@param d Limit Sv
@default d 776
rem (776=800 ISO; 960=3200)

@param e Guess mode limit
@default e -200

@param f Slope in guess mode
@default f 5


print_screen 1

print "Sunset Time Lapse"

rem initialize guess mode value
x=e

rem get start Tv
get_tv96 T


rem picture counter
p=1


:loop

rem measure luminance and aperture
press "shoot_half"
sleep 500
release "shoot_half"
get_bv96 B
get_av96 A
rem release "shoot_half"

print "Measured: ",B ,A

rem resulting Tv would be:
T=B-A
T=T+c

print "Calculated T: ", T

rem check Tv Values

if T>e then
 rem normal mode, shoot with calculated Tv and default Sc
 X=T
 Y=c
 print "Mode: Standard"
else
 rem Guess mode, every shot will be 5/96th steps longer
 x=x-f
 
 if  x>b then
  rem we are in dark, but exposure is not too long
  rem normal mode, shoot with guessed Tv and default Sc
  X=x
  Y=c
  print "Mode: Guess"
 else
  rem we are in very dark area, we want to avoid too long exposures
  rem shoot with maximum allowed time (b) and
  rem adjust Sv accordingly

  X=b
  Y=c+b-x
 
  rem BUT check we don't go in too high ISO!
  if Y>d then
   Y=d
  endif
 
  print "Mode: Guess with High ISO"
 endif
 
endif


rem we can now shoot
sleep 100
set_sv96 Y
set_tv96_direct X
sleep 100
shoot
sleep 100
print "SHOOT ",p,X,Y
p=p+1

sleep a*1000

goto "loop"


Know Issues (things that might be changed)
1) The calculation is not smoothed, therefore the exposure occasionally bumps up and down a little (I will insert a smoothing algorithm, but before I want to be sure the camera exposes correclty
2) below a certain level of light, the camera just keeps exposing more and more up to the specified maximum. This can lead to over-exposure. I probably could trust a bit more the CCD (i.e. consider its values even for darker regions) and/or find a way to measure lumnance not from the CCD (on the fly) but based on previous photo (which has probably been exposed a lot)
Otherwise, if one knew in advance the corect maximum exposure, one could for example lower the maximum allowed sensibility..
« Last Edit: 28 / April / 2008, 18:48:40 by fbonomi »

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Timelapse with variable shutter speed
« Reply #34 on: 28 / April / 2008, 18:43:41 »
The experimental movie of tonight....

It was overcast, and not a terrific location, so not quite as impressive. Interesting anyway, and anyway  Ineeded to test the script :-)..

630 frames, from 19:30 (ISO 100, 1/1250) to 23:20 (ISO 1250, 15 sec) Gamma 1.6 applied to the movie

The final part is quite overexposed. Also, the "Slope in Guess Mode" was set to 20, and this caues a too fast transition from the "dark blue" sky to the "orange" sky.

The last part being over-exposed, one coyuld set a shorter maximum exposure and would also obtain the result of "slowing down" the clouds in the dark area



The following is a graph of the parameters (Measured Bv, Calculated Tv and Sv)

« Last Edit: 28 / April / 2008, 18:51:05 by fbonomi »

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Timelapse with variable shutter speed
« Reply #35 on: 30 / April / 2008, 04:11:23 »
Well, I think we are there!

My movie of last night:



800 frames taken from 19:10 to 00:47, starting from ISO 100, 1/1000" and ending to ISO 1250, 8".

It seemed that it was going to be overcast, but a while after sunset it got clear and the results are  excellent.

Some post-processing was needed, as I underexposed the last part of the video.

This is a limit of this script: the final part of the video (the guess mode) is not auto-exposing, you have to set manually the final Tv and Sv, and it's not always easy to guess how it will be in a few hours. Anyway. that's unavoidable without changing the CHDK source itself, and therefore will be left to v. 2.0 of the script.


*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Final version
« Reply #36 on: 30 / April / 2008, 06:24:24 »
FINAL VERSION OF THE SCRIPT
(and instructions)

This script attempts is meant to shoot time-lapse videos of sunsets: starting from full daylight and ending in full night, always adapting exposure for a correct shot.

Up to a certain point (when there is enough light to be directly measured) the script exposes automatically, then starts guessing the exposure, increasing first exposure time (up to a certain limit) then ISO (again, up to a certain limit).

Suggested camera settings:
Camera mode: manual
White balance: Sun (other settings, if desired but not auto)
Image size: a small image size (S) is suggested, in order to allow more shots
Flash: off
Focus: manual, set to infinity
Aperture: maximum

Note: all the parameters here are expressed in APEX*96 units, with equivalence.

First, you wll have to decide the delay between one shot and the other (how many seconds between each shot)
Suggested values: 5 or 10 seconds. Longer might also be ok, bu the resulting video will be shorter.

Then, you will have to decide what will be the final exposure parameters. These will depend strongly on the type of scene you will be shooting.

Examples of suggested values:
Landscape with strong lights (city), illuminated sky 5" (Tv -224) ISO 1250 (Sv 767). Stars will be barely visible
Landscape without lights (countryside), dark sky 15" (Tv -384) ISO 2500 (Sv 864) Stars will be well visible

These parameters are called "Limit Tv" and "Limit Sv" in the script.

Finally, you have to decide the  "Default Sv", (the ISO settings to start with). I suggest ISO 100 (Sv 419)

Other values ("Guess mode limit" and "Slope in guess mode") are better left to their default values

You can now run the script.

For debugging purposes, the program logs quite some information in the PR_SCREEN.TXT file (in CHDK/SCRIPTS). If you have problems with the script, save the PR_SCREEN.TXT so that problems are better pinpointed.

This is the script:

Code: [Select]
@title Sunset4
rem Script to shoot time-lapse videos of sunsets
rem v. 4, Fbonomi apr 30th 2008
rem Released under GPL

@param a Delay (sec)
@default a 10

@param b Limit Tv
@default b -414
rem (-414=20 sec; -384=15 sec; -320=10 sec; -224=5 sec.)

@param c Default Sv
@default c 480
rem (480=160)

@param d Limit Sv
@default d 776
rem (776=1250 ISO; 960=5000)

@param e Guess mode limit
@default e -200

@param f Slope in guess mode
@default f 5


print_screen 1

print "Sunset Time Lapse"

rem initialize guess mode value
x=e

rem get start Tv
get_tv96 T


rem picture counter
p=1


:loop

rem measure luminance and aperture
press "shoot_half"
sleep 500
release "shoot_half"
get_bv96 B
get_av96 A
rem release "shoot_half"

print "Measured: ",B ,A

rem resulting Tv would be:
T=B-A
T=T+c

print "Calculated T: ", T

rem check Tv Values

if T>e then
 rem normal mode, shoot with calculated Tv and default Sc
 X=T
 Y=c
 print "Mode: Standard"
else
 rem Guess mode, every shot will be 5/96th steps longer
 x=x-f
 
 if  x>b then
  rem we are in dark, but exposure is not too long
  rem normal mode, shoot with guessed Tv and default Sc
  X=x
  Y=c
  print "Mode: Guess"
 else
  rem we are in very dark area, we want to avoid too long exposures
  rem shoot with maximum allowed time (b) and
  rem adjust Sv accordingly

  X=b
  Y=c+b-x
 
  rem BUT check we don't go in too high ISO!
  if Y>d then
   Y=d
  endif
 
  print "Mode: Guess with High ISO"
 endif
 
endif


rem we can now shoot
sleep 100
set_sv96 Y
set_tv96_direct X
sleep 100
shoot
sleep 100
print "SHOOT ",p,X,Y
p=p+1

sleep a*1000

goto "loop"
« Last Edit: 30 / April / 2008, 06:41:17 by fbonomi »

Re: Timelapse with variable shutter speed
« Reply #37 on: 02 / May / 2008, 05:35:58 »
Thanks, it's working fine http://www.youtube.com/watch?v=_xuI9_IbaqM
As I understand this is the only script for sunset timelapse? What about the sunrise modification?

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Timelapse with variable shutter speed
« Reply #38 on: 02 / May / 2008, 09:15:06 »
Hi avatorl,

thanks for sharing! Where is it?

Yes, in this form it's only good for sunsets (light to dark).

I am working on a more generic script, but that will require changes to the CHDK source (the C code, I mean)

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Timelapse with variable shutter speed
« Reply #39 on: 02 / May / 2008, 09:16:18 »
could you elaborate on these changes?

 

Related Topics


SimplePortal © 2008-2014, SimplePortal