One thing that doesn't work for sure is capmode.set(capmode.name_to_mode["SCN_KIDS_PETS"])
According to phils new sig finder, the modemap on this camera is wrong:
// Mode 16417 in firmware but not in current modemap
// Mode 16399 in firmware but not in current modemap
// Mode 16407 in firmware but not in current modemap
// Mode 2609 in firmware but not in current modemap
// Current modemap entry not found in firmware - MODE_SUPER_MACRO 16905
// Current modemap entry not found in firmware - MODE_SCN_INDOOR 16401
// Current modemap entry not found in firmware - MODE_SCN_KIDS_PETS 16400
// Current modemap entry not found in firmware - MODE_SCN_NIGHT_SCENE 16395
// Current modemap entry not found in firmware - MODE_VIDEO_STD 2598
If you wan to help us correct it, do the following:
Go in to misc menu, debug, set debug data display to "props"
set PropCase ParamsData page to 4
exit the menu.
You should see a list of numer:number values on the OSD. Watch #49 while you set each possible shooting mode, and write down the number that corresponds to the shooting mode.
The shooting modes supported by your camera are listed at
http://www.usa.canon.com/cusa/support/consumer/digital_cameras/powershot_a_series/powershot_a490#SpecificationsNote that if there are different video frame rates or resolutions they may have different modes values. Sometimes modes like "long shutter" are accessed in a different way then the regular mode menu (e.g. the func menu or something like that).
When you are done, all of the following values (and no others) should be on your list:
16390
32772
16417
32768
16405
16404
16399
16397
16406
16407
16403
16402
16408
2609
Note: if you like scripting, you can use set_capture_mode_canon (
http://chdk.wikia.com/wiki/Script_commands#set_capture_mode_canon.28value.29 ) to set each of these in turn instead of manually setting the mode.
Second thing is that video recording is started but it never stops !
On most cameras, you click shoot to start recording, and click again to stop. It looks you your script tries to hold the button down for the entire video.
You should able to change take_video to something like
press("shoot_half")
sleep(500) -- give AF a chance
press("shoot_full")
release("shoot_full")
release("shoot_half")
sleep(secs*1000)
click("shoot_full")
Note the sleep(500) isn't strictly required, but it's usually a good idea to have some delay between the half press and full press so the camera can do autofocus.