Dolly Zoom - page 2 - Creative Uses of CHDK - CHDK Forum  

Dolly Zoom

  • 21 Replies
  • 7934 Views
*

Offline c_joerg

  • *****
  • 1250
Re: Dolly Zoom
« Reply #10 on: 14 / July / 2020, 02:03:50 »
Advertisements
Unfortunately, moving the camera smoothly and accurately is slow; takes a couple minutes to complete the entire zoom process.

I video software with Shake reduction / Wrap Stabilizer could smooth is as well…

M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Dolly Zoom
« Reply #11 on: 14 / July / 2020, 16:12:47 »
 :blink: Strange, couldn´t copy failure with Autozoom testscript. (100f, too)
Is any FW-setting disturbing?
Edit: Now it happened, but A sleep(100) after set_zoom() just helped.
& My Romlog is a bit different.
« Last Edit: 14 / July / 2020, 16:42:36 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14111
Re: Dolly Zoom
« Reply #12 on: 14 / July / 2020, 21:06:43 »
That's not good. If you can post the crash log, that may be helpful.
Here you go...
Thanks. This seems more likely to be a general problem rather than a simple bug in the port, so I'd like to get a better understanding even if you aren't interested in getting 1.5 working for your rig.

It would be helpful to have a bit more information
From log, it looks a shot was taken, and then it crashed when it tried to set the zoom after. If you can post a simple script that reproduces the problem, that would be really helpful. I tried the snippet you posted earlier that does the zoom part on a similar generation camera (elph130) without triggering a crash.

What shooting mode was the camera in: P, Auto, some scene mode etc
What focus mode is the camera in: AF, Macro, MF, does the script use set_mf or set_aflock
In the Canon menu, what are the settings of
AF Frame
Servo AF
Continuous AF

@Caefix:
Edit: Now it happened, but A sleep(100) after set_zoom() just helped.
& My Romlog is a bit different.
Thanks, that's quite interesting. It's the same assert, but it gets there from a very different code path. It would be really helpful if you can post just the minimum script to reproduce the problem. Your script has a lot of options and does a lot of different things, which makes it hard for me to understand.
Don't forget what the H stands for.

Re: Dolly Zoom
« Reply #13 on: 15 / July / 2020, 00:21:17 »
If you can post a simple script that reproduces the problem, that would be really helpful.

The attached script fails regularly.  Put the camera in rec mode, and zoom-in about half-way.  If the 'set_zoom(znext)' is successful, then the script executes, no problem.  If however, get_zoom() doesn't return the set zoom level, things get interesting...

Some of the time, you will see the message "i= 2", the lens will move in/out, and the script succeeds.  More often it will display the message, then crash.

EDIT: oops, wrong script.... corrected.



Camera in P mode, AF Frame Center, Servo AF off, Continuous AF On
« Last Edit: 15 / July / 2020, 00:33:09 by solaria »


*

Offline reyalp

  • ******
  • 14111
Re: Dolly Zoom
« Reply #14 on: 15 / July / 2020, 02:36:41 »
The attached script fails regularly.  Put the camera in rec mode, and zoom-in about half-way.  If the 'set_zoom(znext)' is successful, then the script executes, no problem.  If however, get_zoom() doesn't return the set zoom level, things get interesting...

Some of the time, you will see the message "i= 2", the lens will move in/out, and the script succeeds.  More often it will display the message, then crash.

EDIT: oops, wrong script.... corrected.

Camera in P mode, AF Frame Center, Servo AF off, Continuous AF On
Great, thanks. I was able to reproduce the crash on both elph180 and elph130, with continuous AF On. It sometimes took me a lot of shots to reproduce, showing i=2 in the console several times before crashing.

I wasn't able to reproduce it with continuous AF off.

I tried putting a sleep(10) after each set_zoom, and was not able to reproduce the crash after this.

Because of the variability in how many shots it took to reproduce, I'm not 100% sure either of the above actually prevents the problem.

Adding set_zoom_speed(1) at the top the script, it crashes repeatably with the same assert on the first shot. Sleeps after the set_zoom make no difference.  It does not appear to crash with continuous AF off.

Interestingly, using set_zoom_speed(1) and set_zoom() seems to work fine in continuous AF without the shoot. Based on this, I tried putting sleep(500) after the shoot, and that seems seems to avoid the crash. In this case, I never saw the i=2 messages. sleep(100) was not enough to avoid the crash.

The assert appears likely to be triggered by TryTakeSemaphore failing (in elph330 100f ff225028 / elph130 ff1e9a18), although there's another case that could potentially trigger it as well. It seems likely that set_zoom and continuous AF could tie up the semaphore unexpectedly.

tl:dr:
If you want to try to use set_zoom_speed(1), try putting a decently long (500+ms) sleep between the shoot and the first set_zoom


edit:
I was able to reproduce the crash on elph130 running 1.4 r5528. It happens pretty quickly with or without sleeps after the set_zoom() calls. I still haven't been able to reproduce on 1.5 with sleep after set_zoom, despite trying a bunch more times. sleep(500) after shoot appears to avoid the crash for both 1.4 and 1.5
« Last Edit: 15 / July / 2020, 22:40:03 by reyalp »
Don't forget what the H stands for.

Re: Dolly Zoom
« Reply #15 on: 15 / July / 2020, 23:52:02 »
The assert appears likely to be triggered by TryTakeSemaphore failing (in elph330 100f ff225028 / elph130 ff1e9a18), although there's another case that could potentially trigger it as well. It seems likely that set_zoom and continuous AF could tie up the semaphore unexpectedly.

So, all I need to do is disable Continuous AF, and it should work without crashing?

We got here because I was trying to get set_zoom(get_zoom()+1) to work reliably.  Sounds like the current solution is v1.5, with set_zoom_speed(1), and Continuous AF disabled.  Then I should be able to increment the zoom without racking the lens in/out to get to the requested level?


*

Offline reyalp

  • ******
  • 14111
Re: Dolly Zoom
« Reply #16 on: 16 / July / 2020, 00:04:20 »
So, all I need to do is disable Continuous AF, and it should work without crashing?
Yes, if you don't need continuous AF, that works, at least on my cameras. Otherwise, you can try putting something like sleep(500) after shoot.

Quote
We got here because I was trying to get set_zoom(get_zoom()+1) to work reliably.  Sounds like the current solution is v1.5, with set_zoom_speed(1), and Continuous AF disabled.  Then I should be able to increment the zoom without racking the lens in/out to get to the requested level?
Yes, at least if your camera behaves like mine.
Don't forget what the H stands for.

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Dolly Zoom
« Reply #17 on: 16 / July / 2020, 16:20:50 »
  :-X Seems, that a sleep after AF acitvity is needed.
 Difficult to find the borders between the Asserts.
Edit: Fw-settings "all off".
Code: [Select]
--[[--
@title MegaFail
@param  zr pre set_zoom()
 @default zr -1
 @range zr -100 201
@param    d AF delay 100*
 @default d 0
Starting with lens closed is different, mostly set_z_s is ignored.
--]]--
s=get_zoom_steps()
if zr>=s then zr=s-1 end -- zr>=90 >> Imager.c
set_zoom_speed(1)

press "shoot_half"
sleep(500)
release "shoot_half"
sleep(100) --to avoid CZ-romlog
set_zoom(zr)
click "shoot_half"
sleep(d*100) -- to avoid AfC romlog, sometimes (ie d=10) (focus_busy??)
set_zoom(zr+1)
print("Zoom=",get_zoom())

--[[--
46>>set_zoom(47) every 2nd run >> CZ romlog

spooky: ASSERT!! AFScanDriver.c Line 1526
Occured Time  2020:07:15 21:32:49 << wrong timestamp, but good filedate.
 8 min after that:
ASSERT!! Imager.c Line 768
Occured Time  2020:07:16 17:58:15

97>>98
ASSERT!! ComputerZoom.c Line 1967
Occured Time  2020:07:16 18:34:48
--]]--
++ Autozum9 beautyfied...
++ Romlog.lua enhanced to get line 1 and 4 displayed without reader.
Edit2: +++ Romlog.lua can append line like
IXUS255_ELPH330HS-100f-CHDK_DE-1.5.0-5535-12904
« Last Edit: 17 / July / 2020, 11:54:00 by Caefix »
All lifetime is a loan from eternity.


*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Dolly Zoom
« Reply #18 on: 18 / July / 2020, 16:16:30 »
 :) My playmode tomorrow...
Code: [Select]
short shooting_can_focus()
{
    if(camera_info.state.mode_play) return 0 ;                 // don't focus in playback

    if(focus_interlock_bypass) return 1;                       // checks disabled, allow

    if( camera_info.state.mode_video == 1) return 1;           // FIXME : default to MF enabled in video mode for now

#ifdef CAM_SD_OVER_IN_AF
#ifdef PROPCASE_CONTINUOUS_AF
    if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0;   // don't focus in continuous AF mode,
#endif

if (focus_busy) { 
short t=0;
do {msleep(10); t=t+1;} while (focus_busy && (t<404));
if (t<404) shooting_update_dof_values();
return 0 ; }                // don't focus twice

#ifdef CAM_SD_OVER_IN_MF
    if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1;  // allow focus if MF enabled and camera can focus that way?
#endif

#ifdef CAM_SD_OVER_IN_AFL
    if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1;     // allow focus if AFL enabled and camera can focus that way?
#endif
#ifdef PROPCASE_SERVO_AF
    if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0;        // don't focus in servo AF mode
#endif
    if (    (shooting_get_prop(PROPCASE_AF_LOCK)==0)           // allow focus when in AF mode (i.e AFL or MF not enabled)?
         && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;
#endif
    return 0;
}
Edit: Something like that. First fails already ...

Edit2: Trying it here instead...
There are a lot of testshots to delete, still iterating through the permutations of possibilities...
Code: [Select]
void shooting_set_focus(int v, short is_now)
{
    int s=v;
    if (!camera_info.state.mode_play)
    {
if (is_now && focus_busy) { 
short t=0;
do {msleep(10); t=t+1;} while (focus_busy && (t<404));
if (t<404) {
photo_param_put_off.subj_dist=shooting_get_subject_distance();
return ;}
}                // don't focus twice

        if (is_now && shooting_can_focus())
        {
            if (conf.dof_subj_dist_as_near_limit)
            {
                s=shooting_get_near_limit_f(v,shooting_get_min_real_aperture(),get_focal_length(lens_get_zoom_point()));
            }
            if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
                s+=shooting_get_lens_to_focal_plane_width();
            lens_set_focus_pos(s);
        }
        else
            photo_param_put_off.subj_dist=v;
    }
}
« Last Edit: 20 / July / 2020, 14:17:30 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14111
Re: Dolly Zoom
« Reply #19 on: 20 / July / 2020, 15:28:40 »
@Caefix
I don't understand how this relates to the current thread. In CHDK 1.5, cameras with CAM_USE_ALT_SET_ZOOM_POINT set do not use CHDK focus after setting zoom. The Canon firmware function _MoveOpticalZoomAt handles focus. All Digic 4 and later ports use this (as do a few others). So the shooting_set_focus stuff you quoted shouldn't be relevant to zoom on these cameras.

The crashes in your previous post generally seem to be related to using zoom too close to half press. If I try to zoom while half press is held, I get the ComputerZoom.c crash.  "Computer Zoom" = Digital zoom. I thought this was maybe because CHDK set_zoom manipulates digital zoom in some cases, but the same happens calling _MoveOpticalZoomAt directly.

The AFScanDriver.c crash also seems to be related using zoom too soon after half press is released / shooting is finished. Unfortunately, this one appears to happen after get_shooting() goes false (at least when cont AF is enabled), so there isn't an obvious way to know exactly when it's safe.

It would be nice to avoid these crashes in CHDK, but putting delays between half shoot and changing zoom seems to be a viable workaround.
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal