Event on motion picture saved
Question
Hello !
- I've configured "on_picture_save" to send me email with picture attached when motion detects movement => it works great !
- I've configured "snapshot_interval" to store snapshot in order to display them in real-time => it works super great !
My problem is :
- the event "on_picture_save" send me an email for each snapshot.
How could I configured motion in order to send me email
only on non-snapshot picture save ?
Best Regards
Paste in your error messages, config settings, terminal window output etc in this text field.
Environment
Motion version: |
3.2.12 |
ffmpeg version: |
|
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
|
--
HoshiManu - 03 Mar 2015
Answer
Hi Hoshi.
You probably already knew this but you can make the filenames of motion jpegs and snapshot jpegs different by specifying the config file parameters "snapshot_filename" and "picture_filename" differently. So for example you can always have the word "snapshot" in the snapshot jpegs but not in the motion jpegs.
picture_filename
m%d-
M%S-%q-%v
snapshot_filename
m%d-
M%S-snapshot
Then, could you make your system detect when an image file has the word "snapshot" in it and have it not send an email?
So for example you could use
on_picture_save mail_jpeg.sh %f
And then have a script mail_jpeg.sh similar to the following (replacing "send_email" with whatever commands you are using)
#!/bin/bash
# test if the saved jpeg filename passed to the script has "snapshot" included
# and if so don't sent an email.
# SNAP should be empty for a non snapshot file assuming all snapshot files have
# the word snapshot in them.
SNAP=`echo $1 | grep snapshot`
if [ -z $SNAP ] ; then
send_email $1
fi
I wonder if that would solve your problem? Anyway, best wishes and good luck!
--
AlanFord - 06 Mar 2015