syntax of ; on_motion_detected value

Asked by Ty on 2013-07-04

I'm trying to run a script that will execute a bash script when motion is detected.

This is the default code:
#Command to be executed when a motion frame is detected (default: none)

; on_motion_detected value"

This is what I put in:
#Command to be executed when a motion frame is detected (default: none)

on_motion_detected /path/to/script

__

Using the terminal, this runs the script just fine by sending a notify-send.
I also ran chmod +x /path/to/script

It seems like I am writing the option incorrectly as nothing is occuring. Even when I replace path/to/script with "touch rand124.txt" nothing is created when I create motion despite an .avi being recorded as a event.

The explanation says:
############################################################
# External Commands, Warnings and Logging:
# You can use conversion specifiers for the on_xxxx commands
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = thread (camera) number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# %f = filename with full path
# %n = number indicating filetype
# Both %f and %n are only defined for on_picture_save,
# on_movie_start and on_movie_end
# Quotation marks round string are allowed.
############################################################

But I am unable to figure out how to use that to correctly write the option. I do plan on using %f once I figure this out however.

What is the correct syntax of writing in this option?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu motion Edit question
Assignee:
No assignee Edit question
Last query:
2013-07-04
Last reply:
2013-07-20

Contact the maintainer. Maybe they can help:

https://launchpad.net/~apostols

Manfred Hampl (m-hampl) said : #2

Have you read and followed the instructions in http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide

Ty (fox-ibenbl) said : #3

Manfred:
I found that guide late last night and went through it. Specficially, I focused on this section in the faq:

How do I create mpegs from jpeg files instead of using ffmpeg?

which includes a guide to running a script on_event_end which confirmed I had been writing it correctly. Regardless, here's what it showed:

Summary of steps in the guide:
Create script to on_event_end /home/guillo/bin/motion_encode_and_delete_jpgs
chmod a+x <bash script path>
on_event_end /home/guillo/bin/motion_encode_and_delete_jpgs gap 10

What I did:
on_motion_detected /path/to/script gap 10 #no spaces in script path
chmod a+x /path/to/script

If I run that exact path/to/script in terminal, it works fine.
__

Also, in the guide it specs on_motion_detected to be introduced in 3.2.1 and I have motion Version 3.2.12
and on the page http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMotionDetected
it indicates the command should be in a string, but even when I put the command in quotes, nothing changed.

Manfred Hampl (m-hampl) said : #4

As I can see you already created a support request on the developer's page http://www.lavrsen.dk/foswiki/bin/view/Motion/SupportQuestion2013x07x04x143337
Hopefully you will get an answer there.

Launchpad Janitor (janitor) said : #5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.