Motion - Motion Guide Getting It Running

Motion Guide - Getting It Running

This topic consists of the following subtopics: RunningMotionConfigFiles, CommandLineOptions, ConfigFileOptions, SignalsKill, ErrorLogging.

Running Motion

Important Definitions

Motion is invoked from the command line. It has no GUI. Everything is controlled from config files. From version 3.2 the command line is only used to define location of config file and a few special runtime modes (setup and non-daemon).

A few important definitions.
  • A snapshot is a picture taken at regular intervals independently of any movement in the picture.
  • A "motion" image/mpeg 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. Motion is shown in greytones. If labelling is enabled the largest area is marked as blue. Smart mask is shown in red.
  • A "normal" image is the real image taken by the camera with text overlayed.

The Config Files

If Motion was invoked with command line option -c pathname Motion will expect the config file to be as specified. When you specify the config file on the command line with -c you can call it anything.

If you do not specify -c or the filename you give Motion does not exist, Motion will search for the configuration file called 'motion.conf' in the following order:

  1. Current directory from where motion was invoked
  2. Then in a directory called '.motion' in the current users home directory (shell environment variable $HOME). E.g. /home/goofy/.motion/motion.conf
  3. The directory defined by the --sysconfdir=DIR when running .configure during installation of Motion
    (If this option was not defined the default is /usr/local/etc/)
If you have write access to /usr/local/etc then the editor recommends having only one motion.conf file in the default /usr/local/etc/ directory.

Motion has a configuration file in the distribution package called motion-dist.conf. When you run 'make install' this file gets copied to the /usr/local/etc directory.

The configuration file needs to be renamed from motion-dist.conf to motion.conf. The original file is called motion-dist.conf so that your perfectly working motion.conf file does not accidentally get overwritten when you re-install or upgrade to a newer version of Motion.

If you have more than one camera you should not try and invoke Motion more times. Motion is made to work with more than one camera in a very elegant way and the way to do it is to create a number of thread config files. Motion will then create an extra thread of itself for each camera. If you only have one camera you only need the motion.conf file. The minute you have two or more cameras you must have one thread config file per camera besides the motion.conf file.

So if you have for example two cameras you need motion.conf and two thread config files. Total of 3 config files.

An option that is common to all cameras can be placed in motion.conf. (You can also put all parameters in the thread files but that makes a lot of editing when you change a common thing).

An option that is unique to a camera must be defined in each thread file.

It is often seen that people copy the entire motion.conf into the thread config files and change a few options. This works but it not recommended because it is more difficult to maintain and overview. Keep all the common options in motion.conf and the few unique only in the thread config files

The first camera is defined in the first thread file called from motion.conf. The 2nd camera is defined in the 2nd thread file called from motion.conf etc.

Any option defined in motion.conf will be used for all cameras except for the cameras in which the same option is defined in a thread config file.

To make it clear, the thread files format and syntax is the same as motion.conf. An example of what you might want in a thread file as follows: assume you have two cameras, attached to one system. Create files thread0.conf and thread1.conf. At the end of motion.conf, uncomment out the lines that refer to them. The full contents of the thread files can be as simple as

thread0.conf:
videodevice /dev/video0
stream_port 8081

thread1.conf:
videodevice /dev/video1
stream_port 8082

Motion reads its configuration parameters 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 reads the command line option again overruling any previously defined options.
So always call the thread config files in the end of the motion.conf file. If you define options in motion.conf AFTER the thread file calls, the same options in the thread files will never be used. So always put the thread file call at the end of motion.conf.

Nearly all config options can be unique for a specific camera and placed in a thread config file. There are a few options that must be in motion.conf and cannot be in a thread config file: control_authentication, control_html_output, control_localhost, control_port, daemon, and thread.

If motion is built without specific features such as ffmpeg, mysql etc it will ignore the options that belongs to these features. You do not have to remove them or comment them out.

If you run the http control command http://host:port/0/config/writeyes, motion will overwrite motion.conf and all the thread.conf files by autogenerated config files neatly formatted and only with the features included that Motion was built with. If you later re-build Motion with more features or upgrade to a new version, you can use your old config files, run the motion.conf.write command, and you will have new config files with the new options included all set to their default values. This makes upgrading very easy to do.

Command Line Options

ALERT! In Motion 3.2.1 and forward most command line options have been removed and replaced them by an option to specify location to motion.conf and a few options related to setting up motion. There are now only few command line options left and they are basically all new.

SYNOPSIS
motion [ -hns ] [ -c config file path ] [ -d level ]  [ -p process_id_file ]

Option Description Editors comment
-n Run in non-daemon mode. Instead of running Motion in the background Motion runs in the terminal window writing messages when things happen. If you have problems getting Motion to start or work, run Motion in this mode to get more messages that can help you solve the problem.
-s Run in setup mode. Also forces non-daemon mode
-c config file path Full path and filename of config file. E.g. /home/kurt/motion.conf. Default is /usr/local/etc unless specified differently when building Motion. Many RPMs and debian packages will most likely use /etc or /etc/motion as default
-h Show help screen.  
-d level Debugging mode This mode is used for developers to enable debug messages. Normal users will not need to use this mode unless a developer request to get additional information in the attempt to resolve a bug. Mainly the netcam code has debugging features. The level defines how much debugging info you get. A high number displays all debugging.
-p process_id_file Full path of process ID file Full path and filename of process id file (PID file). This is optional. If none is given as command line option or in motion.conf (process_id_file) Motion will not create a PID file.

Config File Options

These are the options that can be used in the config file.

All number values are integer numbers (no decimals allowed). Boolean options can be on or off.

Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL and FFMPEG).

Database options have changed at least for trunkREV557 (I have listed here what I have found in the conf.c file, look in that file yourself if you need to find a config option)
  • database_type (mysql,postgresql,sqlite3), database_dbname, database_host, database_user, database_password, database_port
  • I have also found a difference in the sql_query config option. The "text_event" field has been renamed to event_time_stamp. You should make this a varchar if you aren't going to record a real timestamp in it. -- RkaneKnight - 28 Mar 2013
MySQL
  • mysql_db, mysql_host, mysql_user, mysql_password

PostgreSQL
  • pgsql_db, pgsql_host, pgsql_user, pgsql_password, pgsql_port

FFMPEG (libavcodec)
  • ffmpeg_cap_new, ffmpeg_cap_motion, ffmpeg_filename, ffmpeg_timelapse, ffmpeg_timelapse_mode, ffmpeg_bps, ffmpeg_variable_bitrate, ffmpeg_video_codec

EDIT:

Lots of config options have changed! In the latest source, most of the below ffmpeg options don't work, along with a few other options. By default a source install will put a config file with correct options in /usr/local/etc/motion-dist.conf. You can also try looking in motion-dist.conf.in in the source directory. The config options listed below will still work for older versions of motion, such as the debian package, but will not work with the latest source.

Linked below is a motion config file which works with the current motion source as of 23 Apr 2014.

motion-dist.conf

-- DavidWales - 23 Apr 2014

Options in Alphabetical Order.

The table below lists all the Motion options in alphabetical order. Click on the option name to see a longer description of each.

Option Range/Values
Default
Description
area_detect Values: 1 - 999999999
Default: Not defined
Detect motion center in predefined areas. A script (on_area_detected) is started immediately when motion center is detected in one of the given areas, but only once during an event even if there is motion in a different configured area.
auto_brightness Values: on, off
Default: off
Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness
brightness Values: 0 - 255
Default: 0 (disabled)
The brightness level for the video device.
contrast Values: 0 - 255
Default: 0 (disabled)
The contrast level for the video device.
control_authentication Values: Max 4096 characters
Default: Not defined
To protect HTTP Control by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. This option must be placed in motion.conf and not in a thread config file.
control_html_output Values: on, off
Default: on
Enable HTML in the answer sent back to a browser connecting to the control_port. This option must be placed in motion.conf and not in a thread config file.
control_localhost Values: on, off
Default: on
Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file.
control_port Values: 0 - 65535
Default: 0 (disabled)
Sets the port number for the http (html using browser) based remote control. This option must be placed in motion.conf and not in a thread config file.
daemon Values: on, off
Default: off
Start in daemon (background) mode and release terminal. This option must be placed in motion.conf and not in a thread config file.
despeckle Values: EedDl
Default: Not defined
Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling.
ffmpeg_bps Values: 0 - 9999999
Default: 400000
Bitrate of mpegs produced by ffmpeg. Bitrate is bits per second. Default: 400000 (400kbps). Higher value mans better quality and larger files. Option requires that ffmpeg libraries are installed.
ffmpeg_cap_motion Values: on, off
Default: off
Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes.
ffmpeg_cap_new Values: on, off
Default: off
Use ffmpeg libraries to encode mpeg movies in realtime.
ffmpeg_deinterlace Values: on, off
Default: off
Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures.
ffmpeg_filename (now called movie_filename) Values: Max 4095 characters
Default: %v-%Y%m%d%H%M%S
File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This option was renamed to movie_filename in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution.
ffmpeg_timelapse Values: 0 - 2147483647
Default: 0 (disabled)
Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used.
ffmpeg_timelapse_mode Values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual
Default: daily
The file rollover mode of the timelapse video.
ffmpeg_variable_bitrate Values: 0, 2 - 31
Default: 0 (disabled)
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 Values: mpeg1 (ffmpeg-0.4.8 only), mpeg4, msmpeg4, swf, flv, ffv1, mov
Default: mpeg4
Codec to be used by ffmpeg for the video compression. Timelapse mpegs are always made in mpeg1 format independent from this option.
framerate Values: 2 - 100
Default: 100 (no limit)
Maximum number of frames to be captured from the camera per second.
frequency Values: 0 - 999999
Default: 0 (Not set)
The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it)
gap Values: 0 - 2147483647
Default: 60
Gap is the seconds of no motion detection that triggers the end of an event. An event is defined as a series of motion images taken within a short timeframe.
height Values: Device Dependent
Default: 288
The height of each frame in pixels.
hue Values: 0 - 255
Default: 0 (disabled)
The hue level for the video device.
input Values: 0 - 7, 8 = disabled
Default: 8 (disabled)
Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras.
jpeg_filename Values: Max 4095 characters
Default: %v-%Y%m%d%H%M%S-%q
File path for motion triggered images (jpeg or ppm) relative to target_dir. Value 'preview' makes a jpeg filename with the same name body as the associated saved mpeg movie file.
lightswitch Values: 0 - 100
Default: 0 (disabled)
Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity.
locate Values: on, off, preview
Default: off
Locate and draw a box around the moving object. Value 'preview' makes Motion only draw a box on a saved preview jpeg image and not on the saved mpeg movie.
mask_file Values: Max 4095 characters
Default: Not defined
PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format.
max_mpeg_time Values: 0 (infinite) - 2147483647
Default: 3600
The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.
minimum_frame_time Values: 0 - 2147483647
Default: 0
Minimum time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate.
minimum_motion_frames Values: 1 - 1000s
Default: 1
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 is 1 to thousands, but it is recommended to keep it within 1-5.
motion_video_pipe Values: Max 4095 characters
Default: Not defined
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
movie_filename Values: Max 4095 characters
Default: %v-%Y%m%d%H%M%S
File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename.
mysql_db Values: Max 4095 characters
Default: Not defined
Name of the MySQL database.
mysql_host Values: Max 4095 characters
Default: localhost
IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server.
mysql_password Values: Max 4095 characters
Default: Not defined
The MySQL password.
mysql_user Values: Max 4095 characters
Default: Not defined
The MySQL user name.
netcam_http Values: 1.0, keep_alive, 1.1
Default: 1.0
The setting for keep-alive of network socket, should improve performance on compatible net cameras. ( new in 3.2.10 )
netcam_proxy Values: Max 4095 characters
Default: Not defined
URL to use for a netcam proxy server, if required. The syntax is http://myproxy:portnumber
netcam_tolerant_check Values: on, off
Default: off
Set less strict jpeg checks for network cameras with a poor/buggy firmware.
netcam_url Values: Max 4095 characters
Default: Not defined
Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera.
netcam_userpass Values: Max 4095 characters
Default: Not defined
For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication.
noise_level Values: 1 - 255
Default: 32
The noise level is used as a threshold for distinguishing between noise and motion.
noise_tune Values: on, off
Default: on
Activates the automatic tuning of noise level.
norm Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)
Default: 0 (PAL)
Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
on_area_detected Values: Max 4095 characters
Default: Not defined
Command to be executed when motion in a predefined area is detected. Check option area_detect.
on_camera_lost Values: Max 4095 characters
Default: Not defined
Command to be executed when a camera can't be opened or if it is lost. You can use Conversion Specifiers and spaces as part of the command. Use %f for passing filename (with full path) to the command. (new in 3.2.10)
on_event_end Values: Max 4095 characters
Default: Not defined
Command to be executed when an event ends after a period of no motion. The period of no motion is defined by option gap. You can use Conversion Specifiers and spaces as part of the command.
on_event_start Values: Max 4095 characters
Default: Not defined
Command to be executed when an event starts. An event starts at first motion detected after a period of no motion defined by gap. You can use ConversionSpecifiers and spaces as part of the command.
on_motion_detected Values: Max 4095 characters
Default: Not defined
Command to be executed when a motion frame is detected. You can use Conversion Specifiers and spaces as part of the command.
on_movie_end Values: Max 4095 characters
Default: Not defined
Command to be executed when an ffmpeg movie is closed at the end of an event. You can use Conversion Specifiers and spaces as part of the command. Use %f for passing filename (with full path) to the command.
on_movie_start Values: Max 4095 characters
Default: Not defined
Command to be executed when an mpeg movie is created. You can use Conversion Specifiers and spaces as part of the command. Use %f for passing filename (with full path) to the command.
on_picture_save Values: Max 4095 characters
Default: Not defined
Command to be executed when an image is saved. You can use Conversion Specifiers and spaces as part of the command. Use %f for passing filename (with full path) to the command.
output_all Values: on, off
Default: off
Picture are saved continuously as if motion was detected all the time.
output_motion Values: on, off
Default: off
Output pictures with only the moving object. This feature generates the special motion type movies where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red.
output_normal Values: on, off, first, best, center (since 3.2.10)
Default: on
Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. I.e. not a motion image like defined by output_motion. Default is that normal images are stored.
pgsql_db Values: Max 4095 characters
Default: Not defined
Name of the PostgreSQL database.
pgsql_host Values: Max 4095 characters
Default: localhost
IP address or domain name for the PostgreSQL server. Use "localhost" if motion and PostgreSQL runs on the same server.
pgsql_password Values: Max 4095 characters
Default: Not defined
The PostgreSQL password.
pgsql_port Values: 0 - 65535
Default: 5432
The PostgreSQL server port number.
pgsql_user Values: Max 4095 characters
Default: Not defined
The PostgreSQL user name.
post_capture Values: 0 - 2147483647
Default: 0 (disabled)
Specifies the number of frames to be captured after motion has been detected.
ppm Values: on, off
Default: off
Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, and it is generally slower than jpeg.
pre_capture Values: 0 - 100s
Default: 0 (disabled)
Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.
process_id_file Values: Max 4095 characters
Default: Not defined
File to store the process ID, also called pid file. Recommended value when used: /var/run/motion.pid
quality Values: 1 - 100
Default: 75
The quality for the jpeg images in percent.
quiet Values: on, off
Default: off
Be quiet, don't output beeps when detecting motion.
rotate Values: 0, 90, 180, 270
Default: 0 (not rotated)
Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies.
roundrobin_frames Values: 1 - 2147483647
Default: 1
Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible.
roundrobin_skip Values: 1 - 2147483647
Default: 1
Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe).
saturation Values: 0 - 255
Default: 0 (disabled)
The colour saturation level for the video device.
setup_mode Values: on, off
Default: off
Run Motion in setup mode.
smart_mask_speed Values: 0 - 10
Default: 0 (disabled)
Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast.
snapshot_filename Values: Max 4095 characters
Default: %v-%Y%m%d%H%M%S-snapshot
File path for snapshots (jpeg or ppm) relative to target_dir.
snapshot_interval Values: 0 - 2147483647
Default: 0 (disabled)
Make automated snapshots every 'snapshot_interval' seconds.
sql_log_image Values: on, off
Default: on
Log to the database when creating motion triggered image file.
sql_log_mpeg Values: on, off
Default: off
Log to the database when creating motion triggered mpeg file.
sql_log_snapshot Values: on, off
Default: on
Log to the database when creating a snapshot image file.
sql_log_timelapse Values: on, off
Default: off
Log to the database when creating timelapse mpeg file
sql_query Values: Max 4095 characters
Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
SQL query string that is sent to the database. The values for each field are given by using convertion specifiers
switchfilter Values: on, off
Default: off
Turns the switch filter on or off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobin_skip to 1 without generating much false detection.
target_dir Values: Max 4095 characters
Default: Not defined = current working directory
Target directory for picture and movie files.
text_changes Values: on, off
Default: off
Turns the text showing changed pixels on/off.
text_double Values: on, off
Default: off
Draw characters at twice normal size on images.
text_event Values: Max 4095 characters
Default: %Y%m%d%H%M%S
This option defines the value of the speciel event conversion specifier %C. You can use any conversion specifier in this option except %C. Date and time values are from the timestamp of the first image in the current event.
text_left Values: Max 4095 characters
Default: Not defined
User defined text overlayed on each in the lower left corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and vertical bar and conversion specifiers (codes starting by a %).
text_right Values: Max 4095 characters
Default: %Y-%m-%d\n%T
User defined text overlayed on each in the lower right corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and vertical bar and conversion specifiers (codes starting by a %). Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
thread Values: Max 4095 characters
Default: Not defined
Specifies full path and filename for a thread config file. Each camera needs a thread config file containing the options that are unique to the camera. If you only have one camera you do not need thread config files. If you have two or more cameras you need one thread config file for each camera in addition to motion.conf. This option must be placed in motion.conf and not in a thread config file.
threshold Values: 1 - 2147483647
Default: 1500
Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling.
threshold_tune Values: on, off
Default: off
Activates the automatic tuning of threshold level. ( It's broken )
timelapse_filename Values: Max 4095 characters
Default: %v-%Y%m%d-timelapse
File path for timelapse mpegs relative to target_dir (ffmpeg only).
track_auto Values: on, off
Default: off
Enable auto tracking
track_iomojo_id Values: 0 - 65535
Default: 0
Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller.
track_maxx Values: 0 - 65535
Default: 0
The maximum position for servo x.
track_maxy Values: 0 - 65535
Default: 0
The maximum position for servo y.
track_motorx Values: 0 - 65535
Default: 0
The motor number that is used for controlling the x-axis.
track_motory Values: 0 - 65535
Default: 0
The motor number that is used for controlling the y-axis.
track_move_wait Values: 0 - 65535
Default: 10
Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames.
track_port Values: Max 4095 characters
Default: Not defined
This is the device name of the serial port to which the stepper motor interface is connected.
track_speed Values: 0 - 255
Default: 255
Speed to set the motor to.
track_step_angle_x Values: 0-90
Default: 10
Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras.
track_step_angle_y Values: 0-40
Default: 10
Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras.
track_stepsize Values: 0 - 255
Default: 40
Number of steps to make.
track_type Values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)
Default: 0 (None)
Type of tracker.
tunerdevice Values: Max 4095 characters
Default: /dev/tuner0
The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for FreeBSD.
v4l2_palette Values: 0 - 8
Default: 8
Allow to choose preferable palette to be use by motion
to capture from those supported by your videodevice. ( new in 3.2.10 )
video_pipe Values: Max 4095 characters
Default: Not defined
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.
videodevice Values: Max 4095 characters
Default: /dev/video0 (FreeBSD: /dev/bktr0)
The video device to be used for capturing. Default for Linux is /dev/video0. for FreeBSD the default is /dev/bktr0.
webcam_limit Values: 0 - 2147483647
Default: 0 (unlimited)
Limit the number of frames to number frames. After 'webcam_limit' number of frames the connection will be closed by motion. The value 0 means unlimited.
webcam_localhost Values: on, off
Default: on
Limits the access to the webcam to the localhost.
webcam_maxrate Values: 1 - 100
Default: 1
Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited.
webcam_motion Values: on, off
Default: off
If set to 'on' Motion sends slows down the webcam stream to 1 picture per second when no motion is detected. When motion is detected the stream runs as defined by webcam_maxrate. When 'off' the webcam stream always runs as defined by webcam_maxrate.
webcam_port Values: 0 - 65535
Default: 0 (disabled)
TCP port on which motion will listen for incoming connects with its webcam server.
webcam_quality Values: 1 - 100
Default: 50
Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth.
width Values: Device Dependent
Default: 352
The width in pixels of each frame. Valid range is camera dependent.

Obsolete Options

Option Range/Values
Default
Description
low_cpu Values: 0 - 100
Default: 0 (disabled)
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. ( DEPRECATED )
minimum_gap Values: 0 - 2147483647
Default: 0 (no minimum)
The minimum time between two shots in seconds. ( DEPRECATED )
night_compensate Values: on, off
Default: off
When this option is set the noise threshold will be lowered if the picture is dark. This will improve the sensitivity in dark places. However it might also increase the number of false alarms since most cameras also increase light sensitivity with their AGC (Automatic Gain Control) and this will increase noise. ( DEPRECATED )

Signals (sent with e.g. kill command)

A signal can be sent from the command line by typing e.g. kill -s SIGHUP pid, where the last parameter is the process ID which you get by typing ps -ef ¦ grep motion. The PID is the first on the list which is the parent process for the threads. Motion responds to the following signals:

Signal Description Editors comment
SIGHUP The config file will be reread. This is a very useful signal when you experiment with settings in the config file.
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.  

Error Logging

Motion reports errors to the console when it runs in non-daemon mode. And it outputs even more information when run in setup mode.

Error logging has been implemented so that errors during daemon (background) mode are logged in the syslog.

The syslog is in most Linux systems the file /var/log/messages (e.g. RedHat/Fedora) or /var/log/syslog and /var/log/user.log (e.g. Debian).

-- KennethLavrsen - 13 Apr 2005
Topic revision: r2 - 13 Apr 2005, KennethLavrsen
Copyright © 1999-2016 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.