Movie Digest Script? - page 2 - Script Writing - CHDK Forum supplierdeeply

Movie Digest Script?

  • 18 Replies
  • 6610 Views
Re: Movie Digest Script?
« Reply #10 on: 28 / June / 2015, 17:02:12 »
Advertisements
Had a few minutes and felt somewhat creative so I cleaned up the worst hacks in the script.   New version attached.

It now has an OSD element so you can tell what is happening, If you press any key while the digest video is recording then recording stops.  It also now works for both types of Canon P&S cameras - with and without a seperate video button.

I made the initial "mode switch" delay a settable script parameter.  On my clunky old G10 it needs to be about five seconds with RAW enabled so that the previous shot completes and saves prior to switching modes.  Without RAW enabled it needs 2 seconds.  In addition, my S100 and A1200 are happy with a one second delay when shooting JPG only.  None of my cameras like 0 seconds (maybe there could be a 1/2 second option though ...)

If you autostart this script when CHDK loads (via the Script menu autostart option) then you will never really know that you have CHDK loaded until you actually shoot.  It just runs like you originally asked for. 8)

The last refinement would be optimizing the mode switch delay but AFAIK there is really no way to know in a CHDK script if the previous shot has completely finished recording on the SD card and it's safe to change modes and start video recording.

Edit : removed script - new version posted below

« Last Edit: 29 / June / 2015, 23:11:26 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #11 on: 29 / June / 2015, 09:49:54 »
Updated script.  Previous version did not exit <ALT> mode after shooting a video clip.  Fixed that.

New version also puts an OSD icon thingy at the bottom of the screen to remind you the script is active when you are not in <ALT> mode (user selectable as on/off via script parameter). 

Also,  entering <ALT> via the ALT key terminates the script and restores the CHDK title line.  Which is a nice cleanup from the previous versions of the script.
« Last Edit: 29 / June / 2015, 23:13:07 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #12 on: 30 / June / 2015, 04:26:42 »
Once  again thank you.

I didn't get to play with the new script too much today, but it seems to keep failing on me. Video recording is a hit or a miss. Sometimes the script stops itself and the icon disappears. it could just be me, it needs more testing.

Re: Movie Digest Script?
« Reply #13 on: 30 / June / 2015, 07:19:32 »
The script should only stop if you press the key used to enter ALT mode.  Unless there is a bug in the code that is

As to the issues with starting recording, does lengthening the delay value to 5 seconds fix that?

I'll do some more testing on my other camera models and see how it goes.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Movie Digest Script?
« Reply #14 on: 30 / June / 2015, 22:30:47 »
Ok I found the issue with the script stopping. My finger was slightly putting pressure on the half shutter causing it to cancel.

When I set the delay below 4 sec, I get failed to start. Which is odd, since I wasn't having issues before at 1 sec. Maybe it could be a memory issue from the new script. I'm going to try to mess with it some more.
« Last Edit: 30 / June / 2015, 22:37:08 by nycrayjai »

Re: Movie Digest Script?
« Reply #15 on: 30 / June / 2015, 22:46:24 »
Ok I found the issue with the script stopping. My finger was slightly putting pressure on the half shutter causing it to cancel.
It should ignore the half shutter - unless you were doing that while digest clip video recording was running?  Then it would just quit the current clip and go back to waiting for your next shot.  We could modify the script to only abort video recording on a specific key (or keys) press.

Quote
When I set the delay below 4 sec, I get failed to start. Which is odd, since I wasn't having issues before at 1 sec. Maybe it could be a memory issue from the new script. I'm going to try to mess with it some more.
Have you enabled RAW/DNG by accident? CHDK has a nasty little keyboard shortcut thing it does in <ALT> mode that enables RAW/DNG while you are not looking.  One of the major annoyances in CHDK IMHO.  When I had RAW enabled,  my old G10 needed 5 seconds between shots.   

I've been searching for a way to tell for sure when it is safe to start video recording for any camera.  I tried just doing full presses in a one second loop waiting for recording to start but that just crashed the camera.  I might try half-presses and get_shooting() to see if I can tell that way.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #16 on: 01 / July / 2015, 04:02:57 »
yea, the issue is with my finger still touching the shutter, a light tap causes the video to stop recording.
Maybe a full press should stop it?

I don't have Raw enabled. Here's how my delay looked on V2.

Code: [Select]
function video_start()
    print("video started.")
    save_capture_mode=capmode.get()
    capmode.set('VIDEO_STD')
    sleep(50)
    --press("shoot_full")
    post_levent_for_npt("PressSwOne",0) 
    sleep(50)
    post_levent_for_npt("PressSwTwo",0)   
    sleep(100)
    --release("shoot_full")
    post_levent_for_npt("UnpressSwTwo",1) 
    sleep(50)
    post_levent_for_npt("UnpressSwOne",1) 
end

function video_stop()     
    print("video stopped.") 
    --press("shoot_full")
    post_levent_for_npt("PressSwOne",0) 
    sleep(50)
    post_levent_for_npt("PressSwTwo",0)   
    sleep(100)
    --release("shoot_full")
    post_levent_for_npt("UnpressSwTwo",1) 
    sleep(50)
    post_levent_for_npt("UnpressSwOne",1) 
    sleep(50)
    capmode.set(save_capture_mode)
    sleep(100)
end
« Last Edit: 01 / July / 2015, 04:07:08 by nycrayjai »

Re: Movie Digest Script?
« Reply #17 on: 01 / July / 2015, 07:48:59 »
I don't have Raw enabled. Here's how my delay looked on V2.
The mode switch delay of two seconds is not really determined in the code you posted.   It's down at line Line 52.

Code: [Select]
    ecnt=get_exp_count()
    repeat sleep(100) until get_exp_count()~=ecnt
    if (string.sub(capmode.get_name(),1,5) ~= 'VIDEO') then
        sleep(2000)    <<------------- delay time for mode switch
        video_start()
        sleep(t*1000)
        video_stop()
    end
until false

Still working on a version that can detect when it is safe to start the video clip (without a hard coded delay).  Check back here very couple of days?
« Last Edit: 01 / July / 2015, 08:34:13 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Movie Digest Script?
« Reply #18 on: 23 / April / 2016, 20:40:10 »
Just for my scripting exercise i wrote this one a while ago.
It records a 4-5 sec clip before a shot and adds few features to the "official" movie digest mode.
I use it the most for lightning clips.
BTW the "official" movie digest mode is enough and doesnt require the CHDK intervention.
 ;)

Edit
right script ver. attached
« Last Edit: 24 / April / 2016, 05:42:10 by fabri22 »

 

Related Topics