Fast zoom during video -> crash - page 2 - Script Writing - CHDK Forum

Fast zoom during video -> crash

  • 19 Replies
  • 10643 Views
*

Offline reyalp

  • ******
  • 14125
Re: Fast zoom during video -> crash
« Reply #10 on: 14 / March / 2015, 14:49:41 »
Advertisements
That fixed the crash. Now I can continue with my original experiments, thanks a lot!  :D Do you consider it a good idea to commit my changes to the file if I don't find something else that's now broken by them? What would be the procedure for that?
If this turns out to be a good fix, it should get added to the autobuild.   
Note this may affect whether the canon firmware applies the correct distortion correction after moving the zoom.

To test:
zoom in some using scripted key presses, e.g. 10 clicks
shoot
record the zoom position
zoom back to full wide using clicks
set_zoom to the previously recorded zoom position
shoot

Compare the two jpegs.

I have found that even when the zoom position is reported as identical, the zoom level may be slightly different. This is OK, the main thing to look for is the distortion correction. Using a grid as your subject can be helpful.
Don't forget what the H stands for.

Re: Fast zoom during video -> crash
« Reply #11 on: 14 / March / 2015, 14:59:41 »
there is an old script here that might help :  http://chdk.setepontos.com/index.php?topic=7071.msg76172#msg76172

I can't get that to run.
unknown statement in line 1, after removing the Lua block comment lines:
parse error in line 6 (p=get_zoom())
Canon Powershot D30 w/ CHDK 1.3.0

*

Offline reyalp

  • ******
  • 14125
Re: Fast zoom during video -> crash
« Reply #12 on: 14 / March / 2015, 15:02:57 »
I can't get that to run.
unknown statement in line 1, after removing the Lua block comment lines:
parse error in line 6 (p=get_zoom())
This sounds like the script is being run a ubasic rather than lua. Make sure it has a .lua extension (and not,  .lua.txt or anything like that)
Don't forget what the H stands for.

Re: Fast zoom during video -> crash
« Reply #13 on: 14 / March / 2015, 15:03:29 »
I can't get that to run.
unknown statement in line 1, after removing the Lua block comment lines:
parse error in line 6 (p=get_zoom())
Did you save it with a .lua file extension?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Fast zoom during video -> crash
« Reply #14 on: 14 / March / 2015, 15:03:42 »
Here's a crappy video of the old behaviour:

Correction, both builds behave the same:
defocussing with MF, no defocussing with AF
Canon Powershot D30 w/ CHDK 1.3.0

Re: Fast zoom during video -> crash
« Reply #15 on: 14 / March / 2015, 15:20:00 »
I read "basic" in the title and ignored the syntax of the code. Running lua as lua helps.  ;)

The script seems to work fine. Zooms in without correcting focus with AF, corrects focus after every set_zoom(...) with MF.
Canon Powershot D30 w/ CHDK 1.3.0

Re: Fast zoom during video -> crash
« Reply #16 on: 14 / March / 2015, 15:46:48 »
Let me summarize after I went through everything again:

CHDK 1.3.0 (build from Dec 18 2014 according to changelog):
 - no defocus in AF or MF when set_zoom() is called
 - crash in AF(oldaf.log) and MF(oldmf.log) when set_zoom is called during video recording


CHDK 1.3.0 r3661 with #define CAM_USE_ALT_SET_ZOOM_POINT removed:
 - set_zoom leads to defocus and refocus in both AF and MF
 - no crash when calling set_zoom during recording with MF
 - crash when calling set_zoom during video recording(newaf.log in next post)

Canon Powershot D30 w/ CHDK 1.3.0

Re: Fast zoom during video -> crash
« Reply #17 on: 14 / March / 2015, 15:47:13 »
- crash when calling set_zoom during video recording(newaf.log in next post)
Canon Powershot D30 w/ CHDK 1.3.0

Re: Fast zoom during video -> crash
« Reply #18 on: 14 / March / 2015, 16:50:43 »
Note this may affect whether the canon firmware applies the correct distortion correction after moving the zoom.

To test:
zoom in some using scripted key presses, e.g. 10 clicks
shoot
record the zoom position
zoom back to full wide using clicks
set_zoom to the previously recorded zoom position
shoot

Compare the two jpegs.

I have found that even when the zoom position is reported as identical, the zoom level may be slightly different. This is OK, the main thing to look for is the distortion correction. Using a grid as your subject can be helpful.

I performed the steps you described and could distinctly see distortion in the image shot after set_zoom while the first one was fine.
Canon Powershot D30 w/ CHDK 1.3.0

Re: Fast zoom during video -> crash
« Reply #19 on: 14 / March / 2015, 18:01:39 »
No combination of the two build switches CAM_USE_ALT_SET_ZOOM_POINT and CAM_USE_ALT_PT_MoveOpticalZoomAt helped with the crash.

Following waterwingz's other recommendation however removed the crash for me:
Code: [Select]
#define CAM_NEED_SET_ZOOM_DELAY           1500    // Define to add a delay after setting the zoom positionIncreasing it to 1 second was not sufficient but it zoomed a lot further before crashing. So the optimal value is somewhere between 1000 and 1500. Since I do not know what factors might influence the required wait time after lens_set_zoom_point(v) I will leave it this high for now.

Using the new build I was able to shoot this video:
www.youtube.com/watch?v=-8I2lM7lR7E

I noticed the camera has different manual focus step for different zooms. I guess that's the cause for the small focus jumps when zooming.


Can you guys think of anything this change might affect except waiting times during zoom scripts?
Canon Powershot D30 w/ CHDK 1.3.0

 

Related Topics


SimplePortal © 2008-2014, SimplePortal