Available in

(1)

Contents

NAME

motion − Detect motion using a video4linux device

SYNOPSIS

motion [ -BCDhlmNpQw] [ -A ipnr] [ -a seconds] [ -c changes] [ -d device] [ -E command] [ -F file] [ -f nr] [ -G seconds] [ -g seconds] [ -i input] [ -L noise] [ -M address] [ -n norm] [ -O command] [ -P device] [ -q quality] [ -S nr] [ -s widthxheight] [ -t target dir] [ -u user:pass ] [ -U webcam_path ] [ -V device]

DESCRIPTION

Motion uses a video4linux device to detect motion. If motion is detected both normal and motion pictures will be taken. Motion can also take actions to notify you if needed. Creation of automated snapshots is also possible.

OPTIONS

−A

IP address or URL for Network Camera (e.g. an Axis network camera). Only relevant for network cameras.

−a seconds

time between two automated snapshots, valid range: 0 to thousands, default: 0. The default value of 0 means that the feature is disabled.

−B

Encode all jpg images to mpeg after a event using mpeg_encode

−C

Output changes count for every frame, usable for tuning. Writes the detected number of changed pixels (after noise filtering) to the console (non-daemon mode only).

−c changes

threshold for detecting a change, Valid range: 1 to thousands, default: 1500.

−D

Daemonize

−d device

video4linux capture device, default: /dev/video0

−E command

Execute ’command’ when detecting motion. The command is executed at the beginning of the event before the images are stored.

−F file

pgm image to use as a mask for filtering motion. This file must have the same size as you have set for the video4linux device. Black area means masked out. White means fully include in motion detection.

−f number

Maximum number of picture frames per second that motion takes when detecting movement. Valid range: 0 to limit of camera. Default is none which means that it takes as many as possible.

−G seconds

Minimum gap between two shots in seconds. 0 to thousands, default: 0

−g seconds

minimum gap between events, Valid range: 1 to thousands, default 60. An event is defined as a series of motion images taken within a short timeframe.

−h

Display an short text with all command line functions.

−i input

input channel to use for video capture cards. Valid range: depends on video capture card, default: not set

−L noise

Noise level, all changes smaller than this level will be considered noise. Valid range: 1 to 255, default: 32

−l

Do not locate and mark motion on output pictures. The mark is in the form of a rectangle on the saved images so that you can easily see what it was that was moving in the picture.

−M address

Send a mail to ’address’ when detecting motion.

−m

Output ’motion’ images. Motion images shows the motion content of the pictures. This is good for tuning and testing but probably not very interesting for the general public. Default is not to store motion images. Motion pictures have an m at the end of the filename.

−N

Don’t output normal images. Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. This option turns the feature OFF.

−n norm

norm to use (pal/pal-nc/ntsc/secam), default: pal. For capture cards only.

−O command

Execute ’command’ when an image is saved. The name of the image will be given as argument.

−P device

video4linux video loopback input for normal images. If a dash ’-’ is given as device, motion will try to use /proc/video/vloopback/vloopbacks to find a free pipe on its own. default: not set

−p

Output ppm images instead of jpeg. This will reduce CPU load but disk I/O will increase a lot.

−Q

Don’t sound the warning beep when detecting motion. (This doesn’t change anything in daemon mode, there never is a beep there)

−q quality

JPEG image quality, Valid range: 0-100,default: 75.

−S number

Send a SMS to number using sms_client when detecting motion.

−s widthxheight

Picture size, Valid range: Camera dependent, default: 352x288

−t target-dir

destination for snapshots. Default is current working directory.

−U url|IP_addr

Webcam path. URL for a net camera.

−u user:pass

For password-protected network cameras, use this option for the HTTP 1.1 Basic authentication mechanism. default: No authentication. Only relevant for network cameras.

−V device

Output device name. Device name that motion uses to generate output for the video loopback device driver.

−w

Activate light switch filter. With this option on motion will not classify sudden light differences as a motion (not 100% fail proof!)

CONFIG FILE OPTIONS

These are the options that can be used in the config file. They are overridden by the commandline! All number values are integer numbers (no decimals allowed). Boolean options can be on or off (values "1", "yes" and "on" all means true and any other value means false).
adjust_rate on|off

Try to make the frame rate of the created mpegs as normal as possible. Normal means round 25 frames per second. Allowed values: on, off. Default: off

always_changes on|off

Always display the differences between the captured frame and the reference frame (non-daemon mode only). This can come in handy while tuning your setup. Default: off

auto_brightness on|off

Motion will try to adjust the brightness of the video device if the images captured are to dark or to light. This option will be most useful for video devices like web cams, which sometimes don’t have such an option in hardware. Default: off

berkeley_single_directory on|off

Use single directory structure (For Berkeley mpeg_encode feature only). Default: off

control_localhost on|off

Limits the xml-rpc control to the localhost. Default: on

control_port port_no

Sets the port number for the xml-rpc based remote control. Default: 0 (not defined)

daemon on|off

Start motion in daemon mode and release terminal. Default: off

despeckle EedDl

Despeckle motion image using (e)rode or (d)ilate followed by optional (l)abeling of largest area (Default: not defined)
Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid.
(l)abeling must only be used once and as the last letter.
Comment out to disable

execute command

External command to be executed when detecting motion. Default: none

ffmpeg_bps bps

Bitrate of mpegs produced by ffmpeg. Default: 400000 (400Kbps)

ffmpeg_cap_new on|off

Use ffmpeg libraries to encode mpeg movies in realtime. Default = off. FFmpeg Streaming Multimedia System must be installed saperately.

ffmpeg_cap_motion on|off

Use ffmpeg libraries to encode motion type mpeg movies in realtime. Default = off. FFmpeg Streaming Multimedia System must be installed saperately.

ffmpeg_filename filepath

File path for motion triggered ffmpeg films (mpeg) relative to target_dir.
Default value (%v-%Y%m%d%H%M%S) is equivalent to legacy ’oldlayout’ option.
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H%M%S.
File extension .mpg is automatically added so do not include this.
This option uses conversion specifiers which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3).
The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second. Two are unique to motion %v = event, %q = frame number.
With a combination of text and conversion specifiers you have full flexibility to define your directory- and filenames. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’.
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S for ’oldlayout on’ and %Y/%m/%d/%H%M%S for ’oldlayout off’.

ffmpeg_timelapse_mode

The file rollover mode of the timelapse video. Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual.

ffmpeg_timelapse seconds

Use ffmpeg libraries to encode a timelapse movie, saving a picture frame at the interval in seconds set by this parameter. Default = not defined. Set it to 0 if not used.

ffmpeg_variable_bitrate

Enables and defines variable bitrate for the ffmpeg encoder. ffmpeg_bps is ignored if variable bitrate is enabled. Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, or the range 2 - 31 where 2 means best quality and 31 is worst.

ffmpeg_video_codec

Codec to used by ffmpeg for the video compression. Supported formats are: mpeg1 (default), mpeg4, and msmpeg4.
Timelapse mpegs are always made in mpeg1 format independent from this option.
mpeg1 gives you files with extension .mpg
mpeg4 or msmpeg4 give you files with extension .avi
msmpeg4 is recommended for use with Windows Media Player because it requires with no installation of codec on the Windows client.

framerate number

Maximum number of frames that are saved per second. Valid range: 2-100. Default: 100 (almost no limit). To set intervals longer than one second use the ’minimum_gap’ option instead.

frequency value

The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don’t set it)

gap seconds

The minimum gap between two events in seconds. Default: 60. An event is defined as a series of motion images taken within a short timeframe.

height pixels

The height of each frame. Valid range: Camera dependent, default: 288

input number

Select the input of the video device. Valid range: depends on video capture card, default: 8. Only used for video capture cards (bttv driver).

jpg_cleanup on|off

Remove all jpeg images after making a mpeg movie of them. Default: off

jpeg_filename filepath

File path for motion triggered images (jpeg or ppm) relative to target_dir.
Default value (%v-%Y%m%d%H%M%S-%q) is equivalent to legacy ’oldlayout’ option.
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H/%M/%S-%q. File extension .jpg or .ppm is automatically added so do not include this.
This option uses conversion specifiers which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3).
The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second. Two are unique to motion %v = event, %q = frame number.
With a combination of text and conversion specifiers you have full flexibility to define your directory- and filenames. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’.
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S-%q for ’oldlayout on’ and %Y/%m/%d/%H/%M/%S-%q for ’oldlayout off’. The mpeg_encode feature assumed that the jpegs are stored specific places and with specific names.
If you enable berkeley_single_directory - jpeg_filename must be the default value %v-%Y%m%d%H%M%S-%q.
If you disable berkeley_single_directory - jpeg_filename must be %Y/%m/%d/%H/%M/%S-%q.

lightswitch percent

Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled

locate on|off

Locate and draw a box around the moving object. Default: off

low_cpu framerate

When this option is not zero motion will be in a low cpu mode while not detecting motion. In low cpu mode Motion reduces the framerate to the value given for this option. Value zero means disabled. Default: 0 (disabled).

mail address

Address to send an e-mail to when detecting motion Default: none

mask_file file

PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be binary format. Use gray scale to adjust motion sensitivity from none (black) to full (white). Default: not set.

max_mpeg_time seconds

The maximum length of an mpeg movie. Default: 3600 seconds (one hour). Set this to zero for unlimited length.

mpeg_encode on|off

Use the Berkeley mpeg encoder ’mpeg_encode’ to make movies of the events Default: off

mpeg_encode_bin path

Specify the path to the mpeg_encoder. Default is /usr/local/bin/mpeg_encode

minimum_gap seconds

The minimum time between two shots in seconds while detecting motion. Valid range: 0 to thousands, default: 0 (no minimum)

minimum_motion_frames number

Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range: 1 to thousands, recommended 1-10.

motion_video_pipe devicename|-

The video4linux video loopback input device for motion images. If a particular pipe is to be used then use the device filename of this pipe, if a dash ’-’ is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set

netcam_url URL

Specify an url to a downloadable jpeg file to use as input device. Such as an AXIS 2100 network camera. Default: not set.

netcam_userpass user:pass

For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Default: No authentication

night_compensate on|off

When this option is set the noise threshold will be lowered if the picture is to dark. This will improve the sensitivity in dark places. However it might also increase the number of false alarms since most cameras also compensate for this with their AGC which will increase noise. Default: off

noise_level level

The noise level is used as a threshold for distinguishing between noise and motion. Valid range: 1 to 255, default: 32. This is different from the threshold parameter. noise_level works for changes at pixel level.

noise_tune on|off

With this option enabled the noise_level is ignored, motion will measure the average noise level and calculate the level itself. Default: on

norm 0|1|2|3

Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL). For capture cards only.

onffmpegclose command

Execute ’command’ when an mpeg movie, which is generated by ffmpeg, is closed. Default: not set.

onmpeg command

Execute ’command’ when an mpeg movie is generated. The name of the movie will be given as argument. Default: not set.

onsave command

Execute ’command’ when an image is saved. The name of the image will be given as argument. Default: not set.

output_all on|off

Always save pictures (which depends on output_normal and output_motion) even when no motion is detected.

output_motion on|off

Output pictures with only the moving object. Default: off

output_normal on|off

Output ’normal’ pictures. Default: on

post_capture number

Specifies the number of frames to be captured after motion has been detected. Valid range: 0 to thousands, default=0.

ppm on|off

Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, it is generally slower than jpeg. Default: off

pre_capture number

Specifies the number of previous frames to be outputed at motion detection. Valid range: 0 to thousands, default=0.

predict_description filename.desc

Load prediction description file. This option can be repeated for each additional files that needs to be loaded.

predict_enable on|off

Enable the new experimental prediction feature. Default: off.

predict_filename filepath

File path for prediction files.
Default value (%v-%Y%m%d%H%M%S) is equivalent to legacy ’oldlayout’ option.
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H%M%S.
File extension .desc is automatically added so do not include this.
This option uses conversion specifiers which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3).
The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second. Two are unique to motion %v = event, %q = frame number.
With a combination of text and conversion specifiers you have full flexibility to define your directory- and filenames. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’.
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S for ’oldlayout on’ and %Y/%m/%d/%H%M%S for ’oldlayout off’.

predict_threshold value

Set threshold for reporting motion as predicted on the console. Default: 90

quality value

The quality for the jpeg images. Valid range: 1-100,default: 75

quiet on|off

Be quiet, don’t output beeps when detecting motion. Default: off

rotate degrees

Rotate image this number of degrees. The rotation affects all saved images as0 well as mpeg movies. Valid values: 0 (default = no rotation), 90, 180 and 270

roundrobin_frames number

Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible. Default: 1. Used for capture cards with more than one input. When creating thread config files for the same video device but different channel/frequency motion goes into round robing mode. This means that motion changes the channel/frequency of the capture card and thread each channel as individual and seperate inputs.

roundrobin_skip number

Specifies the number of frames to skip after a switch. (1 of you are feeling lucky, 2 if you want to be safe). Default: 1

sms number

Number to send an SMS to with sms_client. Default: none

snapshot_filename filepath

File path for snapshots (jpeg or ppm) relative to target_dir.
Default value (%v-%Y%m%d%H%M%S-snapshot) is equivalent to legacy ’oldlayout’ option.
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H/%M/%S-snapshot.
File extension .jpg or .ppm is automatically added so do not include this.
A symbolic link called lastsnap.jpg (or lastsnap.ppm) created in the target_dir will always point to the latest snapshot, unless snapshot_filename is exactly ’lastsnap’.
This option uses conversion specifiers which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3).
The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second. Two are unique to motion %v = event, %q = frame number.
With a combination of text and conversion specifiers you have full flexibility to define your directory- and filenames. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’.
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S-snapshot for ’oldlayout on’ and %Y/%m/%d/%H/%M/%S-snapshot for ’oldlayout off’.
For the equivalent of the now obsolete option ’snap_overwrite’ use the value ’lastsnap’.

snapshot_interval seconds

Make automated snapshots every N seconds. Valid range: 0 to thousands, default: 0 (No snapshots)

switchfilter on|off

Turns the switch filter on or off. Default is off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobing_skip to 1 without generating much false detection.

target_dir directory_path

Target directory for pictures. Default: Current working directory. This is the target directory for all snapshots, motion images and normal images.
The default is the current working directory (current working directory of the terminal from which motion was started).
You will normally always want to specify this parameter either as a command line option or in the config file.
Use an absolute directory path (not relative) if you want to use mpeg_encode.
Note that the options snapshot_filename, jpeg_filename, ffmpeg_filename, timelapse_filename and predict_filename all allows specifying directories. These will all be relative to ’target_dir’. This means in principle that you can specify target_dir as ’/’ and be 100% flexible. It also means that Motion can write files all over your harddisk if you make a mistake.
It is recommended to specify the target_dir as deep or detailed as possible for this reason.
The Berkeley mpeg_encode feature still demands that the target_dir points directly to the real target directory.

text_changes on|off

Turns the text showing changed pixels on/off. Default: off By setting this option to ’on’ the number of pixels that changed compared to the reference frame is displayed in the upper right corner of the pictures.

text_left TEXT

User defined text is displayed in the lower left corner of the pictures. If the option is not defined no text is displayed at this position.
The user defined text can be the english alphabet and a selection of symbols: (A-Z, a-z, 0-9, " / ( ) @ ~ # < > | , . : - + _ \n) and conversion specifiers. You can place the text in quotation marks to allow leading spaces. With a combination is spaces and newlines you can position the text anywhere on the picture.
A conversion specifier is a code that starts by % (except newline which is \n). The conversion specifiers used has the same function as for the C function strftime (3).
The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second, %T = HH:MM:SS. Two are unique to motion %v = event, %q = frame number.
With a combination of text, spaces, new lines \n and conversion specifiers you have some very flexible text features. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’.

text_right TEXT

User defined text is displayed in the lower right corner of the pictures. If the option is not defined the default date- and timestamp is displayed at this position. Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
The user defined text can be the english alphabet and a selection of symbols: (A-Z, a-z, 0-9, " / ( ) @ ~ # < > | , . : - + _ \n) and conversion specifiers. You can place the text in quotation marks to allow leading spaces. With a combination is spaces and newlines you can position the text anywhere on the picture.
A conversion specifier is a code that starts by % (except newline which is \n). The conversion specifiers used has the same function as for the C function strftime (3).
The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second, %T = HH:MM:SS. Two are unique to motion %v = event, %q = frame number.
With a combination of text, spaces, new lines \n and conversion specifiers you have some very flexible text features. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’. A major difference from text_left is that if this option is undefined the default is %Y-%m-%d\n%T which displays the date in ISO format YYYY-MM-DD and below the time in 24 hour clock HH:MM:SS.
If you do not want any text specify an empty string "".

thread filename

Thread option. With this a separate config file can be specified to be used for a new separate thread. This is used when you have more than more camera/device.
A single camera can get all its options from the default motion.conf file. If you have two or more cameras all cameras must have their unique information in a separate thread config file.
This must be at least the definition of the device or input number of a capture card. Additionally you can add any other options such as target_dir, height/width etc.
Format of the thread config files is the same as for the motion.conf.
You add one thread statement for each camera in motion.conf.
An option in a thread config file overrides the same option in motion.conf. This means that the options in motion.conf becomes the default value for all the cameras. The thread options must be the last options in the motion.conf file.

threshold value

Threshold for declaring motion. Valid range: 1 to thousands, default: 1500.

threshold_tune on|off

Activates the automatic tuning of threshold level. Default: on

timelapse_filename filepath

File path for timelapse mpegs relative to target_dir (ffmpeg only). Default: %v-%Y%m%d-timelapse Default value is equivalent to legacy ’oldlayout’ option. For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d-timelapse . File extension .mpg is automatically added so do not include this. This option uses conversion specifiers which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: %Y = year, %m = month as two digits, %d = date, %H = hour, %M = minute, %S = second. Two are unique to motion %v = event, %q = frame number. With a combination of text and conversion specifiers you have full flexibility to define your directory- and filenames. For a full list of conversion specifiers see the section ’Conversion Specifiers for Advanced Filename and Text Feature’. If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d-timelapse for ’oldlayout on’ and %Y/%m/%d-timelaps for ’oldlayout off’.

videodevice device_name

The videodevice to be used for capturing. Default: /dev/video0

video_pipe device_name|-

The video4linux video loopback input device for normal images. If a particular pipe is to be used then use the device filename of this pipe, if a dash ’-’ is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set

webcam_limit number

Limits the number of images per connection to the webcam (default: 0 = unlimited). Number can be defined by multiplying actual webcam rate by desired number of seconds. Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate.

webcam_localhost on|off

Limit connections to the webcam server to localhost only.

webcam_maxrate rate

Limit the framerate of the webcam. Default is 100.

webcam_motion on|off

If set to on only send images with motion over the webcam connection, else send frames continuously. Default is off.

webcam_port port_no

TCP port on which motion will listen for incoming connects with its http server. Default is 0 which is disabled. Motion has a mini http server built in. Each thread can have its own webserver. If you enable the webcam server (option webcam_port to a number different from 0) and you have threads you must make sure to include webcam_port to different ports or zero (disable) in each thread config file. Otherwise motion will crash because each webcam server will use the setting from the motion.conf file and try to bind to the same port. The webserver generates a stream in "multipart jpeg" format. To view in webbrowser use the Cambozola Java applet.

webcam_quality level

Quality setting for the jpeg files transferred over this connection (usually very low). Default is 30.

width pixels

The width of each frame. Valid range: Camera dependent, default: 352

Common Options For MySQL and PostgreSQL database features.

If you compiled motion with MySQL or PostgreSQL support you will need to set the following options if you want motion to log events to the database. Options require the MySQL/PostgreSQL options to be active also.
sql_log_image on|off

Log to the database when creating motion triggered image file (default: on).

sql_log_snapshot on|off

Log to the database when creating a snapshot image file (default: on).

sql_log_mpeg on|off

Log to the database when creating motion triggered mpeg file (default: off).

sql_log_timelapse on|off

Log to the database when creating timelapse mpeg file (default: off).

sql_log_prediction on|off

Log to the database when creating a prediction file (default: off).

MySQL CONFIG FILE OPTIONS

If you compiled motion with MySQL support you will need to set the following options if you want motion to log events to the database. Database must contain a table security with the following fields: filename char(60) not null, minute int, hour int, day int, month int, year int, type int.
mysql_db data_base

Name of the MySQL database

mysql_host host

IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server.

mysql_user user_name

The MySQL user name.

mysql_password

The MySQL password.

PostgreSQL CONFIG FILE OPTIONS

If you compiled motion with PostgreSQL support you will need to set the following options if you want motion to log events to the database. Database must contain a table security with the following fields: filename char(60) not null, minute int, hour int, day int, month int, year int, type int.
pgsql_db database

Name of the PostgresSQL database

pgsql_host host

IP address or domain name for the PostgresSQL server. Use "localhost" if motion and PostgresSQL runs on the same server.

pgsql_user user_name

The PostgresSQL user name

pgsql_password password

The PostgresSQL password

pgsql_port port

The PostgresSQL server port number. Default is 5432

TRACKING CONFIG FILE OPTIONS

Motion has special tracking options which use either a serial stepper motor controller, an iomojo smile cam or a Philips WebCam driver compatible pan/tilt camera such as the Logitech Quickcam Sphere or Orbit. For this motion has the following options:
track_type type

Type of tracker (0=none, 1=stepper, 2=iomojo, 3=pwc), default 0 Motion has special tracking options which use either a serial stepper motor controller, an iomojo smile cam or a Philips WebCam driver compatible pan/tilt camera such as the Logitech Quickcam Sphere or Orbit. Normally this is set to 0 and the other track options are ignored. Value 1 is for the special Motion Tracking Project using a stepper motor and a home made controller. Value 2 is for the iomojo smilecam Value 3 is for the a camera such a the Logitech Quickcam Sphere/Orbit which is driven by the pwc (Philips WebCam) driver. To use this camera your version of pwc must be at least 8.12.

track_port port

This is the serial port to which the stepper motor interface is connected (only used for stepper motor).

track_motorx number

The motor number that is used for controlling the x-axis (only used for stepper motor).

track_maxx position

The maximum possition for servo x (only used for stepper motor).

track_iomojo_id number

Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller. Default: -1 (Use the stepper motor interface)

track_speed number

Speed to set the tracking stepper motor to

track_stepsize steps

The maximum number of steps to make (only used for stepper motor).

SIGNALS

Motion responds to the following signals:
SIGALRM

Motion will generate a snapshot.

SIGHUP

The config file will be reread.

SIGTERM

If needed motion will create an mpeg file of the last event and exit

SIGUSR1

Motion will create an mpeg file of the current event.

SEE ALSO

mpeg_encode(1), mail(1), sms_client(1)

NOTES

Snapshot

A snapshot is a picture taken at regular intervals independently of any movement in the picture.

Motion image

A "motion" image or "realmotion image" shows the pixels that have actually changed during the last frames. These pictures are not very useful for normal presentation to the public but they are quite useful for testing and tuning and making mask files as you can see exactly where motion sees something moving.

Normal image

A normal image is the entire image taken by the camera.

Threads and config files

Motion generates a thread for each camera plus two extra control threads. All options for the first camera must be in the motion.conf file. For each extra camera you make a thread config file which contains all the unique options for this camera. The option that are found in a thread file overrules the same parameter defined in the motion.conf file. Motion reads its configuration in the following sequence. If the same parameter exists more than one place the last one read wins. 1. Motion reads the configuration file motion.conf from the beginning of the file going down line by line. 2. If the option "thread" is defined in motion.conf, the thread configuration file(s) is/(are) read. 3. Motion continues reading the rest of the motion.conf file. Any options from here will overrule the same option previously defines in a thread config file. 4. Motion read the command line option again overruling any previously defined options.

Conversion Specifiers for Advanced Filename and Text Features

The list below shows all the supported Conversion Specifiers you can use in the options text_left, text_right, snapshot_filename, jpeg_filename, ffmpeg_filename, timelapse_filename and predict_filename. In text_left and text_right you can additionally use ’\n’ for new line. Conversion Specifier - Description

%a

The abbreviated weekday name according to the current locale.

%A

The full weekday name according to the current locale.

%b

The abbreviated month name according to the current locale.

%B

The full month name according to the current locale.

%c

The preferred date and time representation for the current locale.

%d

The day of the month as a decimal number (range 01 to 31).

%D

Equivalent to %m/%d/%y. (Yecch - for Americans only. Americans should note that in other countries %d/%m/%y is rather common. This means that in international context this format is ambiguous and should not be used.)

%E

Modifier: use alternative format, see below.

%F

Equivalent to %Y-%m-%d (the ISO 8601 date format).

%H

The hour as a decimal number using a 24-hour clock (range 00 to 23).

%I

The hour as a decimal number using a 12-hour clock (range 01 to 12).

%j

The day of the year as a decimal number (range 001 to 366).

%k

The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.)

%l

The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.)

%m

The month as a decimal number (range 01 to 12).

%M

The minute as a decimal number (range 00 to 59).

%p

Either ’AM’ or ’PM’ according to the given time value, or the corresponding strings for the current locale. Noon is treated as ‘pm’ and midnight as ‘am’.

%P

Like %p but in lowercase: ‘am’ or ‘pm’ or a corresponding string for the current locale.

%q

Picture frame number within current second. For jpeg filenames this should always be included in the filename if you save more then 1 picture per second to ensure unique filenames. It is not needed in filenames for mpegs.

%r

The time in a.m. or p.m. notation.

%R

The time in 24-hour notation (%H:%M).

%s

The number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC.

%S

The second as a decimal number (range 00 to 61).

%T

The time in 24-hour notation (%H:%M:%S).

%u

The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w.

%U

The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W.

%v

Event number. An event is a series of motion detections happening with less than ’gap’ seconds between them.

%V

The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also %U and %W.

%w

The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u.

%W

The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.

%x

The preferred date representation for the current locale without the time.

%X

The preferred time representation for the current locale without the date.

%y

The year as a decimal number without a century (range 00 to 99).

%Y

The year as a decimal number including the century.

%z

The time-zone as hour offset from GMT.

%Z

The time zone or name or abbreviation.

More information

Motion homepage: http://motion.sourceforge.net/ Motion Guide (user and installation guide): http://www.lavrsen.dk/sources/webcam/motion_guide.htm

AUTHORS

Jeroen Vreeken (pe1rxq [AT] amsat.org), Folkert van Heusden, Kenneth Lavrsen (kenneth [AT] lavrsen.dk)

COMMENTS

blog comments powered by Disqus