Movie Digest Script? - Script Writing - CHDK Forum

Movie Digest Script?

  • 18 Replies
  • 7655 Views
Movie Digest Script?
« on: 26 / June / 2015, 18:08:18 »
Advertisements
Hi,

Is it possible to add a Movie Digest like script?
I plan to use this on my G11.
It should work like this, every time I take a Photo, I also want it to take a 4 second video.

Any help would be great.

Thanks!

Re: Movie Digest Script?
« Reply #1 on: 26 / June / 2015, 19:48:07 »
It would be a simple matter to have a script that took a picture when you pressed the shutter buttton and then immediately recorded a short video.  But you need to be running in CHDK <ALT> mode to do that and while it will work, its not exactly convenient each time you start the camera as it requires a couple of setup steps before you can take your first picture.

It might be more interesting to move to the "dark side" of CHDK and have a script that loads automatically at startup, immediately exits <ALT> mode,  and starts/stops a short video each time it sees a picture taken (via get_exp_count( ) maybe).   I call this the dark side because CHDK scripting was not really designed to run outside of <ALT> so behavior in some ciircumstances might be indeterminate.   Still, something simple like this could very well be okay.

If I get a few minutes this weekend,  I'll give it a try on my G10.  That should be close enough to your G11 to tell if its possible at all.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #2 on: 26 / June / 2015, 23:26:53 »
Example script attached.   

If you configure it to autostart in the Scripting menu then it's pretty transparent.  After each shot,  it shoots a short video.

There are a few delays between each step in the script - I set those to something "safe".   You can try shortening them to speed up the response but my initial attempts showed that the script will stop working if the delays are too short.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #3 on: 27 / June / 2015, 00:30:18 »
Thank you so much! I'll give it a try!


Re: Movie Digest Script?
« Reply #4 on: 27 / June / 2015, 08:34:57 »
As a side note,  the script was written for camera's like your G11 without a seperate video button.  It may or may not work on cameras that actually have such a button - I have not tested it.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #5 on: 27 / June / 2015, 11:09:11 »
Thanks.

I've been messing with the script and I changed most of the sleep 500 to 50 and 1000 to 100 except for the Repeat section.
I'm not really sure what each sleep value does but I'm learning from trail and error.

It switches a lot faster now but there was some issues. None of them are major and I'm quite happy with the results! (Not asking you to fix it)

- On cold boot after removing the battery, it will give an E16 error after the first shot. The error doesn't come back as long as you don't remove the battery.
- It shoots 3 second videos now, but if I set the video time to 5, it shoots 4 second videos.
- The script stops working properly if the exposure is over 1 second. Which works out for me because the video would be too dark anyway.

Whenever you have time, could you add a cancel button by pressing the shutter again?
Also is there a way to sleep up the delay in mode switching?

Thanks!

Re: Movie Digest Script?
« Reply #6 on: 27 / June / 2015, 18:42:10 »
I'm not really sure what each sleep value does but I'm learning from trail and error.
The value in the sleep( ) function is just a delay in milliseconds ( 1/1000 seconds ) that the script pauses when it executes that function.  This allows you to insert delays between making things happen - so that, for example,  you don't simulate pressing and releasing the shutter button without a little time between the two actions.   The amount of time needed tends to be camera dependent and once you make the delay too small things stop working occasionally or always.

Quote
Whenever you have time, could you add a cancel button by pressing the shutter again?
Ah,  creeping featurism.

If one was to start adding things like that,  it would probably be better to have the script stay in <ALT> mode, hide the title line, disable the "full press' script halt and xfer that function to "no-key",  and pass through all key presses by default.  Then one could really start playing with jazzing up the basic script.

Quote
Also is there a way to sleep up the delay in mode switching?
From playback to shooting,  or from picture to video and back?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #7 on: 28 / June / 2015, 00:58:21 »
I see, thanks! We don't need to add that feature then.

I also notice, regular video mode doesn't work now. Is there a way you can have it get the capmode and only have it run when it's in picture mode? I'm trying to learn based on what you provided. The code below isn't correct, but I'm guessing something like that would work right?

Code: [Select]

if capmode.valid("shoot") then
    capmode.set("VIDEO_STD")
end


Delay for switching from Picture to Video. I don't have preview mode enabled on my camera, so that might be the extra Delay I'm seeing. Which line on would I find the delay on?

Thanks!


Re: Movie Digest Script?
« Reply #8 on: 28 / June / 2015, 10:40:49 »
I see, thanks! We don't need to add that feature then.
I'm usually pretty willing to try things that intrigue me with CHDK.  But I've become somewhat wary of writing scripts for people who "just have to have a certain feature", only to have them never come back, try it, and report how it worked for them.  As you seem to be still hanging on here,  I'll try to find a few spare minutes this week to do this "properly".

Quote
I also notice, regular video mode doesn't work now. Is there a way you can have it get the capmode and only have it run when it's in picture mode?
Updated script attached.  It detects any mode starting with the string "VIDEO" and ignores related changes in exposure count.

Quote
Delay for switching from Picture to Video. I don't have preview mode enabled on my camera, so that might be the extra Delay I'm seeing. Which line on would I find the delay on?
Line 52 in the updated script. 
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Movie Digest Script?
« Reply #9 on: 28 / June / 2015, 12:11:11 »
Np, what I have now already works. No need to go out of your way to write it.
I'm Just reporting back in case other users are also looking for something similar.
I use the Movie Digest feature on my D20 for trips and I was about to get the new G16 just for this feature. lol
I'm glad I looked here first and thank you for your help. Looks like I'll be keeping the G11 for awhile.

Thanks again!

 

Related Topics