Drivelapse script - page 2 - Completed and Working Scripts - CHDK Forum

Drivelapse script

  • 35 Replies
  • 8653 Views
Re: Drivelapse script
« Reply #10 on: 28 / August / 2012, 08:55:46 »
Advertisements
@gjb :  do you feel up to converting your original post to a wiki page on the CHDK Wiki Site ? Over the years,  good scripts tend to get lost here in the forum, and searching is tough due to the volume of posts after 7 years.

I've done that for others in the past but looking at your code and description,  I suspect my help is not needed there.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Drivelapse script
« Reply #11 on: 28 / August / 2012, 10:41:49 »
@gjb :  do you feel up to converting your original post to a wiki page on the CHDK Wiki Site ?
Sure, no problem. I'll have a look at doing this later.

*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Drivelapse script
« Reply #12 on: 28 / August / 2012, 14:32:12 »
@gjb :  do you feel up to converting your original post to a wiki page on the CHDK Wiki Site ?
Sure, no problem. I'll have a look at doing this later.
Done!
http://chdk.wikia.com/wiki/Drivelapse

*

Offline lapser

  • *****
  • 1093
Re: Drivelapse script
« Reply #13 on: 28 / August / 2012, 22:40:03 »
I tested the script a little more and noticed that the exposure measurements are not applied when you call capture. They're only applied in the following capture. That is, the exposure of the current picture is using values from the previous picture.

You can demonstrate this by slowing the rate down to 10 seconds. Point at a bright scene, i.e. monitor, let it take a couple of shots, then point at something dark and let it take a couple of shots. The first dark shot will be underexposed.

For driving, this might show up as a bright flash coming out of a tunnel, or black frame going into the tunnel. But in most cases, it probably doesn't matter. Correcting it would probably add another second of delay or so between pictures.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Online reyalp

  • ******
  • 12112
Re: Drivelapse script
« Reply #14 on: 28 / August / 2012, 23:19:35 »
I tested the script a little more and noticed that the exposure measurements are not applied when you call capture. They're only applied in the following capture. That is, the exposure of the current picture is using values from the previous picture.
This happens because the set* commands must be called before the halfshoot of the exposure they are modifying. The overrides are applied during the half shoot.

When I wrote a script like this, I used a halfshoot to meter, release and set overrides, and then a separate halfshoot -> shoot for the actual exposure.

If you want to set during halfshot, I believe that using the propcases directly works (edit: but may be sensitive to timing in poorly defined ways).

edit:
the script I wrote is attached to this post http://chdk.setepontos.com/index.php?topic=8066.msg84890#msg84890
« Last Edit: 28 / August / 2012, 23:28:43 by reyalp »
Don't forget what the H stands for.

*

Offline lapser

  • *****
  • 1093
Re: Drivelapse script
« Reply #15 on: 29 / August / 2012, 00:19:21 »
to set during halfshot, I believe that using the propcases directly works (edit: but may be sensitive to timing in poorly defined ways).
Thanks. Haven't used propcases yet, but all I would need to do is set Tv96 (on the SX260, but hopefully camera independent). If you get a chance, maybe you could walk me through doing that with propcases? No rush.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Online reyalp

  • ******
  • 12112
Re: Drivelapse script
« Reply #16 on: 29 / August / 2012, 01:02:25 »
Thanks. Haven't used propcases yet, but all I would need to do is set Tv96 (on the SX260, but hopefully camera independent). If you get a chance, maybe you could walk me through doing that with propcases? No rush.
Propcase info http://chdk.wikia.com/wiki/PropertyCase

To set from ubasic, use set_prop http://chdk.wikia.com/wiki/CHDK_scripting#set_prop_.2F_get_prop

You need to know the propcase ID for shutter speed for your camera. This depends on the camera. Since sx260 isn't in the trunk yet, I'm not completely sure, but according to http://chdk.setepontos.com/index.php?topic=7889.msg88090#msg88090 SX260 is the same as propset 4, except for one GPS prop. So you for shutter speed, you can use the id for PROPCASE_TV found here http://trac.assembla.com/chdk/browser/trunk/include/propset4.h
You may also want to set PROPCASE_TV2, to update the exif.

This will make the script camera dependent, and you will need to test that it actually works. From what I remember, setting the propcase right after get_shooting changes to true was OK, but it was a long time ago that I tested, and it may not be the same on all cameras or shooting modes.
Don't forget what the H stands for.

*

Offline lapser

  • *****
  • 1093
Re: Drivelapse script
« Reply #17 on: 29 / August / 2012, 02:54:25 »
shutter speed, you can use the id for PROPCASE_TV found here http://trac.assembla.com/chdk/browser/trunk/include/propset4.h
You may also want to set PROPCASE_TV2, to update the exif.

This will make the script camera dependent, and you will need to test that it actually works. From what I remember, setting the propcase right after get_shooting changes to true was OK, but it was a long time ago that I tested, and it may not be the same on all cameras or shooting modes.
Thanks. From the propset4.h file you mentioned, I got this:
--PROPCASE_TV=266
--PROPCASE_TV2=265

But since I'm programming in Lua, I tried this:

props=require("propcase")
print("TV=",props.TV," TV2=",props.TV2)
    output is: TV= 266  TV2= 265

so instead of:
  set_tv96_direct(tv)
I used:
  set_prop(props.TV,tv)
  set_prop(props.TV2,tv)

This sets the shutter speed BEFORE the shot as desired, and jpg exif is correct too. I assume it is camera independent this way? Is there any way to do this in uBasic for the DriveLapse script?
Many thanks!
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Drivelapse script
« Reply #18 on: 29 / August / 2012, 06:19:34 »
I tested the script a little more and noticed that the exposure measurements are not applied when you call capture. They're only applied in the following capture. That is, the exposure of the current picture is using values from the previous picture.
This happens because the set* commands must be called before the halfshoot of the exposure they are modifying. The overrides are applied during the half shoot.

When I wrote a script like this, I used a halfshoot to meter, release and set overrides, and then a separate halfshoot -> shoot for the actual exposure.

I'm concerned that adding a second half shoot will almost certainly slow things down beyond 1 second.

Do you recall whether it's possible to skip the second half shoot and just do half shoot > set_* > release > shoot/full shoot ?

If not, I will look into doing this using prop cases, but I think this might reduce the number of camera models the script will work with.

Thanks.

*

Offline lapser

  • *****
  • 1093
Re: Drivelapse script
« Reply #19 on: 29 / August / 2012, 12:01:17 »
Try saving this with the file name PropTest.lua
Code: (Lua) [Select]
--[[
@title PropTest
--]]
print_screen(1)
props=require("propcase")
print("TV=",props.TV," TV2=",props.TV2)
I'm pretty sure this is camera independent, but to use it means re-writing the script in Lua. It's worth it IMO.
I'm concerned that adding a second half shoot will almost certainly slow things down beyond 1 second.
Do you recall whether it's possible to skip the second half shoot and just do half shoot > set_* > release > shoot/full shoot ?
That still adds a second in my tests because it does another exposure measurement even if you're on full manual (no adjustments to make).
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics