digic 6 motion detection (was Re: SX60HS Porting) - page 9 - General Discussion and Assistance - CHDK Forum  

digic 6 motion detection (was Re: SX60HS Porting)

  • 87 Replies
  • 44829 Views
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #80 on: 23 / March / 2017, 16:04:25 »
Advertisements
Not sure I can do this on the sx60.  Movie mode md_tune? I'm unfamiliar with that but it would be useful to record a minute in movie mode triggered by motion. 

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #81 on: 23 / March / 2017, 20:25:14 »
Not sure I can do this on the sx60.  Movie mode md_tune? I'm unfamiliar with that but it would be useful to record a minute in movie mode triggered by motion.
It's a pretty simple thing to do with a script. Detect motion the standard way and then shoot a video under script control.   I've probably posted a couple of examples here on the forum.  I'll look.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #82 on: 25 / March / 2017, 12:37:26 »
Not sure I can do this on the sx60.  Movie mode md_tune? I'm unfamiliar with that but it would be useful to record a minute in movie mode triggered by motion.
It's a pretty simple thing to do with a script. Detect motion the standard way and then shoot a video under script control.   I've probably posted a couple of examples here on the forum.  I'll look.

link > MDFB2013 - updating the fastest CHDK motion detection script
Ported :   A1200    SD940   G10    Powershot N    G16

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #83 on: 25 / March / 2017, 16:03:42 »
Thanks @waterwingz! Looks interesting.


*

Offline reyalp

  • ******
  • 14082
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #84 on: 09 / April / 2017, 23:01:28 »
After running MD, the camera crashes with the lens out when I attempt to switch to play mode or power off. This happens with both MDFB2013.bas and md_tune.bas, both in test and shooting mode. It only happens if IS is enabled in the Canon menu.
So, after a bunch of debug logs, digging through stack traces and so on, I think I've figured this one out...

mdfb2013 does

Code: [Select]
    set_prop(props.IS_MODE, 3)        -- IS_MODE off
On G7X, off is 2 :haha

Manually calling set_prop to restore it to one of the allowed values avoids the crash.

So it's a script bug, not a port bug. However, it does raise an issue: For portable scripts, it's not enough to have platform independent propcase IDs, in some cases we need them for the values too.

I'm not sure how to fit this in framework of propcase.lua. Perhaps another module with higher level functions.
Don't forget what the H stands for.

Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #85 on: 09 / April / 2017, 23:47:43 »
So it's a script bug, not a port bug.
Nice catch and ouch. Technically, my bug I think. Not like there was any way for me to know mind you.

Edit : I just have to point out that the script in question was definitely not mdfb2013.bas
« Last Edit: 09 / April / 2017, 23:51:46 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14082
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #86 on: 10 / April / 2017, 00:16:07 »
Nice catch and ouch. Technically, my bug I think. Not like there was any way for me to know mind you.
It's hardly your bug since we don't define the values in a platform independent way. We've just gotten lucky that Canon left the values close enough for many generations of camera.

According to http://chdk.wikia.com/wiki/PropertyCase suggests that OFF is 4 on some, but I guess that doesn't crash because 3 is still a valid value.

Quote
Edit : I just have to point out that the script in question was definitely not mdfb2013.bas
Yes, most of the non-trivial ubasic scripts floating around have much worse problems.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: digic 6 motion detection (was Re: SX60HS Porting)
« Reply #87 on: 10 / April / 2017, 13:46:32 »
On G7X, off is 2
Same on my propset 6 cameras and on the M10.