Grabbing a representative alarm image? [SOLVED]

Forum for questions and support relating to the 1.24.x releases only.
Locked
Kepesk
Posts: 6
Joined: Mon Nov 10, 2008 6:17 pm

Grabbing a representative alarm image? [SOLVED]

Post by Kepesk »

ZomeAlarm is awesome. I have it successfully detecting when someone approaches my front door, and through a script, sending me a notification through gtalk.

However, I also would like to be able to grab an image that is representative of that alarm (such as the first alarmed image or the most alarmed image) and use the script to copy it to a particular location on my server for easy access.

Does anyone know a way of passing an image location to a script in this manner? Or is there another way to go about this altogether?

Thanks!
Last edited by Kepesk on Wed May 26, 2010 4:36 pm, edited 1 time in total.
Kepesk
Posts: 6
Joined: Mon Nov 10, 2008 6:17 pm

Post by Kepesk »

I figured out a way to do it, not by having the script grab the image location from ZoneMinder, but by having the script determine the proper file on its own:

Code: Select all

#!/bin/bash
NEWEST=
for f in ls /var/cache/zoneminder/events/FrontDoor/*/030-capture.jpg
do
    if [ -z "$NEWEST" ]
    then
        NEWEST=$f
    elif [ "$f" -nt "$NEWEST" ]
    then
        NEWEST=$f
    fi
done
cp $NEWEST /var/www/mh/frontdoornewest.jpg
In this case, FrontDoor is the name of my camera, and it has a pre event image count of 30, so 030-capture.jpg would be the first alarmed frame.
Locked