Enhancing Miniature Video Mode - Script Writing - CHDK Forum

Enhancing Miniature Video Mode

  • 14 Replies
  • 7868 Views
Enhancing Miniature Video Mode
« on: 14 / September / 2014, 07:44:34 »
Advertisements
The Miniature mode (on more recent cameras) is an easy way to do a quick time lapse without having to edit hundreds of frames at pc.
The factory mode has these limits:
1-to get an HD movie (720p) you must switch format to 16:9
2-does not allow zooming
3-does not allow refocusing
4-blurs top and down part of frame

I made this mini script that turns the factory Miniature mode into a Time lapse mode without blurred areas (+ zooming and refocusing capabilities).

A common command line for refocusing is at the end of the script, but doesn't work
Added set_aflock(1) to the focusing part. Now it refocuses via half-press. :-)
Refocusing during zooming seems utopian.

Didn't find any useful "hack" for #4. Is there any way to modify or remove the blurred area?
It seems that setting prop 321=4 blur parts are gone  :) You have to test it with your camera model.

Need your help ... as always


With ixus 125 the start/stop rec button corresponds to "display" button name (to match the CHDK RAW fast switching).
With different cameras you have to edit the script line  "if is_pressed("display") ..." with  "if is_pressed("YOUR PREFERRED BUTTON") ...".
Look at here for valid button names.



Updated Version (Thanks for your help)
Read here for changes.

Attached last updated version (1.3).
« Last Edit: 16 / September / 2014, 09:21:47 by fabri22 »

Re: Enhancing Miniature Video Mode (...trying to)
« Reply #1 on: 14 / September / 2014, 10:42:04 »
A common command line for refocusing is at the end of the script, but doesn't work  :(
There is a Canon function that some CHDK cameras use to refocus during recording called MakeAFScan().   Unfortunately,  it's not currently available for script use. It is possible to call it directly if you know its address in Canon memory for your camera and firmware version.  At nafraf's suggestion, that's what I tried here : http://chdk.setepontos.com/index.php?topic=8072.msg116643#msg116643

Unfortunately,  the signature finder does not have an address for MakeAFScan for many cameras, including the ixus125, so somebody would have to find it manually.  Also, based on experience with other cameras,  it might not work even if it did.

Quote
Didn't find any useful "hack" for #4. Is there any way to modify or remove the blurred area?
Changing that will require a major exploration deep in the Canon code.  Probably possible but a lot of work for a very experienced developer.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: Enhancing Miniature Video Mode (...trying to)
« Reply #2 on: 14 / September / 2014, 10:48:05 »
Unfortunately the propcases only hold UI related information about the focused rectangle (instead of box dimensions and proper coordinates), so
Quote
Didn't find any useful "hack" for #4. Is there any way to modify or remove the blurred area?
Changing that will require a major exploration deep in the Canon code.  Probably possible but a lot of work for a very experienced developer.
that is true... That time is probably better spent reversing framerate related stuff.

Re: Enhancing Miniature Video Mode (...trying to)
« Reply #3 on: 14 / September / 2014, 14:41:02 »
A common command line for refocusing is at the end of the script, but doesn't work  :(
There is a Canon function that some CHDK cameras use to refocus during recording called MakeAFScan().   Unfortunately,  it's not currently available for script use. It is possible to call it directly if you know its address in Canon memory for your camera and firmware version.  At nafraf's suggestion, that's what I tried here : http://chdk.setepontos.com/index.php?topic=8072.msg116643#msg116643
Well, i found that adding set_aflock(1) to the focusing part it refocuses ! Beginner's luck  :)
Maybe it calls indirectly that MakeAFScan() you was referring to.
So #3 is solved. I can refocus during rec via half-press.


Unfortunately the propcases only hold UI related information about the focused rectangle (instead of box dimensions and proper coordinates), so ... 

Didn't find any information about the focused rectangle propcase.

*

Offline srsa_4c

  • ******
  • 4451
Re: Enhancing Miniature Video Mode (...trying to)
« Reply #4 on: 14 / September / 2014, 14:57:58 »
Didn't find any information about the focused rectangle propcase.
You can use the built-in "cmpprop" utility to visualize changing propcases: http://chdk.wikia.com/wiki/PropertyCase#Discovering_PropertyCase_meanings_and_values


Re: Enhancing Miniature Video Mode (...trying to)
« Reply #6 on: 14 / September / 2014, 17:13:47 »
Well ... again  :), it seems that i got the "hack" for the blurring part.
I compared propcases changes (from 0 to 400) with the propdump.lua script (by Morris Johns).
The propcase involved with focused area in miniature mode is 321 (0=min, 1=med, 2=max).
Setting this prop to 4 the whole framed area seems in focus.
Attached frame 1 (canon max focused area)
Attached frame 2 (prop 321=4)

The prop 321 "hack" works fine with my ixus 125.
Don't know if it works with your own cameras, so you have to test it with the above script.

*

Offline srsa_4c

  • ******
  • 4451
Re: Enhancing Miniature Video Mode (...trying to)
« Reply #7 on: 14 / September / 2014, 18:57:02 »
Well ... again  :), it seems that i got the "hack" for the blurring part.
I compared propcases changes (from 0 to 400) with the propdump.lua script (by Morris Johns).
The propcase involved with focused area in miniature mode is 321 (0=min, 1=med, 2=max).
Setting this prop to 4 the whole framed area seems in focus.
Attached frame 1 (canon max focused area)
Attached frame 2 (prop 321=4)

The prop 321 "hack" works fine with my ixus 125.
Don't know if it works with your own cameras, so you have to test it with the above script.
Nice work! Does this mean that you can record blur-less "miniature" videos if you set the propcase before recording?

Re: Enhancing Miniature Video Mode (...trying to)
« Reply #8 on: 14 / September / 2014, 19:06:06 »
Nice work! Does this mean that you can record blur-less "miniature" videos if you set the propcase before recording?

Yes. Look at attached frames posted above.
BTW also setting prop 321=3 removes blurred areas.

Pratically the Miniature mode becomes a Time lapse mode :-)

Re: Enhancing Miniature Video Mode
« Reply #9 on: 15 / September / 2014, 04:30:25 »
IMPORTANT NOTE
With ixus 125 the start/stop rec button corresponds to "display" button name (to match the CHDK RAW fast switching).
With different cameras you have to edit the script line  "if is_pressed("display") ..." with  "if is_pressed("YOUR PREFERRED BUTTON") ...".
Look at here for valid button names.

Maybe is there a workaround to automatically set the right rec button for every camera ?  ::)


 

Related Topics


SimplePortal © 2008-2014, SimplePortal