NOLCDVIDEO - Disables LCD when recording in video mode and more - Completed and Working Scripts - CHDK Forum  

NOLCDVIDEO - Disables LCD when recording in video mode and more

  • 13 Replies
  • 5763 Views
Advertisements
Features:
- Disable LCD backlight at record start and re-enable at end
- Toggle backlight during recording
- Low Voltage Warning
- Low Disk Space Warning

Requirements:
Must be in video mode (video mode dial) and in record mode (not playback)

Parameters Available:
Low Voltage Threshold - Triggers Low Voltage alert
Low Disk Space Percent Threshold - Triggers Alert if free disk space is less than this (in percent)
Enable Low Voltage Alert - 1 means it will alert you. Any other number means off.
Enable Low Disk Space Alert - 1 means it will alert. Any other number means off.

Usage:
- In ALT mode, fully depress the shutter to start the script and thus recording and press again to stop it.
- You may run this script even after you have started a recording.
- The "Display" button will toggle your backlight when you are recording.

Tested:
A1100IS

NOLCDVIDEO.bas
Code: [Select]
@title NOLCDVIDEO
@param d Low Voltage Threshold
@default d 2400
@param e Low Disk Space Percent Threshold
@default e 10
@param f Enable Low Voltage Alert
@default f 1
@param g Enable Low Disk Space Alert
@default g 1

rem v1.0.0.1
rem todo: set_led for recording, battery low, card almost full. To use switch case statements when if, elseif is needed
rem Original values: A = focus mode, a=buttonchecks, b=modechecks(get_mode),c=backlightstate,d=batteryalertvoltage,e=freediskspacealertpercent,f=batteryalertstate,g=freediskalertstate,h=internalmathvar,i=internalmathvar2

rem Init
b=get_mode
if b=1 then goto "dorecmodeerror"
if b=0 then goto "dosceneerror"

rem get_prop 12 A
rem if A=0 then set_prop 12 1

rem Main
print "Starting..."

if get_movie_status=4 then
  rem set the led
  print "Recording already started..."
  print "Turning off LCD in 1 sec"
  sleep 1000
  set_backlight(0)
else
  press "shoot_half"
  sleep 1000
  click "shoot_full"
  rem set the led
  print "Started recording..."
  print "Turning off LCD in 1 sec"
  sleep 1000
  set_backlight(0)
endif

c=0
:loop
  wait_click 5000
  is_key a "display"
  if a=1 then gosub "dotoggledisplay"
  if is_key "no_key" then gosub "dochecks"
goto "loop"

rem Func
:dochecks
  if get_vbatt <= d then
    if f=1 then
      playsound 6
      print "Battery Voltage: ", get_vbatt, "V"
    endif
  endif
  
  h=get_free_disk_space * 100 / get_disk_size
  if (h <= e) then
    if g=1 then
      playsound 6
      print "Disk space left:", get_free_disk_space / 1000, "MB (", h, "%)"
    endif
  endif
return

:dotoggledisplay
  print "Toggling display..."
  if c=0 then
    set_backlight(1)
    c=1
  else
    sleep 500
    set_backlight(0)
    c=0
  endif
return

:dosceneerror
  print "Not in Video mode, exiting."
  sleep 1000
end

:dorecmodeerror
  print "Not in REC mode, exiting."
  sleep 1000
end

:restore
  set_backlight(1)
  print "Stopping recording"
  rem unset the led
  click "shoot_full"
  rem set_prop 12 A
« Last Edit: 26 / April / 2011, 04:03:36 by fusionstream »

Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #1 on: 01 / July / 2011, 19:11:18 »
It doesnt work in my Powershoot S95. It says "not in video mode" when I hit the shutter (I'm in video mode). Any idea?

Thanks.
« Last Edit: 02 / July / 2011, 03:55:41 by kepler »

Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #2 on: 02 / July / 2011, 01:30:18 »
try to turn the mode dial to video

Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #3 on: 02 / July / 2011, 03:55:18 »
fusionstream, it's what I've done first.


*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #4 on: 02 / July / 2011, 04:45:21 »
fusionstream, it's what I've done first.
fusionstream, it's what I've done first.

Go into the Miscellaneous stuff --> Debug parameters menu.
Set Debug data display to Props
Set PropCase/ParamsData page to 4

Post the value in property 49 when the mode dial is set to video.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #5 on: 02 / July / 2011, 09:17:41 »
Hi Phil, the property 49 shows "2614".

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #6 on: 02 / July / 2011, 09:49:41 »
Hi Phil, the property 49 shows "2614".

Thanks, that doesn't match what's in the code which is why it's not detecting video mode.

Can you get the property 49 values for the 'Color Accent' and 'Color Swap' video modes and tell me which firmware version you have.

I'll update the code with the values and post a test version.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #7 on: 02 / July / 2011, 16:44:30 »
The property 49 is 2614 for the 'Color Accent' and 'Color Swap' video modes.

I've CHDK Ver. 0.9.9-1204 from s95-100k-0.9.9-1218-full_BETA


*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #8 on: 02 / July / 2011, 18:41:28 »
The property 49 is 2614 for the 'Color Accent' and 'Color Swap' video modes.

I've CHDK Ver. 0.9.9-1204 from s95-100k-0.9.9-1218-full_BETA

Try this version. If it works I'll submit a patch for the autobuild server.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: NOLCDVIDEO - Disables LCD when recording in video mode and more
« Reply #9 on: 04 / July / 2011, 14:58:09 »
Phil, I've tried this version (s95-100k-0.9.9-Test-full) but no luck, same result.

 

Related Topics