Motion - Support Question 2015x 03x 03x 090955

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 ! smile
  • I've configured "snapshot_interval" to store snapshot in order to display them in real-time => it works super great ! smile

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 DONEm%d-HELPM%S-%q-%v

snapshot_filename DONEm%d-HELPM%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
Topic revision: r3 - 12 Apr 2015, TosiaraT
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.