I use this script for control of infra-red highlighting at insufficient illuminance.
A principle of operation: the script periodically receives from ZoneMinder a current frame, calculates average value of brightness of all pixels and depending on result switches on or off an intra-red highlighting.
Howto install:
- save texts of programs in appropriate files (see comments in the beginning)
- compile jpgbright.c the command: gcc -O2 -s -o jpgbright -ljpeg jpgbright.c
- add in crontab a line similar to these: */5 5-10,16-22 * * * /usr/local/zm/opt/lightctl
- in ZoneMinder add the special user for dialogue of a script with ZoneMinder, no access rights are necessary for this user for version 1.19.4.
- in the beginning of a file lightctl correct value of variables for your variant.
For me for handle of highlighting it is used OneWire device if for you differently - correct a code of functions light_on and light_off.