Limit video recording time - Script Writing - CHDK Forum
supplierdeeply

Limit video recording time

  • 4 Replies
  • 2943 Views
Limit video recording time
« on: 17 / November / 2013, 13:28:38 »
Advertisements
Hello,

I'm trying to record video with a maximum duration of 45s,

Achievement activate the camera by this simple code using a USB trigger:

@ title Remote
while 1
   wait_click 1
   if is_key "remote" then shoot
wend

end

Any idea to limit the time the 45s video without reactivate the USB trigger.

Thank you very much and greetings

Camera: Canon 590is

Re: Limit video recording time
« Reply #1 on: 17 / November / 2013, 14:18:00 »
Code: [Select]
@title Remote
while 1
    wait_click 100
    if is_key "remote" then
        print "recording started"
        shoot
        t=get_tick_count+45000
        do
            wait_click 1000
            print (t-get_tick_count)/1000
        until is_key "remote" or t<get_tick_count
        print "recording stopped"
        shoot
    endif 
wend
end
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Limit video recording time
« Reply #2 on: 17 / November / 2013, 16:17:15 »

Waterwingz thank you very much for your script.

The camera begins capturing video normally to activate the USB remote trigger.

The problem is that it stops the 45s capture or to activate the USB remote trigger.

I have checked by testing that pressing the shutter of the camera stops the script but video capture is recorded.

Can my CHDK version is not compatible with the script?

The version of my 590 IS is this:

CHDK Trunk / Autobuild History

version / revision / author

0.8.2 / # 592 / PhyrePhox

Thanks and regards

*

Offline reyalp

  • ******
  • 14082
Re: Limit video recording time
« Reply #3 on: 17 / November / 2013, 16:27:07 »
Wow, that's a really old build. You might want to try something current.

Also, you should probably not use "shoot" to start and stop video recording. The shoot command is for still images, and may get confused in video mode.

Use click "shoot_full" or if that doesn't trigger reliably,

press "shoot_full"
sleep 200
release "shoot_full"
Don't forget what the H stands for.


Re: Limit video recording time
« Reply #4 on: 17 / November / 2013, 17:09:09 »
The timing of USB press & release is suspect too.  I did a better version but decided to keep it simple per the OP's request.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics