Motion - Motion Guide Alphabetical Option Reference Manual

Motion Guide - Alphabetical Option Reference Manual

Note that this Motion Guide is no longer maintained on this site. Motion is now maintained by Mr. Dave and located on Github. The Motion Guide for all newer versions can be found at https://motion-project.github.io/motion_guide.html

The list below relates to Motion versions 3.2.12 and earlier and is kept online for reference as long as there is demand for it

area_detect

  • Type: $formfieldType)
  • Range / Valid values: 1 - 999999999
  • Default: Not defined
  • Group: Motion Detection

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. Take care: This option does NOT restrict detection to these areas!, 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. Take care: This option does NOT restrict detection to these areas!

Areas are numbered like that:

      1    2    3
      4    5    6
      7    8    9

One or more areas can be specified with this option.

Example: You want to monitor if the center of motion occurrs in the lower third of the image - that is area 7, 8 and 9. Simply set 'area_detect' to '789' and 'on_area_detect' will be executed as soon as the center of motion was detected in area 7, 8 or 9. If you want to monitor area 2, 3, 5 and 6, set '2356'.

auto_brightness

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Video Devices

Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness, Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness

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

The auto_brightness feature will adjust the brightness of the device up or down until the value defined by the option brightness is reached (1 = dark, 255 = bright). If brightness is zero auto_brightness will try to adjust to the average brightness level 128.

You need to know if the camera supports auto brightness. Most cameras have auto everything. If your video device already does this for you this option might cause oscillations. If you do not know assume that it has and do not use the Motion auto brightness feature. At least not to start with.

brightness

  • Type: $formfieldType)
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Group: Video Devices

The brightness level for the video device., The brightness level for the video device.

Value 0 means that Motion does not set the brightness value but leaves it unchanged.

If this setting is used in conjunction with the auto_brightness feature, then this setting is the average brightness level in the range 1 (dark) to 255 (bright) that the auto_brightness feature will try to achieve by adjusting the device brightness up and down.

contrast

  • Type: $formfieldType)
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Group: Video Devices

The contrast level for the video device. Disabled (Value 0) means that Motion does not set the contrast value., The contrast level for the video device. Disabled (Value 0) means that Motion does not set the contrast value.

control_authentication

  • Type: $formfieldType)
  • Range / Valid values: Max 4096 characters
  • Default: Not defined
  • Group: Obsolete

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.

This option has been replaced by webcontrol_authentication

By setting this to on, the control using http (browser) can only be accessed using login and password ( following the Basic Authentication defined in HTTP RFC )

control_html_output

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Obsolete

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.
Note: This option has been renamed to webcontrol_html_output.

The recommended value for most is "on" which means that you can navigate and control Motion with a normal browser. By setting this option to "off" the replies are in plain text which may be easier to parse for 3rd party programs that control Motion.

control_localhost

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Obsolete

Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file.

This option has been replaced by webcontrol_localhost

By setting this to on, the control using http (browser) can only be accessed on the same machine on which Motion is running.

control_port

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0 (disabled)
  • Group: Obsolete

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.

This option has been replaced by webcontrol_port

This sets the TCP/IP port number to be used for control of motion using http (browser). Port numbers below 1024 normally requires that you have root privileges. Port 8080 is a fine choice of port to use for the purpose.

daemon

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: System Processing

Start in daemon (background) mode and release terminal. This option must be placed in motion.conf and not in a thread config file., Start in daemon (background) mode and release terminal. This option must be placed in motion.conf and not in a thread config file.

Daemon mode is what you typically will use once you are done experimenting and have motion run permanently in the background on a server.

Wonder about the word and its spelling. Look here!

database_busy_timeout

  • Type: $formfieldType)
  • Range / Valid values: 0 .. positive integer
  • Default: 0
  • Group: Database

Database wait time in milliseconds for locked database to be unlocked before returning database locked error (default 0). If the database is busy when the request is issued, this parameter indicates the time to wait before issuing a timeout message, Database wait time in milliseconds for locked database to be unlocked before returning database locked error (default 0). If the database is busy when the request is issued, this parameter indicates the time to wait before issuing a timeout message

database_dbname

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Database

The name of the database. For Sqlite3, the full path and name to the database, The name of the database. For Sqlite3, the full path and name to the database

database_host

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: localhost
  • Group: Database

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

database_password

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Database

The user password for the database, The user password for the database

database_port

  • Type: $formfieldType)
  • Range / Valid values: 1-65535
  • Default: Not defined
  • Group: Database

The port number that is used for the database. Typical values are: mysql=3306 and postgresql=5432 , The port number that is used for the database. Typical values are: mysql=3306 and postgresql=5432

database_type

  • Type: $formfieldType)
  • Range / Valid values: mysql, postgresql, sqlite3
  • Default: Not defined
  • Group: Database

Type of database used. Leave it undefined if you are not using databases, Type of database used. Leave it undefined if you are not using databases

Motion can be compiled with MySQL, PostgreSQL or SQLite3 database support. When enabled Motion can be configured to add a record to a table in the database as specified by the sql_query. The query can contain the fields that are used and the value are given by using conversion specifiers for dynamic data like filename, time, number of detected pixels etc. Motion does not place any binary images in the database and it cannot remove old records.

Motion only adds records to the database when files are created. The database contains records of saved files which means to get a record in the database the feature that enables for example motion detection, timelapse, snapshots etc must be enabled. The sql_log options defines which types of files are logged in the database.

database_user

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Database

User account name for database, User account name for database

despeckle

  • Type: $formfieldType)
  • Range / Valid values: EedDl
  • Default: Not defined
  • Group: Image Processing

Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling., Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling.

A way of tuning (by removing or enhancing) noise in the motion image. Options for the despeckle feature are any of 'e', 'E', 'd' or 'D'. This can be combined by a trailing 'l' (letter l) which enables the labeling feature. Default: Not Defined (Don't despeckle and label).

Wind blowing grass and trees around or poor light conditions can cause a lot of dots (or noise) to appear in the motion image (See the section on Tuning Motion). This feature removes (or enhances!) this noise and so improves the reliability of motion.

The 'e' option removes diamonds, 'E' removes squares and alternating eE will remove circles. Each e/E you add will shrink the noise by a pixel all the way around. So 'despeckle Ee' will remove circles of radius 2. However, this will also shrink the detection by 2 and will affect the threshold. So to remove noise and then restore the detected motion to its original size try 'despeckle EedD'.

After the despeckle feature is done you can let the labeling feature search for areas of connected pixels and "label" each area. The program will now trigger motion based on the number of changed pixels in the largest area. In other words, the largest labeled area has to be above the threshold to trigger a motion detected.

The value EedDl is a good starting point. The possible combinations are endless and it requires many experiments to find the best combination. Just remember that the labeling feature only works as intended if it runs after the despeckle feature. Ie. the letter 'l' must be the last letter and only one 'l'.

If you have very few problems with false detections leave this option either blank or at EedD which will remove most of the single pixel noise. A very detailed technical explanation of the despeckle part can be found at the webpage of the author of this feature Ian McConnell's Webcam: Motion Web Page

emulate_motion

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Motion Detection

Always save images even if there was no motion., Always save images even if there was no motion.

This feature is not meant to be the normal mode of operation. Especially not if you have any of the picture or movie features enabled since it will keep on saving pictures on the disk and you will soon run out of disk space. So be careful with this command.

If your frame rate is 10 pictures per second motion will save 10 new picture pr second until the disk is full.

It does all the normal actions that are done when motion is detected. It saves pictures on the harddisk, execute external scripts, etc as fast as the frame rate of the camera. So it is probably a good idea to run with a low framerate when using this feature and to not use activate all the features that saves files on the disk.

The idea of this feature is that you can turn the feature on and off for a short period of time to test or to generate continuous movie films when needed.

event_gap

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 60
  • Group: Motion Detection

event_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 time-frame., event_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 time-frame.

Recommended value is 60 seconds (Default). The value 0 is allowed (but not recommended) and disables events causing all Motion to be written to one single movie file and no pre_capture. You can force an event to end and a new to begin using the http control 'http://host:port/thread_number/action/makemovie'. Disabling events has bad side effects on noise_tune and smartmask. Both features can only work properly outside an event. When event_gap is set to 0, both features don't work properly anymore.

An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. This option defines how long a pause between detected motions that is needed to be defined as a new event.

The event_gap timer starts after the last motion is detected and post_capture images have been saved and appended to open movie mpeg files.

Any motion detected before the event_gap timer times out resets the event_gap timer so it starts counting over again.

Detailed Description

The option 'event_gap' is important. It defines how long a period of no motion detected it takes before we say an event is over. An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. Motion detected includes post_captured frames set by the 'post_capture' option. The 'event_gap' option defines how long a pause between detected motions that is needed to be defined as a new event. A good starting value is 60 seconds.

The way 'event_gap' works in more technical terms is:
  • event_gap is a timer that timeout 'event_gap' seconds after the last video frame with motion is detected.
  • If 'post_capture' is activated then the event_gap timer starts counting after the last image of the post_capture buffer has been saved.
  • The event_gap timer is reset and starts all over each time new motion is detected, so you will not miss any action by having a short 'event_gap' value. It will just create more events (e.g. more mpegs files)

The event_gap value impacts many functions in Motion.
  • When the event_gap timer runs out the event number is increased by one next time motion is detected. When you use the %v conversion specifier in filenames or text features this means that the number in filename or text increased by one.
  • The pre_capture feature only works at the beginning of an event. So if you have a very large 'event_gap' value pre_capture is not working very often.
  • When you make mpegs using the ffmpeg features a new mpeg file is started at the beginning of an event when the first motion is detected. When 'event_gap' seconds has passed without motion (and post_captured frames saved) the movie file is completed and closed.
  • Do not use large event_gap values to generate one large movie file. If Motion stops working this movie file never gets properly completed and closed and you will not be able to view it.
  • Some of the tracking features sets the camera back to the center position when an event is over.

exif_text

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Empty string
  • Group: Output - Picture

Use this option to specify the text to include in a JPEG EXIF comment The EXIF timestamp is included independent of this text. , Use this option to specify the text to include in a JPEG EXIF comment The EXIF timestamp is included independent of this text.

You can use conversion specifiers in this option.

ffmpeg_bps

  • Type: $formfieldType)
  • Range / Valid values: 0 - 9999999
  • Default: 400000
  • Group: Output - Movie

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., 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.

To use this feature you need to install the FFmpeg Streaming Multimedia System.

Experiment to get the desired quality. The better quality the bigger files. This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled).

ffmpeg_cap_motion

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes.

This option has been replaced by ffmpeg_output_debug_movies

Works like ffmpeg_cap_new but outputs motion pixel type pictures instead.

This feature generates the special motion type movie 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. The filename given is the same as the normal mpegs except they have an 'm' appended after the filename before the .mpg. E.g. 20040424181525m.mpg

To use this feature you need to install the FFmpeg Streaming Multimedia System

ffmpeg_cap_new

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

Use ffmpeg libraries to encode mpeg movies in realtime.

This option is replaced by ffmpeg_output_movies

Generates a new film at the beginning of each new event and appends to the film for each motion detected within the same event. The current event ends when the time defined by the 'gap' option has passed with no motion detected. At the next detection of motion a new mpeg film is started.

To use this feature you need to install the FFmpeg Streaming Multimedia System

Must not be included in config file without having ffmpeg installed.

ffmpeg_deinterlace

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures.

This option has been removed from Motion as it is no longer supported by ffmpeg or needed by ffmpeg

To use this feature you need to install the FFmpeg Streaming Multimedia System

Must not be included in config file without having ffmpeg installed.

ffmpeg_duplicate_frames

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Output - Movie

When creating videos, this feature will duplicate frames in order to keep up with the requested frames per second., When creating videos, this feature will duplicate frames in order to keep up with the requested frames per second.

ffmpeg_filename

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %v-%Y%m%d%H%M%S
  • Group: Obsolete

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.

Default value 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 or .avi 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
  • %T = HH:MM:SS

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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_output_debug_movies

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Output - Movie

Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes., Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes.

Works like ffmpeg_output_movies but outputs motion pixel type pictures instead.

This feature generates the special motion type movie 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. The filename given is the same as the normal mpegs except they have an 'm' appended after the filename before the .mpg. E.g. 20040424181525m.mpg

To use this feature you need to install the FFmpeg Streaming Multimedia System

ffmpeg_output_movies

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Output - Movie

Use ffmpeg libraries to encode mpeg movies in realtime., Use ffmpeg libraries to encode mpeg movies in realtime.

Generates a new film at the beginning of each new event and appends to the film for each motion detected within the same event. The current event ends when the time defined by the 'gap' option has passed with no motion detected. At the next detection of motion a new mpeg film is started.

To use this feature you need to install the FFmpeg Streaming Multimedia System

Must not be included in config file without having ffmpeg installed.

ffmpeg_timelapse

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (disabled)
  • Group: Movie File Output

Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used., Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used.

This feature uses ffmpegs libavcodec to encode a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Setting this option to 0 disables it.

The feature gives your viewer the chance to watch the day pass by. It makes a nice effect to film flowers etc closeup during the day. Options like frame_rate, snapshot, gap etc have no impact on the ffmpeg timelapse function.

Note that the timelapse format is always mpeg1 independent of ffmpeg_video_codec. This is because mpeg1 allows the timelapse to stop and the file to be reopened and more film appended.

To use this feature you need to install the FFmpeg Streaming Multimedia System.

(renamed from ffmpeg_timelaps to ffmpeg_timelapse in 3.1.14)

ffmpeg_timelapse_mode

  • Type: $formfieldType)
  • Range / Valid values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual
  • Default: daily
  • Group: Output - Movie

The file rollover mode of the timelapse video., The file rollover mode of the timelapse video.

Note that it is important that you use the conversion specifiers in ffmpeg_filename that ensure that the new timelapse file indeed is a new file. If the filename does not change Motion will simply append the timelapse pictures to the existing file.

The value 'Manual' means that Motion does not automatically rollover to a new filename. You can do it manually using the http control interface by setting the option 'ffmpeg_timelapse' to 0 and then back to your chosen value. Value 'hourly' rolls over on the full hour. Value 'daily' which is the default rolls over at midnight. There are two weekly options because depending on where you come from a week may either start on Sunday or Monday. And 'monthly' naturally rolls over on the 1st of the month.

ffmpeg_variable_bitrate

  • Type: $formfieldType)
  • Range / Valid values: 0, 2 - 31
  • Default: 0 (disabled)
  • Group: Output - Movie

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., 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.

Experiment for the value that gives you the desired compromise between size and quality.

ffmpeg_video_codec

  • Type: $formfieldType)
  • Range / Valid values: mpeg4, msmpeg4, swf, flv, ffv1, mov, ogg, mp4, mkv, hevc
  • Default: mpeg4
  • Group: Movie File Output

Codec to be used by ffmpeg for the video compression. Timelapse will only work with the options mpeg4 or swf., Codec to be used by ffmpeg for the video compression. Timelapse will only work with the options mpeg4 or swf.

Supported formats are:

  • mpeg4 or msmpeg4 - gives you files with extension .avi
  • msmpeg4 is recommended for use with Windows Media Player because it requires no installation of codec on the Windows client.
  • swf - gives you a flash film with extension .swf
  • flv - gives you a flash video with extension .flv
  • ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
  • mov - QuickTime ( testing )
  • ogg - Ogg/Theora ( testing )
  • mp4 - MPEG-4 Part 14 H264 encoding
  • mkv - Matroska H264 encoding
  • hevc - H.265 / HEVC (High Efficiency Video Coding)

Timelapse videos have two options.
  • swf - Creates swf file with mpeg-2 encoding.
    If motion is shutdown and restarted, new pics will be appended to any previously created file with name indicated for timelapse.
  • mpeg4 - Creates avi file with the default encoding.
    If motion is shutdown and restarted, new pics will create a new file with the name indicated for timelapse.

framerate

  • Type: $formfieldType)
  • Range / Valid values: 2 - 100
  • Default: 100 (no limit)
  • Group: Image Processing

Maximum number of frames to be captured from the camera per second., Maximum number of frames to be captured from the camera per second.

The faster you fetch pictures from the camera the more CPU load you get and the more pictures get included when Motion is detected.

Motion will stop storing pictures if the framerate is set to less than 2.

Set this parameter to the maximum number of images per second that you want to store either as images or as mpeg films.

To set intervals longer than one second use the 'minimum_frame_time' option instead.

frequency

  • Type: $formfieldType)
  • Range / Valid values: 0 - 999999
  • Default: 0 (Not set)
  • Group: Video Devices

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

This option is only relevant if you have a TV tuner card where you can select the tuner frequency. Your tuner card must support this feature.

gap

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 60
  • Group: Obsolete

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.

This option has been replaced by event_gap

Recommended value is 60 seconds (Default). The value 0 is allowed (but not recommended) and disables events causing all Motion to be written to one single mpeg file and no pre_capture. You can force an event to end and a new to begin using the http control 'http://host:port/thread_number/action/makemovie'. Disabling events has bad side effects on noise_tune and smartmask. Both features can only work properly outside an event. When gap is set to 0, both features don't work properly anymore.

An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. This option defines how long a pause between detected motions that is needed to be defined as a new event.

The gap timer starts after the last motion is detected and post_capture images have been saved and appended to open movie mpeg files.

Any motion detected before the gap timer times out resets the gap timer so it starts counting over again.

Detailed Description

The option 'gap' is important. It defines how long a period of no motion detected it takes before we say an event is over. An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. Motion detected includes post_captured frames set by the 'post_capture' option. The 'gap' option defines how long a pause between detected motions that is needed to be defined as a new event. A good starting value is 60 seconds.

The way 'gap' works in more technical terms is:
  • Gap is a timer that timeout 'gap' seconds after the last video frame with motion is detected.
  • If 'post_capture' is activated then the gap timer starts counting after the last image of the post_capture buffer has been saved.
  • The gap timer is reset and starts all over each time new motion is detected, so you will not miss any action by having a short 'gap' value. It will just create more events (e.g. more mpegs files)

The gap value impacts many functions in Motion.
  • When the gap timer runs out the event number is increased by one next time motion is detected. When you use the %v conversion specifier in filenames or text features this means that the number in filename or text increased by one.
  • The pre_capture feature only works at the beginning of an event. So if you have a very large 'gap' value pre_capture is not working very often.
  • When you make mpegs using the ffmpeg features a new mpeg file is started at the beginning of an event when the first motion is detected. When 'gap' seconds has passed without motion (and post_captured frames saved) the mpeg files is completed and closed.
  • Do not use large gap values to generate one large mpeg4 file. If Motion stops working this mpeg4 file never gets properly completed and closed and you will not be able to view it.
  • Some of the tracking features sets the camera back to the center position when an event is over.

Note that 'gap' and 'minimum_gap' have nothing to do with each other.

height

  • Type: $formfieldType)
  • Range / Valid values: Device Dependent
  • Default: 288
  • Group: Image Processing

The height of each frame in pixels., The height of each frame in pixels.

The height of the image in pixels. Motion does not scale so should be set to the actual size of the v4l device. In case of a net camera motion sets the height to the height of the first image read.

Motion actually set the size of the image coming from the video4linux device.

Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.

For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.

Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.

hue

  • Type: $formfieldType)
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Group: Video Devices

The hue level for the video device., The hue level for the video device.

Normally only relevant for NTSC cameras.

input

  • Type: $formfieldType)
  • Range / Valid values: -1, 0, 1, 2, 3....
  • Default: -1 (disabled)
  • Group: Video Devices

Input channel to use expressed as an integer number starting from 0. Should normally be set to 0 or 1 for video/TV cards, and -1 (disabled) for USB and network cameras., Input channel to use expressed as an integer number starting from 0. Should normally be set to 0 or 1 for video/TV cards, and -1 (disabled) for USB and network cameras.

This parameter is really used only with video capture cards that has more than one input.

However if you set the input number to e.g. 1 for a USB camera motion writes an error message back. If you set it to -1 it does not give you any warning.

If you have a video capture card you can define the channel to tune to using this option. If you are using a USB device or network camera you should set the value to the default -1.

Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. It is recommended to set the parameter to -1 for USB cameras as your first try. For video capture cards input 1 is normally the composite video input but it may also be 0. Try both until it works.

ipv6_enabled

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Stream and Webcontrol

Enable or disable IPV6 for http control and stream, Enable or disable IPV6 for http control and stream

This sets the TCP/IP port number to be used for control of motion using http (browser). Port numbers below 1024 normally requires that you have root privileges. Port 8080 is a fine choice of port to use for the purpose.

jpeg_filename

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %v-%Y%m%d%H%M%S-%q
  • Group: Obsolete

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.

This option has been replaced by picture_filename

Default value 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

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
  • %T = HH:MM:SS

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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 value 'preview' only works when 'output_normal' is set to 'best'. It makes Motion name the best preview jpeg file (image with most changed pixels during the event) with the same body name as the mpeg movie created during the same event. The purpose is to create a good single image that represents the saved mpeg moview so you can decide if you want to see it and spend time downloading it from a web page.

lightswitch

  • Type: $formfieldType)
  • Range / Valid values: 0 - 100
  • Default: 0 (disabled)
  • Group: Motion Detection

Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity., Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity.

Experiment to see what works best for your application.

Note: From version 3.1.17 (snap release 2 and on) this option has changed from a boolean (on or off) to a number in percent between 0 and 100. Zero means the option is disabled.

The value defines the picture areas in percent that will trigger the lightswitch condition. When lightswitch is detected motion detection is disabled for 5 picture frames. This is to avoid false detection when light conditions change and when a camera changes sensitivity at low light.

locate

  • Type: $formfieldType)
  • Range / Valid values: on, off, preview
  • Default: off
  • Group: Obsolete

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.

This option has been replaced by locate_motion_mode

The value 'preview' only works when 'output_normal' is set to either 'first' or 'best'.

locate_motion_mode

  • Type: $formfieldType)
  • Range / Valid values: on, off, preview
  • Default: off
  • Group: Image Processing

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. , 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.

The value 'preview' only works when 'output_normal' is set to either 'first' or 'best'.

locate_motion_style

  • Type: $formfieldType)
  • Range / Valid values: box, redbox, cross, redcross
  • Default: box
  • Group: Image Processing

Set the look and style of the locate box if enabled., Set the look and style of the locate box if enabled.

  • Set to 'box' will draw the traditional box.
  • Set to 'redbox' will draw a red box.
  • Set to 'cross' will draw a little cross to mark center.
  • Set to 'redcross' will draw a little red cross to mark center.

log_level

  • Type: $formfieldType)
  • Range / Valid values: 1-9
  • Default: 6
  • Group: System Processing

This option specifies the level of verbosity of the messages sent from Motion. At a level of 8(DBG), there are a LOT of messages. At a level of 1(EMR) virtually no messages will be output.

The various levels are [1..9] (EMR, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL)., This option specifies the level of verbosity of the messages sent from Motion. At a level of 8(DBG), there are a LOT of messages. At a level of 1(EMR) virtually no messages will be output.

The various levels are [1..9] (EMR, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).

You can use this parameter to set how much information you want from the logging.

You will typically use a high value when you are trouble-shooting a problem.

The 9 levels are

Level Short Name
1 EMG Emergency
2 ALR Alert
3 CRT Crritical
4 ERR Error
5 WRN Warning
6 NTC Notice
7 INF Info
8 DBG Debug
9 ALL All

log_type

  • Type: $formfieldType)
  • Range / Valid values: COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL
  • Default: ALL
  • Group: System Processing

The different components of Motion use different log types. This option allows the user to only show the messages from particular components., The different components of Motion use different log types. This option allows the user to only show the messages from particular components.

This enables users and developers to isolate logging information to a specific area of interest.

The log types are

Short Name
COR Core
STR Stream
ENC Encoder
NET Netcam
DBL Database
EVT Events
TRK Tracking
VID V4L1/2 Bktr
ALL All

logfile

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: System Processing

Use this option to specify the full path and filename to use for logging of the messages generated from Motion. If this option is not defined, the stderr and syslog is used. Note that Motion can generate a LOT of messages and as a result, this option should be considered if the log_level is at any of the higher levels., Use this option to specify the full path and filename to use for logging of the messages generated from Motion. If this option is not defined, the stderr and syslog is used. Note that Motion can generate a LOT of messages and as a result, this option should be considered if the log_level is at any of the higher levels.

low_cpu

  • Type: $formfieldType)
  • Range / Valid values: 0 - 100
  • Default: 0 (disabled)
  • Group: Obsolete

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 )

low_cpu

  • Type: Integer
  • Range / Valid values: 0 - 100
  • Default: 0 (disabled)
  • Option Topic
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 )

This is smart for running a server that also does other tasks such as running Apache, MySQL etc. Motion grabs this lower number of frames per second until it detects motion. Then it speeds up to normal speed and take pictures as set by the option "framerate".

mask_file

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Motion Detection

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. , 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.

Full path of the PGM (portable gray map) mask file (binary format).

If you have one or more areas of the camera image in which you do NOT want motion detected (e.g. a tree that moves in the wind or a corner of the picture where you can see cars/pedestrians passing by) you need a mask file. This file is a picture that you create in your favorite photo editing program. The areas that you want detected must be white. The error that you want ignored must be black. The pgm image must be the same size (number of pixels high and wide) as the pictures that are taken by the camera (video4linux device).

You can adjust sensitivity by using gray tones.

If you do not have a mask file disable this option by not having it in the config file or comment it out ("#"or ";" as first character in line). If you are using the rotate option, note that the mask is applied after the rotation.

Detailed Description

The mask file must be a pgm format image file (portable gray map). Note that you must choose the BINARY (raw) format, and the code requires that the whitespace between the width and height values at the start of the file takes the form of a single space character. This is the line after the "P5". If yours doesn't, you may need to use a hex editor to modify it.

The feature is simple. Create an image of exact the same size as the ones you get from your video device (camera). Make a purely white picture and paint the areas that you want to mask out black. You can also make gray areas where you want to lower the sensitivity to motion. Normally you will stick to pure black and white.

One easy method for generating the mask file is as follows.

You can just take a motion captured picture, edit it with black and white for the mask and save it as a pgm file. If you cannot save in this format save as a grayscale jpg and then you can convert it to pgm format with

djpeg -grayscale -pnm [inputfile] > mask.pgm

(assuming you have djpeg installed - part of the jpeg lib package).

Note that the mask file option masks off the detection of motion. The entire picture is still shown on the picture. This means that you cannot use the feature to mask off an area that you do not want people to see.

Below are an example of a webcam picture and a mask file to prevent the detection cars in the street.

Normal picture. Notice the street is visible through the hedge.

Mask file (converted to png format so it can be shown by your web browser)

This same mask feature can be used to mask off individual pixels of unimportant motion. For example, any edge will typically show some noise. Leaves moving in the wind cause noise, but only at the edges of the leaves. You may not want to mask off the entire area.

max_movie_time

  • Type: $formfieldType)
  • Range / Valid values: 0 (infinite) - 2147483647
  • Default: 3600
  • Group: Output - Movie

The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length., The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.

The parameter sets the limit of the time and not the size of the file

max_mpeg_time

  • Type: $formfieldType)
  • Range / Valid values: 0 (infinite) - 2147483647
  • Default: 3600
  • Group: Obsolete

The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.

This option has been replaced by max_movie_time

The parameter sets the limit of the time and not the size of the file

minimum_frame_time

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0
  • Group:

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 time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate.

This option is used when you want to capture images at a rate lower than 2 per second.

When this is enabled the framerate option is used only to set the pace the Motion service the webcam port etc. Running Motion at framerate 2 is normally fine.

minimum_gap

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (no minimum)
  • Group: Obsolete

The minimum time between two shots in seconds. ( DEPRECATED )

minimum_gap

  • Type: Integer
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (no minimum)
  • Option Topic

The minimum time between two shots in seconds. ( DEPRECATED )

This is the minimum gap between the storing pictures while detecting motion.

The value zero means that pictures can be stored almost at the framerate of the camera. Normally you will set this to 0

This option has nothing to do with the 'gap' option.

ALERT! From motion 3.2.7 this feature has been removed because it was in practical a useless feature. It prevented saving more than one picture per minimum_gap seconds but the capturing and motion detect was still run at full framerate loading the CPU heavily. From 3.2.7 a new feature called minimum_frame_time has been introduced which lower the capture rate. So it gives the same effect as minimum_gap did but additionally lower the CPU load significantly.

minimum_motion_frames

  • Type: $formfieldType)
  • Range / Valid values: 1 - 1000s
  • Default: 1
  • Group: Motion Detection

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., 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.

Note that the picture frames are buffered by Motion and once motion is detected also the first frames containing motion are saved so you will not miss anything.

The feature is used when you get many false detections when the camera changes light sensitivity or light changes.

Experiment for best setting. Even though Motion accepts large values you should set this to a relatively low number (below 10). For each step larger than 1 Motion reserves space in RAM for the picture frame buffer. If you have a large value Motion will miss many frames from the camera while it is processing the all the pictures in the buffer.

motion_video_pipe

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Output - Pipe

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, 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

Using this you can view the results in real time. E.g. by using the program camstream. The difference between this option and the video-pipe option is that this option shows the motion version of the images instead of the normal images.

Disable this option by not having it in the config file (or comment it out with "#" or ";").

movie_filename

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %v-%Y%m%d%H%M%S
  • Group: Output - Movie

File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename., File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename.

File extension .mpg or .avi 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
  • %T = HH:MM:SS

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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'.

Default value 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

mysql_db

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Obsolete

Name of the MySQL database.

MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.

If you compiled motion with MySQL support you will need to set the mysql options if you want motion to log events to the database

mysql_host

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: localhost
  • Group: Obsolete

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

MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature

mysql_password

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Obsolete

The MySQL password.

MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.

mysql_user

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Obsolete

The MySQL user name.

MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature

netcam_http

  • Type: $formfieldType)
  • Range / Valid values: 1.0, keep_alive, 1.1
  • Default: 1.0
  • Group: Obsolete

The setting for keep-alive of network socket, should improve performance on compatible net cameras.

This option has been replace by netcam_keepalive

  • 1.0: the historical implementation using HTTP/1.0, closing the socket after each http request.
  • keep_alive: Use HTTP/1.0 requests with keep alive header to reuse the same connection.
  • 1.1: Use HTTP/1.1 requests that support keep alive as default.

netcam_keepalive

  • Type: $formfieldType)
  • Range / Valid values: off, on, force
  • Default: off
  • Group: Network Cameras

The setting for keep-alive of network socket, should improve performance on compatible net cameras.
, The setting for keep-alive of network socket, should improve performance on compatible net cameras.

  • off: The historical implementation using HTTP/1.0, closing the socket after each http request.
  • on: Use HTTP/1.1 requests that support keep alive as default.
  • force: Use HTTP/1.0 requests with keep alive header to reuse the same connection.

netcam_proxy

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Network Cameras

URL to use for a netcam proxy server, if required. The syntax is http://myproxy:portnumber, URL to use for a netcam proxy server, if required. The syntax is http://myproxy:portnumber

Use this if you need to connect to a network camera through a proxy server.

Example of syntax: "http://myproxy.mydomain.com:1024

If the proxy port number is 80 you can ommit the port number. Then the syntax is use "http://myproxy.mydomain.com" .

Leave this option undefined if you do not use a proxy server.

netcam_tolerant_check

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Network Cameras

Set less strict jpeg checks for network cameras with a poor/buggy firmware., Set less strict jpeg checks for network cameras with a poor/buggy firmware.

netcam_url

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters written as URL
  • Default: Not defined
  • Group: Network Cameras

URL to use if you are using a network camera (incl http:// ftp:// mjpg:// rtsp:// mjpeg:// or file:///). Size will be autodetected
Must be a URL that returns single jpeg pictures or a raw mjpeg stream. A trailing slash may be required for some cameras., URL to use if you are using a network camera (incl http:// ftp:// mjpg:// rtsp:// mjpeg:// or file:///). Size will be autodetected
Must be a URL that returns single jpeg pictures or a raw mjpeg stream. A trailing slash may be required for some cameras.

Motion can connect to a network camera through a normal TCP socket. All you need to give it is the URL. The URL given must return either one single jpeg picture or an mjpeg stream.

If you are using a network camera, size will be auto-detected

Available prefixes to the URL:

  • http://
  • ftp://
  • mjpg://
  • rtsp://
  • mjpeg://
  • file:///

The prefixes of mjpg and mjpeg are not actual protocols and allow the user to specify different formats and methods to access the network stream. They are internally translated into http. For options such as rtsp, it is recommended that the connection string be validated with other applications such as ffplay or VLC.

When the netcam_url is defined the video4linux options are ignored

Example of URL: http://www.gate.com/pe1rxq/jeroen.jpg.

Also watch out that you do not use a URL that create an HTML page with an embedded jpg. What must be returned is the jpg picture itself or the raw mjpeg stream.

netcam_userpass

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Network Cameras

The Username and password for the network camera. For http protocols, this option is for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. To use no authentication simply remove this option. Note that only basic authentication is supported for connection to netwwork cameras. Digest authentication is not currently available , The Username and password for the network camera. For http protocols, this option is for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. To use no authentication simply remove this option. Note that only basic authentication is supported for connection to netwwork cameras. Digest authentication is not currently available

night_compensate

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

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 )

night_compensate

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic

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 )

It has normally been the advice not to use this with 'noise_tune' turned on. However the latest experience is that with the new improved noise_tune algorithm it actually works fine in combination with 'night_compensate'.

noise_level

  • Type: $formfieldType)
  • Range / Valid values: 1 - 255
  • Default: 32
  • Group: Motion Detection

The noise level is used as a threshold for distinguishing between noise and motion., The noise level is used as a threshold for distinguishing between noise and motion.

This is different from the threshold parameter. This is changes at pixel level. The purpose is to eliminate the changes generated by electric noise in the camera. Especially in complete darkness you can see the noise as small grey dots that come randomly in the picture. This noise can create false motion detection. What this parameter means is that the intensity of a pixel must change more than +/- the noise threshold parameter to be counted

noise_tune

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Motion Detection

Activates the automatic tuning of noise level., Activates the automatic tuning of noise level.

This feature makes Motion continuously adjust the noise threshold for distinguishing between noise and motion. The 'noise_level' setting is ignored when activating this feature. This is a new feature and new algorithm. It may give different results depending on camera and light conditions. Report your experience with it on the Motion mailing list. If it does not work well, deactivate the 'noise_tune' option and use the manual setting of 'noise_level' instead

norm

  • Type: $formfieldType)
  • Range / Valid values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)
  • Default: 0 (PAL)
  • Group: Video Devices

Select the norm of the video device. 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)

This value is only used for capture cards using the BTTV driver.

on_area_detected

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

Command to be executed when motion in a predefined area is detected. Check option area_detect., Command to be executed when motion in a predefined area is detected. Check option area_detect.

on_camera_lost

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

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), 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

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

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., 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.

Full path name of the program/script.

This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #! /usr/bin/perl) as the first line of the script.

The command is run when an event is over. I.e. the number of seconds defined by the time 'gap' has passed since the last detection of motion and motion closes the mpeg file.

on_event_start

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

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., 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.

Full path name of the program/script.

This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.

The command is run when an event starts. I.e. the first motion is detected since the last event.

This option replaces the former options 'mail', 'sms' and 'execute'

on_motion_detected

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

Command to be executed when a motion frame is detected. You can use Conversion Specifiers and spaces as part of the command., Command to be executed when a motion frame is detected. You can use Conversion Specifiers and spaces as part of the command.

To disable the feature simply do not include the option in the file or comment it out by placing a "#" or ";" as the first character on the line before the execute command

on_movie_end

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

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., 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.

Full path name of the program/script.

This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.

The command is run when an event is over. I.e. the number of seconds defined by the time 'gap' has passed since the last detection of motion and motion closes the mpeg file.

This option was previously called onffmpegclose.

To include the path name of the picture in the command line, you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.

Most common conversion specifiers

  • %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

on_movie_start

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

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., 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.

Full path name of the program/script.

This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script. When you use ffmpeg the film is generated on the fly and on_movie_start then runs when the new mpeg file is created. Often you will want to use the on_movie_end option which runs when the mpeg file is closed and the event is over.

This option was previously called onmpeg.

To include the path name of the picture in the command line, you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.

Most common conversion specifiers

  • %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 file-type

on_picture_save

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Script Execution

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., 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.

Full path name of the program/script.

This can be any type of program or script. Remember to set the execution bit in the file access control list (chmod) and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/usr/bin/perl) as the first line of the script.

To include the path name of the picture in the command line, you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.

The script is run after the image is saved.

Most common conversion specifiers

  • %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 file-type

output_all

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

Picture are saved continuously as if motion was detected all the time.

This feature is not meant to be the normal mode of operation. Especially not if you have the output_normal or output_motion features enabled since it will keep on saving pictures on the disk and you will soon run out of disk space. So be careful with this command.

If your frame rate is 10 pictures per second motion will save 10 new picture pr second until the disk is full.

It does all the normal actions that are done when motion is detected. It saves pictures on the harddisk, execute external scripts, etc as fast as the frame rate of the camera. So it is probably a good idea to run with a low framerate when using this feature and to not use activate all the features that saves files on the disk.

The idea of this feature is that you can turn the feature on and off for a short period of time to test or to generate continuous mpeg films when needed.

output_debug_pictures

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Output - Picture

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.

If a Smartmask is specified, it is shown in red., 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.

If a Smartmask is specified, it is shown in red.

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 these motion images. Motion pictures are stored the same place and with the same filename as normal motion triggered pictures except they have an "m" appended at the end of the filename before the .jpg or .ppm. E.g. the name can be 01-20020424232936-00m.jpg.

output_motion

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

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.

This option has been replaced by output_debug_pictures

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 are stored the same place and with the same filename as normal motion triggered pictures except they have an "m" appended at the end of the filename before the .jpg or .ppm. E.g. the name can be 01-20020424232936-00m.jpg.

output_normal

  • Type: $formfieldType)
  • Range / Valid values: on, off, first, best, center
  • Default: on
  • Group: Obsolete

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.

This option has been replaced by output_pictures

If you set the value to 'first' Motion saves only the first motion detected picture per event.

If you set it to "best" Motion saves the picture with most changed pixels during the event. This is useful if you store mpegs on a webserver and want to present a jpeg to show the content of the mpeg on a webpage. "best" requires a little more CPU power and resources compared to "first".

Picture with motion nearest center of picture is saved when set to 'center' (since 3.2.10).

Set to 'off' to not write pictures (jpeg or ppm).

output_pictures

  • Type: $formfieldType)
  • Range / Valid values: on, off, first, best, center
  • Default: on
  • Group: Output - Picture

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., 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.

If you set the value to 'first' Motion saves only the first motion detected picture per event.

If you set it to "best" Motion saves the picture with most changed pixels during the event. This is useful if you store mpegs on a webserver and want to present a jpeg to show the content of the mpeg on a webpage. "best" requires a little more CPU power and resources compared to "first".

Picture with motion nearest center of picture is saved when set to 'center'

Set to 'off' to not write pictures

pgsql_db

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Obsolete

Name of the PostgreSQL database.

PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.

If you compiled motion with PostgreSQL support you will need to set all the pgsql_ options if you want motion to log events to the database.

pgsql_host

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: localhost
  • Group: Obsolete

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

PostgreSQL CONFIG FILE OPTION. Motion must be built with pgsql_db libraries to use this feature.

pgsql_password

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Obsolete

The PostgreSQL password.

PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature

pgsql_port

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 5432
  • Group: Obsolete

The PostgreSQL server port number.

This option has been replaced by database_port

PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.

pgsql_user

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Obsolete

The PostgreSQL user name.

PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.

picture_filename

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %v-%Y%m%d%H%M%S-%q
  • Group: Output - Picture

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., 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.

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
  • %T = HH:MM:SS

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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 value 'preview' only works when 'output_pictures' is set to 'best'. It makes Motion name the best preview jpeg file (image with most changed pixels during the event) with the same body name as the mpeg movie created during the same event. The purpose is to create a good single image that represents the saved mpeg moview so you can decide if you want to see it and spend time downloading it from a web page

Default value 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

picture_type

  • Type: $formfieldType)
  • Range / Valid values: jpeg, ppm
  • Default: jpeg
  • Group: Output - Picture

This option specifies the type of picture file to output., This option specifies the type of picture file to output.

The recommendation is to always use jpg except if you have a specific need to store high quality pictures without any quality loss. For web cameras you should always choose jpg. Note that the built in webcam server requires that this parameter is set to off.

post_capture

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (disabled)
  • Group: Output - General

Specifies the number of frames to be captured after motion has been detected., Specifies the number of frames to be captured after motion has been detected.

The purpose of this is mainly to create smooth video clips each time motion is detected. Use it to you personal taste (and disk space)..

This option is the preferred way to create continuous movies. Post_capture does not consume extra RAM and it does not create pauses in the movie even with large values.

If you only store mpegs movies and do not have output_normal on, then the recommended post_capture value is what is equivalent to 1-5 seconds of movie.

power_line_frequency

  • Type: $formfieldType)
  • Range / Valid values: -1, 0, 1, 2, 3
  • Default: -1
  • Group: Video Devices

This option allows the user to specify the power line frequency that is applicable to the user. This option can help stabilize the images of some webcams that are sensitive to this frequency. This is not normally necessary., This option allows the user to specify the power line frequency that is applicable to the user. This option can help stabilize the images of some webcams that are sensitive to this frequency. This is not normally necessary.

These are the valid values

Value Description
-1 Do not modify device setting
0 Power line frequency Disabled
1 50 Hz
2 60 Hz
3 Auto

ppm

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

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.

This option has been replaced by picture_type

The recommendation is to always use jpg except if you have a specific need to store high quality pictures without any quality loss. For web cameras you should always choose jpg. Note that the built in webcam server requires that this parameter is set to off.

pre_capture

  • Type: $formfieldType)
  • Range / Valid values: 0 - 100s
  • Default: 0 (disabled)
  • Group: Output - General

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., 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.

Motion buffers the number of picture frames defined by 'pre_capture'. When motion is detected the pictures in the buffer are included in the video clip generated by ffmpeg. The effect is that it seems the program knew in advance that the event was going to take place and started the recording before it actually happened. This is a nice feature that give more complete video clips of an event.

If pre_capture is set to 0 the feature is disabled. Keep this value below 5.

The recommended value would be approx 0.5 second of video so the value should be defined so it fits the framerate and the desired pre-capture time. E.g. 0.5 second at 20 frames pr second would mean a value of 5. You should never use a value larger than 10.

You can in theory have up to 100s of pre-captured frames but naturally this makes motion leave a larger footprint in the memory of the computer. More important Motion is processing all the buffered images including saving jpegs, encoding mpegs, writing to databases and executing external programs after the first image is detected as Motion.

Motion will not grab another image until this is done. This means that even moderate values for pre_capture combined with high framerates will mean that you will miss quite many frames of Motion. It is therefore recommended to use relative small values for pre_capture. Depending on your chosen framerate and depending on the features enabled values from 1-5 are sensible.

If you wish to create smooth mpegs during events using large pre_capture values will do the opposite! It will create a long pause where a lot of action is missed.

To get a smooth mpeg use a large value for post_capture which does not cost any performance hit or RAM space.

process_id_file

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: System Processing

File to store the process ID, also called pid file. Recommended value when used: /var/run/motion.pid, File to store the process ID, also called pid file. Recommended value when used: /var/run/motion.pid

When Motion is started and this option is defined, Motion creates a file containing the process ID if the main Motion thread. This can be used by scripts to identify the process number for example when you want to stop the process.

If you want to run multiple instances of Motion make sure to use different file names for the process ID file. The process ID file (pid file) can also be specified with the -p command line switch.

quality

  • Type: $formfieldType)
  • Range / Valid values: 1 - 100
  • Default: 75
  • Group: Output - Picture

The quality for the jpeg images in percent., The quality for the jpeg images in percent.

100 means hardly compressed. A small number means a much smaller file size but also a less nice quality image to look at. 50 is a good compromise for most.

quiet

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Output - General

Be quiet, don't output beeps when detecting motion., Be quiet, don't output beeps when detecting motion.

Only works in non-daemon mode.

rotate

  • Type: $formfieldType)
  • Range / Valid values: 0, 90, 180, 270
  • Default: 0 (not rotated)
  • Group:

Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies., Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies.

The rotation feature is used when the camera is hanging upside down (180 degrees) or if you choose a picture format in portrait instead of the normal landscape (90 or 270 degrees).

Note that the CPU load increases when using this feature with a value other than 0. Also note that Motion automatically swaps width and height if you rotate 90 or 270 degrees, so you don't have to touch these options.

roundrobin_frames

  • Type: $formfieldType)
  • Range / Valid values: 1 - 2147483647
  • Default: 1
  • Group: Video Devices

Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible., Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible.

The Round Robin feature is automatically activated where multiple threads are sharing the same video device. Each thread can then set different input channels or frequencies to change camera.

If multiple threads use the same video device, they each can capture roundrobin_frames number of frames before having to share the device with the other threads.

roundrobin_skip

  • Type: $formfieldType)
  • Range / Valid values: 1 - 2147483647
  • Default: 1
  • Group: Video Devices

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

The Round Robin feature is automatically activated where multiple threads are sharing the same video device. Each thread can then set different input channels or frequencies to change camera.

When another thread wants to watch another input or frequency or size the first roundrobin_skip number of frames are skipped to allow the device to settle.

rtsp_uses_tcp

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Network Cameras

This option specifies the transport method for rtsp cameras. The TCP transport is highly preferred because without this option the rtsp images are frequently corrupted and result in many false positive values and images that appear to be smeared. Off indicates that UDP will be used., This option specifies the transport method for rtsp cameras. The TCP transport is highly preferred because without this option the rtsp images are frequently corrupted and result in many false positive values and images that appear to be smeared. Off indicates that UDP will be used.

saturation

  • Type: $formfieldType)
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Group: Video Devices

The colour saturation level for the video device., The colour saturation level for the video device.

sdl_threadnr

  • Type: $formfieldType)
  • Range / Valid values: 1-65535
  • Default: Not defined
  • Group: Runtime Options

The SDL option is optional and unusual. When SDL is included in the building of Motion, there is the ability for Motion to create a SDL preview window for the user. The author believes this option to be more of a proof of concept on how to create a SDL window and show the image. (This same functionality can be achieved via the stream options) To activate the SDL window, include SDL support in the building of the Motion application. Start Motion and note the thread number indicated. Once that is noted, specify that thread number (or 1 more than that number) for this option. When Motion is started again, it will then create a SDL window to preview the image. To close the window, press X. Author is not aware of any method to restart the SDL window after it has been closed. , The SDL option is optional and unusual. When SDL is included in the building of Motion, there is the ability for Motion to create a SDL preview window for the user. The author believes this option to be more of a proof of concept on how to create a SDL window and show the image. (This same functionality can be achieved via the stream options) To activate the SDL window, include SDL support in the building of the Motion application. Start Motion and note the thread number indicated. Once that is noted, specify that thread number (or 1 more than that number) for this option. When Motion is started again, it will then create a SDL window to preview the image. To close the window, press X. Author is not aware of any method to restart the SDL window after it has been closed.

This feature is considered experimental in nature

setup_mode

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: System Processing

Run Motion in setup mode. , Run Motion in setup mode.

When this option is turned on, Motion starts in setup mode so that the parameters can be set more easily. You can run setup mode in either console mode or daemon mode.

With 'motion -s' Motion runs in console mode instead of daemon. It outputs a lot of useful information for each frame from the camera. Each message is prefixed by [number] where number is the camera number (thread number). When you look at the webcam stream you see a black image with numbers. What you see is the number of changed pixels, number of labeled areas and noise setting. When something moves you see the pixels detected as Motion in black and white. The largest labeled area (assuming despeckle is enabled and with the 'l' at the end) is blue. It is only the blue areas which is counted as Motion. If smartmask is enabled you see this as red areas. Here is a suggestion how to initially setup Motion.

  • Disable despeckle (comment it out in motion.conf).
  • Disable smartmask
  • Enable both http control and webcam by setting port numbers. Example 8080 for control and 8081 for webcam.
  • Start Motion in setup mode
  • View the webcam stream. Either with Iceweasel or with Firefox by entering in the address of http://localhost:8080/
  • Open a new tab and connect to the http interface. http://localhost:8080/ . You can now control and change almost anything while Motion is running. To disable a feature enter a space.
  • Start by experimenting with noise level. Do this both during daylight and during darkness. You will be surprised to see how much noise a camera makes during night. Try using the automatic noise feature. It should work for most.
  • Now try the despeckle feature. Enable it using the recommended default EedDl. If this is not enough experiment. Remember that the l must be the last letter.
  • Set the threshold to what you want to trigger Motion.

In normal daemon mode you can use the same setting with two browser tabs and experiment with settings of the camera if needed. From the web interface you can ask Motion to write all your changes back to the config files (motion.conf and thread config files).

smart_mask_speed

  • Type: $formfieldType)
  • Range / Valid values: 0 - 10
  • Default: 0 (disabled)
  • Group: Motion Detection

Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast., Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast.

Smartmask is a dynamic, self-learning mask. Smartmask will disable sensitivity in areas with frequent motion (like trees in the wind). Sensitivity is turned on again after some time of no more motion in this area. The built mask is a bit larger at the borders than the actual motion was. This way smartmask works more reliable when sudden moves occur under windy conditions.

smart_mask_speed - tunes the slugginess of the mask. It accepts values from 0 (turned off) to 10 (fast). Fast means here that the mask is built quick, but it is also not staying very long with no more motion. Slow means that it takes a while until the mask is built but it also stays longer. A good start value for smart_mask_speed is 5. This setting is independent from the framerate. The attack and decay time is constant over all available framerates.

When smartmask is enabled and motion is also configured to either write motion-images or motion-mpegs, the current smartmask is copied as an overlay into the black/white motion-pictures/mpegs in red colour. Same thing happens to the webcam stream when Motion runs in setup_mode. That way you can easily adjust smart_mask_speed.

Detailed Description

The mask_file option provides a static mask to turn off sensitivity in certain areas. This is very usefull to mask a street with cars passing by all day long etc...

But imagine a scenario with large bushes and big trees where all the leaves are moving in the wind also triggering motion from time to time even with despeckle turned on. Of course you can also define a static mask here, but what if the bushes are growing during spring and summer? Well, you have to adapt the mask from time to time. What if the camera position moves slightly? What if someone grows new plants in your garden? You always have to setup a new static mask.

The answer to this problem is the smart mask feature introduced in Motion 3.1.18. A dynamic, self-learning mask.

Smart mask will disable sensitivity in areas with frequent motion (like trees in the wind). Sensitivity is turned on again after some time of no more motion in this area. The built mask is a bit larger at the borders than the actual motion. This way smartmask works more reliably when sudden moves occur under windy conditions.

snapshot_filename

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %v-%Y%m%d%H%M%S-snapshot
  • Group: Output - Picture

File path for snapshots (jpeg or ppm) relative to target_dir., File path for snapshots (jpeg or ppm) relative to target_dir.

Default value 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
  • %T = HH:MM:SS

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (disabled)
  • Group: Output - Picture

Make automated snapshots every 'snapshot_interval' seconds., Make automated snapshots every 'snapshot_interval' seconds.

The snapshots are stored in the target directory + the directory/filename specified by the snapshot_filename option.

This is the traditional web camera feature where a picture is taken at a regular interval independently of motion in the picture.

sql_log_image

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Obsolete

Log to the database when creating motion triggered image file.

This option has been replace by sql_log_picture

Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.

sql_log_movie

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Database

Log to the database when creating motion triggered mpeg file., Log to the database when creating motion triggered mpeg file.

Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.

sql_log_mpeg

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

Log to the database when creating motion triggered mpeg file.

This option is replaced by sql_log_movie

Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.

sql_log_picture

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Database

Log to the database when creating motion triggered image file., Log to the database when creating motion triggered image file.

Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.

sql_log_snapshot

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Database

Log to the database when creating a snapshot image file., Log to the database when creating a snapshot image file.

Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.

sql_log_timelapse

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Database

Log to the database when creating timelapse mpeg file, Log to the database when creating timelapse mpeg file

Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.

sql_query

  • Type: $formfieldType)
  • Range / Valid 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')
  • Group: Database

SQL query string that is sent to the database. The values for each field are given by using convertion specifiers, SQL query string that is sent to the database. The values for each field are given by using convertion specifiers

Most common conversion specifiers

  • %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

Sample Query

insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') insert or ignore into images (camera_nbr, file_name, year, month, day, hour, minute) values (8, '%f', '%Y','%m','%d','%H','%M')

The filetype is defined as bits in a binary number

Normal picture 1
Snapshot picture 2
Debug picture 4
Movie file 8
Debug Movie File 16
Timelapse 32

stream_auth_method

  • Type: $formfieldType)
  • Range / Valid values: 0, 1, 2
  • Default: 0
  • Group: Stream and Webcontrol

This parameter establishes desired authentication method for the stream and web control ports. Disabled (0), Basic (1), MD5 Digest (2), This parameter establishes desired authentication method for the stream and web control ports. Disabled (0), Basic (1), MD5 Digest (2)

The parameters have the following meaning.

  • 0 = disabled
  • 1 = Basic authentication
  • 2 = MD5 digest (the safer authentication)

Note that if you are enabling the webcontrol feature of Motion, you really really really ... should enable security authentications. No. Seriously. You really should. See the security warnings in this document regarding how it completely opens up your system.

stream_authentication

  • Type: $formfieldType)
  • Range / Valid values: username:password
  • Default: Not defined
  • Group: Stream and Webcontrol

This parameter establishes the username and password to use for the stream. The syntax is username:password

stream_limit

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (unlimited)
  • Group: Stream and Webcontrol

Limit the number of frames to number frames. After 'stream_limit' number of frames the connection will be closed by motion. The value 0 means unlimited., Limit the number of frames to number frames. After 'stream_limit' number of frames the connection will be closed by motion. The value 0 means 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 stream_maxrate.

stream_localhost

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Stream and Webcontrol

Limits the access to the webcam to the localhost., Limits the access to the webcam to the localhost.

By setting this to on, the webcam can only be accessed on the same machine on which Motion is running.

stream_maxrate

  • Type: $formfieldType)
  • Range / Valid values: 1 - 100
  • Default: 1
  • Group: Stream and Webcontrol

Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited., Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited.

Don't set 'stream_maxrate' too high unless you only use it on the localhost or on an internal LAN.

stream_motion

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Stream and Webcontrol

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 stream_maxrate. When 'off' the webcam stream always runs as defined by stream_maxrate., 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 stream_maxrate. When 'off' the webcam stream always runs as defined by stream_maxrate.

Use this option to save bandwidth when there is not anything important to see from the camera anyway.

stream_port

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0 (disabled)
  • Group: Stream and Webcontrol

TCP port on which motion will listen for incoming connects with its webcam server., TCP port on which motion will listen for incoming connects with its webcam server.

Note that each camera thread must have its own unique port number and it must also be different from the webcontrol_port number.

A good value to select is 8081 for camera 1, 8082 for camera 2, 8083 for camera 3 etc etc.

This must be placed in motion.conf and not in a thread config file

stream_preview_newline

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Stream and Webcontrol

If the webcontrol page has HTML enabled, Motion displays all of the streams on the home webcontrol page in HTML format so that all the images can be viewed by standard browsers. This parameter determines whether the image is placed on a new line in the webcontrol web page. , If the webcontrol page has HTML enabled, Motion displays all of the streams on the home webcontrol page in HTML format so that all the images can be viewed by standard browsers. This parameter determines whether the image is placed on a new line in the webcontrol web page.

Preview images are placed on to the webcontrol home page in thread number order. This parameter allows the user some flexibility in organizing the images on the page.

Setting this parameter to off will set the image to the right of any image from a lower numbered thread. Setting it to 'on' will place the image on the start of the next line(below).

Full customization of the webcontrol page is NOT planned in the Motion development. Users that require a more polished and customized preview page are encouraged to create their own local HTML page that references the streams

stream_preview_scale

  • Type: $formfieldType)
  • Range / Valid values: 1-65535
  • Default: 25
  • Group: Stream and Webcontrol

If the webcontrol page has HTML enabled, Motion displays all of the streams on the home webcontrol page in HTML format so that all the images can be viewed by standard browsers. This parameter indicates the percentage to scale the stream image when it is placed on the page. Numbers greater than 100 are permitted., If the webcontrol page has HTML enabled, Motion displays all of the streams on the home webcontrol page in HTML format so that all the images can be viewed by standard browsers. This parameter indicates the percentage to scale the stream image when it is placed on the page. Numbers greater than 100 are permitted.

stream_quality

  • Type: $formfieldType)
  • Range / Valid values: 1 - 100
  • Default: 50
  • Group: Stream and Webcontrol

Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth., Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth.

The mjpeg stream consists of a header followed by jpeg frames separated by content-length and boundary string. The quality level defines the size of the individual jpeg pictures in the mjpeg stream. If you set it too high you need quite a high bandwidth to view the stream.

switchfilter

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Video Devices

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., 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.

This is a round robin related feature used when you have a capture card with multiple inputs (controlled by the 'input' option) on the same videodevice.

target_dir

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined = current working directory
  • Group: Output - General

The full path for the target directory for picture and movie files to be saved., The full path for the target directory for picture and movie files to be saved.

This is the target directory for all snapshots, images files and movie files. You will normally always want to specify this parameter as an absolute path.

Note that the options snapshot_filename, picture_filename, movie_filename, and timelapse_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.

text_changes

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Image Processing

Turns the text showing changed pixels on/off., Turns the text showing changed pixels on/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. This is good for calibration and test. Maybe not so interesting for a greater public. Set it to your personal taste.

text_double

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Image Processing

Draw characters at twice normal size on images., Draw characters at twice normal size on images.

This option makes the text defined by text_left, text_right and text_changes twice the normal size. This may be useful when using large picture formats such as 640 x 480.

text_event

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %Y%m%d%H%M%S
  • Group: Image Processing

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., 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.

The idea is that %C can be used filenames and text_left/right for creating a unique identifier for each event.

Option text_event defines the value %C which then can be used in filenames and text_right/text_left. The text_event/%C uses the time stamp for the first image detected in a new event. %C is an empty string when no event is in progress (gap period expired). Pre_captured and minimum_motion_frames images are time stamped before the event happens so %C in text_left/right does not have any effect on those images.

text_left

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Image Processing

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 %)., 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_left is displayed in the lower left corner of the pictures. If the option is not defined no text is displayed at this position.

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.

Detailed Description

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

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %Y-%m-%d\n%T
  • Group: Image Processing

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, 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

text_right is displayed in the lower right corner of the pictures. If the option is not defined no text is displayed at this position.

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 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.

Detailed Description

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

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

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.

thread

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: System Processing

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., 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.

This is used when you have more than one camera/device.

The single camera can get all its options from the default motion.conf file. If you have two or more cameras every camera must have its 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. Example
thread /usr/local/etc/thread1.conf
thread /usr/local/etc/thread2.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

  • Type: $formfieldType)
  • Range / Valid values: 1 - 2147483647
  • Default: 1500
  • Group: Motion Detection

Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling., Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling.

The 'threshold' option is the most important detection setting. When motion runs it compares the current image frame with the previous and counts the number of changed pixels after having processed the image with noise filtering, masking, despeckle and labeling. If more pixels than defined by 'threshold' have changed we assume that we have detected motion. Set the threshold as low as possible so that you get the motion you want detected but large enough so that you do not get detections from noise and plants moving. Note that the larger your frames are, the more pixels you have. So for large picture frame sizes you need a higher threshold.

Use the -s (setup mode) command line option and/or the text_changes config file option to experiment to find the right threshold value. If you do not get small movements detected (see the mouse on the kitchen floor) lower the value. If motion detects too many birds or moving trees, increase the number. Practical values would be from a few hundred to 2000 indoors and 1000-10000 outdoors.

threshold_tune

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Motion Detection

Activates the automatic tuning of threshold level. ( It's broken ), Activates the automatic tuning of threshold level. ( It's broken )

This feature makes Motion continuously adjust the threshold for declaring motion.

The threshold setting is ignored when activating this feature. It may give different results depending on your camera, light conditions, indoor/outdoor, the motion to be detected etc. If it does not work well, deactivate the 'threshold_tune' option and use the manual setting of threshold instead.

There has been many reports from users that this feature does not work very well.

timelapse_filename

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: %v-%Y%m%d-timelapse
  • Group: Output - Movie

File path for timelapse mpegs relative to target_dir (ffmpeg only)., File path for timelapse mpegs relative to target_dir (ffmpeg only).

Default value is equivalent to legacy 'oldlayout' option.

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
  • %T = HH:MM:SS

These are unique to motion
  • %v = event
  • %q = frame number
  • %t = thread (camera) number
  • %D = changed pixels
  • %N = noise level
  • %i = width of motion area
  • %J = height of motion area
  • %K = X coordinate of motion center
  • %L = Y coordinate of motion center
  • %C = value defined by text_event

For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d-timelapse

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-timelapse for 'oldlayout off'.

track_auto

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Tracking

Enable auto tracking, Enable auto tracking

Requires a tracking camera type supported by Motion.

track_iomojo_id

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0
  • Group: Tracking

Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller., Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller.

Only used for iomojo camera.

track_maxx

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0
  • Group: Tracking

The maximum position for servo x., The maximum position for servo x.

Only used for stepper motor tracking.

track_maxy

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0
  • Group: Tracking

The maximum position for servo y., The maximum position for servo y.

Only used for stepper motor tracking.

track_motorx

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0
  • Group: Tracking

The motor number that is used for controlling the x-axis., The motor number that is used for controlling the x-axis.

Only used for stepper motor tracking.

track_motory

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0
  • Group: Tracking

The motor number that is used for controlling the y-axis., The motor number that is used for controlling the y-axis.

Only used for stepper motor tracking.

track_move_wait

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 10
  • Group: Tracking

Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames., Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames.

The actual delay is depending on the chosen framerate. If you want the camera to move maximum once every 2 seconds and the framerate is 10 then you need to set the track_move_wait value to 2 * 10 = 20

track_port

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Tracking

This is the device name of the serial port to which the stepper motor interface is connected., This is the device name of the serial port to which the stepper motor interface is connected.

Only used for stepper motor tracking.

track_speed

  • Type: $formfieldType)
  • Range / Valid values: 0 - 255
  • Default: 255
  • Group: Tracking

Speed to set the motor to., Speed to set the motor to.

Only used for stepper motor tracking.

track_step_angle_x

  • Type: $formfieldType)
  • Range / Valid values: 0-90
  • Default: 10
  • Group: Tracking

Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras., Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras.

Requires a tracking camera type pwc

track_step_angle_y

  • Type: $formfieldType)
  • Range / Valid values: 0-40
  • Default: 10
  • Group: Tracking

Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras., Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras.

Requires a tracking camera type pwc

track_stepsize

  • Type: $formfieldType)
  • Range / Valid values: 0 - 255
  • Default: 40
  • Group: Tracking

Number of steps to make., Number of steps to make.

Only used for stepper motor tracking.

track_type

  • Type: $formfieldType)
  • Range / Valid values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)
  • Default: 0 (None)
  • Group: Tracking

Type of tracker., Type of tracker.

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.

To disable tracking, set this 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 pwc type USB tracking cameras such as 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.
  • Value 4 is the generic track type. Currently it has no other function than enabling some of the internal Motion features related to tracking. Eventually more functionality will be implemented for this type.
  • Value 5 is for uvcvideo type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit MP (new Model) which is driven by the uvcvideo driver. This option was added in Motion 3.2.8.

tunerdevice

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: /dev/tuner0
  • Group: Video Devices

The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for FreeBSD., The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for FreeBSD.

Make sure to remove or comment out this option when running Motion under Linux.

v4l2_palette

  • Type: $formfieldType)
  • Range / Valid values: 0 - 17
  • Default: 17
  • Group: Video Devices

The v4l2_palette allows the user to choose preferable palette to be use by Motion. Note that this is only the preferred option. If the video device does not support the requested format, Motion will loop through the available palettes to try to find one that is supported by both Motion and the device. Motion will report the supported palettes of the device when Motion starts when the log_level is specified as NTC or higher. The default of 17 is highly preferred since this the native format that Motion uses internally. , The v4l2_palette allows the user to choose preferable palette to be use by Motion. Note that this is only the preferred option. If the video device does not support the requested format, Motion will loop through the available palettes to try to find one that is supported by both Motion and the device. Motion will report the supported palettes of the device when Motion starts when the log_level is specified as NTC or higher. The default of 17 is highly preferred since this the native format that Motion uses internally.

Supported values are

Value Name Short
0 V4L2_PIX_FMT_SN9C10X S910
1 V4L2_PIX_FMT_SBGGR16 BYR2
2 V4L2_PIX_FMT_SBGGR8 BA81
3 V4L2_PIX_FMT_SPCA561 S561
4 V4L2_PIX_FMT_SGBRG8 GBRG
5 V4L2_PIX_FMT_SGRBG8 GRBG
6 V4L2_PIX_FMT_PAC207 P207
7 V4L2_PIX_FMT_PJPG PJPG
8 V4L2_PIX_FMT_MJPEG MJPEG
9 V4L2_PIX_FMT_JPEG JPEG
10 V4L2_PIX_FMT_RGB24 RGB3
11 V4L2_PIX_FMT_SPCA501 S501
12 V4L2_PIX_FMT_SPCA505 S505
13 V4L2_PIX_FMT_SPCA508 S508
14 V4L2_PIX_FMT_UYVY UYVY
15 V4L2_PIX_FMT_YUYV YUYV
16 V4L2_PIX_FMT_YUV422P 422P
17 V4L2_PIX_FMT_YUV420 YU12

video_pipe

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Group: Output - Pipe

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., 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.

Using this you can view the results in real time. E.g. by using the program camstream.

Disable this option by not having it in the config file (or comment it out with "#" or ";")

videodevice

  • Type: $formfieldType)
  • Range / Valid values: Max 4095 characters
  • Default: /dev/video0 (FreeBSD: /dev/bktr0)
  • Group: Video Devices

The video device to be used for capturing. Default for Linux is /dev/video0. for FreeBSD the default is /dev/bktr0., The video device to be used for capturing. Default for Linux is /dev/video0. for FreeBSD the default is /dev/bktr0.

This is the video4linux device name. Ignore this for net cameras.

webcam_limit

  • Type: $formfieldType)
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (unlimited)
  • Group: Obsolete

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.

This option has been replaced by stream_limit

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

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Obsolete

Limits the access to the webcam to the localhost.

This option has been replaced by stream_localhost

By setting this to on, the webcam can only be accessed on the same machine on which Motion is running.

webcam_maxrate

  • Type: $formfieldType)
  • Range / Valid values: 1 - 100
  • Default: 1
  • Group: Obsolete

Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited.

This option has been replaced by stream_maxrate

Don't set 'webcam_maxrate' too high unless you only use it on the localhost or on an internal LAN.

webcam_motion

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: off
  • Group: Obsolete

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.

This option has been replaced by stream_motion

Use this option to save bandwidth when there is not anything important to see from the camera anyway.

Note that this feature was greatly improved from Motion version 3.2.2. Before 3.2.2 the option stopped the webcam stream except when Motion was detected. This made the feature not very useful because it made it difficult to connect to the webcam stream and most mjpeg viewers would timeout and give an error message. From 3.2.2 the feature has been greatly improved and actually quite recommendable.

webcam_port

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0 (disabled)
  • Group: Obsolete

TCP port on which motion will listen for incoming connects with its webcam server.

This option has been replaced by the stream_port option

Note that each camera thread must have its own unique port number and it must also be different from the control_port number.

A good value to select is 8081 for camera 1, 8082 for camera 2, 8083 for camera 3 etc etc.

webcam_quality

  • Type: $formfieldType)
  • Range / Valid values: 1 - 100
  • Default: 50
  • Group: Obsolete

Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth.

This option has been replaced by stream_quality

The mjpeg stream consists of a header followed by jpeg frames separated by content-length and boundary string. The quality level defines the size of the individual jpeg pictures in the mjpeg stream. If you set it too high you need quite a high bandwidth to view the stream.

webcontrol_authentication

  • Type: $formfieldType)
  • Range / Valid values: Max 4096 characters
  • Default: Not defined
  • Group: Stream and Webcontrol

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., 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.

By setting this to on, the control using http (browser) can only be accessed using login and password ( following the Basic Authentication defined in HTTP RFC )

webcontrol_html_output

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Stream and Webcontrol

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., 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.

The recommended value for most is "on" which means that you can navigate and control Motion with a normal browser. By setting this option to "off" the replies are in plain text which may be easier to parse for 3rd party programs that control Motion.

webcontrol_localhost

  • Type: $formfieldType)
  • Range / Valid values: on, off
  • Default: on
  • Group: Stream and Webcontrol

Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file., Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file.

By setting this to on, the control using http (browser) can only be accessed on the same machine on which Motion is running.

webcontrol_port

  • Type: $formfieldType)
  • Range / Valid values: 0 - 65535
  • Default: 0 (disabled)
  • Group: Stream and Webcontrol

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., 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.

This sets the TCP/IP port number to be used for control of motion using http (browser). Port numbers below 1024 normally requires that you have root privileges. Port 8080 is a fine choice of port to use for the purpose.

width

  • Type: $formfieldType)
  • Range / Valid values: Device Dependent
  • Default: 352
  • Group: Image Processing

The width in pixels of each frame. Valid range is camera dependent., The width in pixels of each frame. Valid range is camera dependent.

Motion does not scale so should be set to the actual size of the v4l device.

In case of a net camera motion sets the height to the height of the first image read.

Motion actually set the size of the image coming from the video4linux device.

Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.

For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.

Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.
Topic revision: r2 - 05 Jan 2019, KennethLavrsen
Copyright © 1999-2019 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.