Configuration Options-Listed by Topic
-
Configuration options sorted by topic.
System Processing-General Info
General Device Parameters
| device_name | device_id | device_tmo | pause | schedule_params | cleandir_params | watchdog_tmo | watchdog_kill |
| camera | config_dir | ||
| v4l2_device | v4l2_params | libcam_device | libcam_params |
| netcam_url | netcam_params | netcam_high_url | netcam_high_params |
| netcam_userpass |
| width | height | framerate | text_event |
| rotate | flip_axis | locate_motion_mode | locate_motion_style |
| text_left | text_right | text_changes | text_scale |
| on_event_start | on_event_end | on_picture_save | on_motion_detected |
| on_area_detected | on_movie_start | on_movie_end | on_camera_lost |
| on_camera_found | on_secondary_detect | on_action_user | on_sound_alert |
| picture_output | picture_output_motion | picture_type | picture_quality |
| picture_exif | picture_filename | snapshot_interval | snapshot_filename |
| stream_preview_scale | stream_preview_newline | stream_preview_params | stream_preview_method |
| stream_preview_ptz | stream_quality | stream_grey | stream_maxrate |
| stream_motion | stream_scan_time | stream_scan_scale |
| database_type | database_dbname | database_host | database_port |
| database_user | database_password | database_busy_timeout | sql_event_end |
| sql_event_start | sql_movie_end | sql_movie_start | sql_pic_save |
Configuration Options-Detail Descriptions
-
The following section provides detailed descriptions of each of the configuration options.
- Values: on, off | Default: off Run in daemon mode. When running Motion under systemd specify as off.
- Values: String | Default: Not defined The full path and name of the process id file.
- Values: String | Default: Not defined The full path and name for the log file. When not specified, use syslog.
- Values: 1 - 9 | Default: 6 Verbosity level(EMR, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL) of messages.
- Values: 1 - 9 | Default: 3 Verbosity level of ffmpeg messages.
- 1 = AV_LOG_QUIET
- 2 = AV_LOG_PANIC
- 3 = AV_LOG_FATAL
- 4 = AV_LOG_ERROR
- 5 = AV_LOG_WARNING
- 6 = AV_LOG_INFO
- 7 = AV_LOG_VERBOSE
- 8 = AV_LOG_DEBUG
- 9 = AV_LOG_TRACE
- Values: COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL | Default: ALL The component for which to log messages.
- Values: on, off | Default: on Enable native language messages.
- Values: String The full path for the target directory for pictures, snapshots, movies, etc. to be saved. Default: The sub directory of lib/motion/media from the directory defined by --localstatedir=DIR during the configure step of installation. If this was not defined, it will default to /var/lib/motion/media or /usr/local/var/lib/motion/media depending upon your system
- Values: String | Default: Not defined The device name to be used in the format specifiers and web interface.
- Values: 1 - 32000 | Default: The sequence that the device file is read Unique numeric id for the device.
- Values: Integer | Default: 30 Number of seconds that elapse before the device is deemed to be lost.
- Values: Boolean | Default: false
- Values: on, off, schedule | Default: schedule Use 'on' and 'off' to pause or enable motion detection respectively. Use 'schedule' to allow the schedule process to pause or enable detection.
- Values: String | Default: Not Defined Comma separated list of configuration parameters. Format is: option=value,option2=value2
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: String | Default: Not Defined Comma separated list of configuration parameters. Format is: option=value,option2=value2
hourly| Specify the minute of the hour using the format mm. e.g. 05 for 5 minutes past each hourdaily| Specify the hour and minute using the format hhmm. e.g. 1420 for 2:20pmweekly| Specify the day, hour and minute using the format dow-hhmm. e.g. tue-1420 for Tuesdays at 2:20pm- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: Integer | Default: 90 Number of seconds that elapse before a camera is deemed to be unresponsive and Motion triggers a watchdog timeout and begins to force the camera to shut down. When camera is initially starting, the timeout is set to three(3) times this value.
- Values: Integer | Default: 0 Specifying a value of zero indicates that Motion will completely terminate after the watchdog_tmo. Values greater than zero represent the number of additional seconds after the watchdog_tmo Motion will wait until camera processes are forcefully terminated. Forceful termination of camera processes will result in memory leaks and detrimental effects therefore the default is to completely terminate the application let external processes such as systemctl or cron jobs restart Motion.
- Values: String | Default: Not defined The full path and file name with the configuration parameters for the individual camera.
- Values: String | Default: Not defined Directory containing individual device configuration files. Any files ending in '.conf' in the directory will be read as a device configuration file.
- Values: String | Default: Not Defined The v4l2 device to be used for capturing.
- Values: String | Default: Not Defined Comma separated list of configuration parameters (aka controls) for the v4l2 device.
- Log: [INF][VID][01:ml01:cam01] v4l2_ctrls_log: ID09963776 : Brightness : 0 to 255
- Example 1:
v4l2_params Brightness=130,palette=15 - Example 2:
v4l2_params "Brightness"=130,palette=15 - Example 3:
v4l2_params ID09963776=130,palette=15 - Values: 0 - 20 | Default: 17 Preferred color palette for Motion to use for the device. See table below for the meaning of each parameter number value.
- Values: Integer | Default: -1 Input channel for the v4l2 device. Use -1 for web cams.
- Values: 0-3: | Default: 0 The TV norm to use for the device (PAL, NTSC, SECCAM, PAL-BW)
- Values: Long | Default: 0 The tuner frequency to use for the device.
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: String | Default: Not Defined The libcamera device. The value of 'camera0' is the only currently supported device.
- Values: String | Default: Not Defined Comma separated list of configuration parameters (aka controls) for the libcamera device.
- Identity
- Rot0
- HFlip
- VFlip
- HVFlip
- Rot180
- Transpose(not currently supported by libcamera)
- Rot270(not currently supported by libcamera)
- Rot90(not currently supported by libcamera)
- Rot180Transpose
- MeteringCentreWeighted = 0
- MeteringSpot = 1
- MeteringMatrix = 2
- MeteringCustom = 3
- ConstraintNormal = 0
- ConstraintHighlight = 1
- ConstraintShadows = 2
- ConstraintCustom = 3
- ExposureNormal = 0
- ExposureShort = 1
- ExposureLong = 2
- ExposureCustom = 3
- AwbAuto = 0
- AwbIncandescent = 1
- AwbTungsten = 2
- AwbFluorescent = 3
- AwbIndoor = 4
- AwbDaylight = 5
- AwbCloudy = 6
- AwbCustom = 7
- Red | Blue
- var1|var2|var3|var4
- var1|var2|var3|var4|var5|var6|var7|var8|var9
- x|y|height|width
- min|max
- AfModeManual = 0
- AfModeAuto = 1
- AfModeContinuous = 2
- AfRangeNormal = 0
- AfRangeMacro = 1
- AfRangeFull = 2
- AfSpeedNormal = 0
- AfSpeedFast = 1
- AfMeteringAuto = 0
- AfMeteringWindows = 1
- x|y|height|width
- AfTriggerStart = 0
- AfTriggerCancel = 1
- AfPauseImmediate = 0
- AfPauseDeferred = 1
- AfPauseResume = 2
- AfStateIdle = 0
- AfStateScanning = 1
- AfStateFocused = 2
- AfStateFailed = 3
- AfPauseStateRunning = 0
- AfPauseStatePausing = 1
- AfPauseStatePaused = 2
- AePrecaptureTriggerIdle = 0
- AePrecaptureTriggerStart = 1
- AePrecaptureTriggerCancel = 2
- NoiseReductionModeOff = 0
- NoiseReductionModeFast = 1
- NoiseReductionModeHighQuality = 2
- NoiseReductionModeMinimal = 3
- NoiseReductionModeZSL = 4
- ColorCorrectionAberrationOff = 0
- ColorCorrectionAberrationFast = 1
- ColorCorrectionAberrationHighQuality = 2
- AeStateSearching = 1
- AeStateConverged = 2
- AeStateLocked = 3
- AeStateFlashRequired = 4
- AeStatePrecapture = 5
- AwbStateInactive = 0
- AwbStateSearching = 1
- AwbConverged = 2
- AwbLocked = 3
- LensShadingMapModeOff = 0
- LensShadingMapModeOn = 1
- TestPatternModeOff = 0
- TestPatternModeSolidColor = 1
- TestPatternModeColorBars = 2
- TestPatternModeColorBarsFadeToGray = 3
- TestPatternModePn9 = 4
- TestPatternModeCustom1 = 256
- Values: String | Default: Not defined URL associated with the network camera.
- Values: String | Default: Not Defined Comma separated list of configuration parameters. Format is: option=value,option2=value2
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: String | Default: Not defined URL associated with the high resolution stream of the network camera. This option is typically used with the movie_passthrough to minimize CPU usage. The netcam_url specifies a low resolution stream which is decoded and processed and the movies are saved directly from the data provided from the netcam_high_url without decoding or processing it.
- Values: String | Default: Not Defined Comma separated list of configuration parameters. Format is: option=value,option2=value2
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: String | Default: Not defined Username and password for the network camera specified as username:password.
- Values: Integer | Default: 640 The width of the image in pixels. Must be a multiple of 8.
- Values: Integer | Default: 480 The height of the image in pixels. Must be a multiple of 8.
- Values: 2 - 100 | Default: 15 The number of frames to be processed per second for motion detection.
- Values: 0, 90, 180, 270 | Default: 0 Rotate image the given number of degrees.
- Values: none, vertical, horizontal | Default: none Flip the image according to specified axis.
- Values: on, off, preview | Default: off Locate and draw around/on the moving object. Preview only applies to pictures.
- Values: box, redbox, cross, redcross | Default: box Set the look and style of the locate mode.
- Values: String | Default: Not defined User defined text overlaid in the lower left corner.
- Values: String | Default: %Y-%m-%d\\n%T User defined text overlaid in the lower right corner.
- Values: on, off | Default: off Show the number of pixels that changed in the upper right corner.
- Values: 1 - 10 | Default: 1 Scale factor for text drawn on images.
- Values: String | Default: %Y%m%d%H%M%S Creates conversion specifier %C
- Values: on, off | Default: off Always save images even if there was no motion
- Values: Integer | Default: 1500 Minimum number of changed pixels that triggers an event.
- Values: Integer | Default: 0 Maximum number of changed pixels that triggers an event. If the number of changed pixels is over the threshold maximum, no event is triggered. A value of zero disables threshold_maximum.
- Values: on, off | Default: off Continuously adjust the threshold for triggering an event.
- Values: Integer | Default: 0 The maximum standard deviation of the changed pixels in the x (width) axis.
- Values: Integer | Default: 0 The maximum standard deviation of the changed pixels in the y (height) axis.
- Values: Integer | Default: 0 The maximum standard deviation of the changed pixels in the x (width) and y(height) axis.
- Values: Integer | Default: The maximum ratio comparing the pixels that went white to black and vice versa.
- Values: Integer | Default: The minimum change in the ratio to trigger a event.
- Values: haar, hog, dnn | Default: Not Defined The secondary detection method.
- Values: String | Default: Not Defined Comma separated list of configuration parameters for the camera. Format is option=value,option2=value2
- Values: Integer | Default: 5 The interval of images between processing using the secondary method. This works in conjunction with the framerate. For example, a frame_interval of 5 with a framerate of 30 means secondary processing will be at 6 fps while a frame_interval of 60 would have secondary processing every other second.
- Values: String | Default: Not Defined Full path and file name for the model file associated with the secondary model.
- Values: full, grey, roi | Default: full Process full color image, the full grey image or just the region of interest(roi).
- Values: Integer | Default: 0 Rotation of image when being processed through secondary detection model.
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: String | Default: Not Defined
- Values: 1 - 255 | Default: 32 The minimum amount of change in a single pixel before it is counted towards the threshold value.
- Values: on, off | Default: on Continuously adjust the noise_level parameter.
- Values: Combinations of E,e,D,d and l | Default: EedDl Despeckle the image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling. This reduces noise in the motion image. Adding a trailing l enables labeling in which only the largest section section is used to calculate the threshold.
- Values: String | Default: Not defined Detect motion in predefined areas (1 - 9) and when Motion is detected in the area, execute the script. This option is only to execute the on_area_detect script. Areas are numbered like
- 1 2 3
- 4 5 6
- 7 8 9
- Values: String | Default: Not defined The full path and filename for the masking pgm file. If needed, the mask will be resized to match the width and height of the image. The areas in the mask file colored black will be excluded from motion detection. Shades of grey on the mask will diminish the detection while areas of white will not have any impact on motion detection.
- Values: String | Default: Not defined The full path and filename for the privacy masking pgm file. This mask completely removes the indicated sections of the image.
- Values: 0 - 10 | Default: 0 The smartmask is intended to be a dynamic, self-learning mask to decrease sensitivity in areas with frequent motion. The speed specified by this parameter is how quickly the mask gets adjusted. Zero disables the smart mask
- Values: 0 - 100 | Default: 0 The minimum change in the portion of the image that will trigger a lightswitch condition
- Values: Integer | Default: 5 The number of frames to ignore when the lightswitch condition is triggered (see above).
- Values: Integer | Default: 1 The number of frames that must contain motion in order to trigger an event.
- Values: Integer | Default: 60 The seconds of no motion detection that triggers the end of an event.
- Values: Integer | Default: 3 The number of pre-captured (buffered) frames to be captured before an event.
- Values: Integer | Default: 10 The number of frames to be captured after an event has ended.
- Values: Integer | Default: Number of seconds before a new object is included in the reference image.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed at the start of an event.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed at the end of an event.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed when a picture is saved.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed when motion is detected.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed when motion is detected in the area specified.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed at the creation of a movie.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed when a movie ends.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed when the camera is no longer detected.
- Values: String | Default: Not defined The full path and file name of the program/script to be executed when a previously lost camera is active again.
- Values: String | Default: Not Defined The full path and file name of the program/script to be executed when secondary detection occurs.
- Values: String | Default: Not Defined The full path and file name of the program/script to be executed when user selects the user action from the web interface.
- Values: String | Default: Not Defined The full path and file name of the program/script to be executed when a sound alert is triggered.
- Values: on, off, first, best | Default: off 'on' saves all motion images during an event. 'first' saves only the first image that detected motion. 'best' saves image with most changed pixels.
- Values: on, off, roi | Default: off Save the motion(debug) pictures with the pixels that change as a graytone image. If labeling is enabled via the despeckele option, the largest area will be blue and areas in red are those determined by the smartmask option. The option of 'roi' provides a smaller normal image of just the section that caused the motion. i.e. The Region Of Interest).
- Values: jpeg, webp, ppm | Default: jpeg The type of picture file to output.
- Values: 1 - 100 | Default: 75 The image quality for the jpeg or webp images in percent. The value of 1 is worst and 100 is best.
- Values: String | Default: Not defined The text for the JPEG EXIF comment with the EXIF timestamp.
- Values: String | Default: %v-%Y%m%d%H%M%S-%q The file name and optionally the path for the pictures relative to target_dir. The file extension will be added based upon the picture_type.
- Values: Integer | Default: 0 The number of seconds between snapshots
- Values: String | Default: %v-%Y%m%d%H%M%S-snapshot The file name and optionally the path for the snapshots relative to target_dir. The file extension is automatically added. A symbolic link called lastsnap.jpg is created in the target_dir and will always point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
- Values: on, off | Default: on Encode movies of the motion events.
- Values: on, off | Default: off Encode movies that show the pixels that changed. If labeling is enabled via the despeckle option, the largest area will be in blue. If smartmask is enabled it will be shown in red. The filename will be the same as normal movies except with an 'm' appended.
- Values: Integer | Default: 120 The maximum length of a movie in seconds. Set this to zero for unlimited length.
- Values: Integer | Default: 400000 Bitrate to use in encoding of movies. This option is ignored if movie_quality is specified.
- Values: 0 - 100 | Default: 60 A value of 0 disables this option while values 1 - 100 change the quality of the movie. The value of 1 means worst quality and 100 is the best quality. High values of this option (e.g. 100) may cause difficulty with some players.
- Values: flv, ogg, webm, mp4, mkv, hevc, mov | Default: mkv Container/Codec to be used for the video. Preferred codec can be appended e.g.
- Values: on, off | Default: off Retain movie only if the secondary detection occurred.
- Values: on, off | Default: off When using a RTSP, RTMP, mjpeg and some V4l2 cameras, create movie files with the packets obtained directly from the camera.
- Values: String | Default: %v-%Y%m%d%H%M%S The file name and optionally the path for the movie relative to target_dir. The file extension is automatically added based upon the container.
- Values: on, off | Default: off Specifies whether to send the pictures to pipe for external encoding into a movie.
- Values: String | Default: Not defined The program name and options for processing the images.
- Values: on, off | Default: on Specifies whether to send all frames for encoding during an event instead of just those associated with motion or pre/post capture.
- Values: Integer | Default: 0 Interval in seconds for saving a picture into timelapse movie. Zero disables timelapse.
- Values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual | Default: daily File rollover mode of the timelapse video.
- Values: Integer | Default: 30 The frame per second rate to use in the playback of the timelapse video.
- Values: mpg, mkv | Default: mpg Container to be used by timelapse video.
- mpg - Creates mpg file with mpeg-2 encoding. If Motion is shutdown and restarted, new pictures will be appended to any previously created file with name indicated for timelapse.
- mkv - Creates mkv file with the default encoding. If Motion is shutdown and restarted, new pictures will create a new file with the name indicated for timelapse.
- Values: String | Default: %Y%m%d-timelapse The file name and optionally the path for the timelapse movies relative to target_dir. The file extension is automatically added based upon the container.
- Values: String | Default: Not defined The video4linux video loopback device for normal images. The device would be specified in the format like /dev/video1
- Values: String | Default: Not defined The video4linux video loopback device for motion images. The device would be specified in the format like /dev/video1
- Values: 0 to 65535 | Default: 8080 The port number for the web based interface of Motion.
- Values: 0 to 65535 | Default: 0 (disabled) Second port for the web interface that does not use TLS. This allows for specifying one port that provides a TLS connection (to be used externally) while this port serves the local lan without getting certificate domain warnings.
- Values: on, off | Default: off Listen for connections from IPv6 and IPV4.
- Values: on, off | Default: on Restrict the webcontrol of Motion to the localhost.
- Values: Valid url path | Default: Not Defined Specify new base url path for the webcontrol.
- Values: 0 - 3 | Default: 2 Set the type of parameters that can be accessed via the webcontrol page.
- 0: None - No configuration parameters or actions will be available.
- 1: Limited- A limited list of parameters will be available.
- 2: Advanced - The advanced list of parameters will be available. These typically require Motion to be restarted to become effective.
- 3: Restricted - User IDs, passwords and "on_" commands.
- Values: `default` or `user` | Default: `default` The type of webcontrol interface to provide.
- The value of `default` provides a traditional web page interface using html/css.
- The value of `user` means the html will be provided by file specified in webcontrol_html
- Values: none, basic, digest | Default: none Authentication method to use for the webcontrol port
- Values: String | Default: Not defined The username and password specified as username:password
- Values: on, off | Default: off Enable SSL/TLS (https) for the webcontrol.
- Values: String | Default: Not defined Full path and file name to the certification file for SSL/TLS support. Only used when webcontrol_tls is enabled.
- Values: String | Default: Not defined Full path and file name to the key file for SSL/TLS support. Only used when webcontrol_tls is enabled.
- Values: String | Default: Not defined Comma separated list of headers=values for the webcontrol. Use Access-Control-Allow-Origin header to specify the CORS header.
- Values: String | Default: Not defined Comma separated list of the actions=values to allow and show on the web control page. The following parameters are recognized.
- pause: Applies for Pause On, Pause Off and Pause schedule actions
- event: Applies for both Start Event and End Event actions
- snapshot
- camera_add
- camera_delete
- ptz: Applies for all PTZ commands
- stop
- restart
- action_user
- config_write
- config: Applies for any and all configuration parameters
- movies: Show page of recorded movies on webcontrol for downloading (requires database functionality)
- Values: String | Default: Not defined The file name for a user specified html page to use as the webcontrol. The file must be placed in a subdirectory from the motion.conf file called webcontrol. e.g. if the
- Values: Integer | Default: 3 Number of permitted attempts to log in before triggering lockout.
- Values: Integer | Default: 10 Number of minutes that the IP will be locked out from further attempts to log in.
- Values: String | Default: Not Defined Script to execute when a lockout has been triggered. Two additional parameters are passed to this script when executed. The number of times the userid failed as well as the IP address attempting to log in.
- Values: Integer | Default: 100 The percentage to scale the stream image when it is placed on the webcontrol page or into the combined image when the stream_preview_method is set to combined.
- Values: on, off | Default: off Insert a new line indicator prior to the image on the webcontrol web page. Note that this parameter is ignored when the stream_preview_method is set to combined.
- Values: String | Default: Not Defined Comma separated parameters for the video streams and consolidated image. The consolidated image puts together a single image of all the cameras currently running. Format is parm1=value1,parm2=value2 etc.
- Values: positive integers | Default: Not Defined On the consolidated image, the row number that the image will be shown. Row numbers are counts of images on the page and not pixels. For example, if there are six cameras running and they are all stacked on top of each other on the page, the last image will be at row 6 (Not image1 height + image2 height + ...image 5 height)
- Values: positive integers | Default: Not Defined On the consolidated image, the column number that the image will be shown. Column numbers are counts of images on the page and not pixels. For example, if there are six cameras running and they are all put side by side on the page, the last image will be at column 6 (Not image1 width + image2 width + ...image 5 width)
- Values: positive and negative integers | Default: 0 On the consolidated image, Motion will arrange the image of the camera into the row and columns indicated by the other parameters. After the image is positioned, Motion centers the image in the row and column grid space. This parameter allows the user to move the image to the left(negative values) or right(positive values) from that center position. This parameter is in pixels.
- Values: positive and negative integers | Default: 0 On the consolidated image, Motion will arrange the image of the camera into the row and columns indicated by the other parameters. After the image is positioned, Motion centers the image in the row and column grid space. This parameter allows the user to move the image up (negative values) or down(positive values) from that center position. This parameter is in pixels.
- camera1 configuration:
stream_preview_params row=3,col=1 - camera2 configuration:
stream_preview_params row=1,col=2 - camera3 configuration:
stream_preview_params row=3,col=3 - camera4 configuration:
stream_preview_params row=1,col=1 - camera5 configuration:
stream_preview_params row=3,col=2 - camera6 configuration:
stream_preview_params row=2,col=1 - Values: `combined`, `mjpg`, `static` | Default: `combined` This option determines the method used for displaying images on the webcontrol page.
- `mjpg`
The webcontrol page is created with a mjpg stream for each camera. This method creates a connection to the server for each camera. Note that if there are many cameras, this method may not show/refresh properly in the browser due to browser settings regarding the maximum number of concurrent connections. - `static`
The webcontrol page loops through all the cameras and refreshes the images using static jpgs. This method provides a slower refresh rate than the mjpg option but allows for a higher number of cameras to get around the browser concurrent connection limits. - `combined`
The webcontrol page uses a combined single mjpg stream. The combined single mjpg stream is constructed by Motion from all of the cameras currently running. - Values: on, off | Default: on Include the PTZ buttons on the webcontrol page.
- Values: 1 - 100 | Default: 50 JPG compression quality setting in percent for the images transferred to live stream.
- Values: on, off | Default: off Send the live stream in grey rather than color.
- Values: Integer | Default: 1 The frames per second for the webcontrol camera stream.
- Values: on, off | Default: off Limit the frames per second for the webcontrol stream to 1 when there is no motion being detected and increase to the stream_maxrate when there is motion.
- Values: Integer | Default: 5 Time in seconds to display image when in scan mode.
- Values: Integer | Default: 25 Percentage scaling factor to apply on the image when in scan mode.
- Values: mariadb, postgresql, sqlite3 | Default: sqlite3 The database type.
- Values: String The full path and file name to the Sqlite3 database. Default: motion.db in the directory defined by --localstatedir=DIR during the configure step of installation. If this was not defined, it will default to /var/lib/motion/motion.db or /usr/local/var/lib/motion/motion.db depending upon your system
- Values: String | Default: localhost The host on which the database is located
- Values: 0 - 65535 | Default: 0 The port number that is used for the database. Typical values are: MariaDB=3306 and postgresql=5432
- Values: String | Default: Not defined The user account name for database
- Values: String | Default: Not defined The user password for database
- Values: Integer | Default: 0 The time to wait before issuing a timeout message for sqlite3.
- Values: String | Default: SQL query to execute at the end of the event.
- Values: String | Default: SQL query to execute at the start of the event.
- Values: String | Default: SQL query to execute at the end of the movie.
- Values: String | Default: SQL query to execute at the start of the movie.
- Values: String | Default: SQL query to execute when a picture has been saved.
- Values: on,off Default: off Enable automatic tracking.
- Values: Integer | Default: 0 Time in seconds to wait after a PTZ script is called before resuming motion detection.
- Values: String | Default: Not Defined Full path and file name for script to execute for auto tracking.
- Values: String | Default: Not Defined Full path and file name for script to pan the camera left.
- Values: String | Default: Not Defined Full path and file name for script to pan the camera right.
- Values: String | Default: Full path and file name for script to tilt the camera up.
- Values: String | Default: Not Defined Full path and file name for script to tilt the camera down.
- Values: String | Default: Not Defined Full path and file name for script to zoom the camera in .
- Values: String | Default: Not Defined Full path and file name for script to zoom the camera out.
- Values: String | Default: Not Defined String specifying the sound device. For alsa use the format such as hw:1,0 For PulseAudio, usually leave this empty and let PulseAudio use the defaults. If a specific PulseAudio device string is known, specify using this parameter.
- Values: String | Default: Not Defined Comma separated list of configuration parameters for the sound device.
- Values: String | Default: alsa The type of source for the sound device. Currently supported sources are 'alsa' or 'pulse'.
- Values: Integer: | Default: 1 The number of audio channels for the sound device
- Values: Integer | Default: 2048 The number of bytes to read in for each frame from the sound device.
- Values: Integer | Default: 44100 The sample rate for the sound device.
- Values: String | Default: Not defined The override name of the pulse server to use.
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: String | Default: Not Defined Comma separated list of configuration parameters for the criteria of each alert. Multiple specifications of this parameter are permitted.
- Values: Integer | Default: The unique number associated with the alert.
- Values: Integer | Default: 0 The minimum volume level required to be start the detection process
- Values: Integer | Default: 100 The minimum number of times that the frequency must be detected above the volume_level before triggering event.
- Values: Float | Default: 0 The minimum frequency associated with the detection.
- Values: Float | Default: 10000 The maximum frequency associated with the detection.
- Values: Integer | Default: 10 The duration that must occur in seconds between triggered events before resetting. This prevents a perpetual stream of on_sound_event being triggered upon a constant sound. The sound frequency must not occur for at least trigger_duration seconds before a new on_sound_event is triggered for that particular alert.
- Values: Integer | Default: 10 The number of times that the alert must be triggered before invoking the on_sound_event
- Values: String | Default: Not defined The description associated with the alert.
- Values: String | Default: Not Defined Full path and file name for a file containing the params listed one per line.
- Values: hamming, hann, none | Default: hamming The sound frequency detection window function method to use.
- Values: boolean | Default: off Write to the log the frequencies being detected.
Conversion Specifiers
| %Y | year | %m | month | %d | day |
| %H | hour | %M | minute | %S | second |
| %T | HH:MM:SS | %v | event | %q | frame number |
| %t | device id number | %D | changed pixels | %N | noise level |
| %w | width of the image | %h | height of the image | %i | width of motion area |
| %J | height of motion area | %K | X coordinates of motion center | %L | Y coordinates of motion center |
| %C | value defined by text_event | %f | filename with full path | %n | number indicating filetype |
| %o | threshold | %Q | Number of labels from despeckle | %{eventid} | Unique identifier for event (cam id + date/time) |
| %$ | device name | %{fps} | current frames per second | %{host} | name of computer running Motion |
| %{ver} | version of Motion | %{trig_nbr} | sound alert number that was triggered | %{trig_nm} | sound alert name that was triggered |
| %{trig_freq} | frequency that triggered the sound alert | %{movienbr} | id number for the movie within the event |
System Processing
daemon
pid_file
log_file
log_level
At the DBG Level(8) and higher:
Additional values related to the trigger, motion, precap and postcap are overlayed on the images.
Additional information regarding the available parameters to libcamera are printed to the log.
Additional information regarding the available parameters to v4l2 devices is printed to the log.
If a secondary detection algorithms is specified:
The image sent to the secondary algorithm for detection will be saved to the target directory with the name src_"algorithm".jpg e.g. src_haar.jpg
If the secondary algorithm is triggered by the image, the resulting image will be saved into the target directory with the name detect_"algorithm".jpg e.g. detect_haar.jpg
log_fflevel
log_type
native_language
target_dir
device_name
device_id
device_tmo
pause
schedule_params
-
This parameter specifies the time of the day that Motion will perform
motion detection. To use this, the pause parameter must be set to schedule.
default
Boolean specifying the default for the motion detection. The times specified for the other parameters will then indicate the times for the inverse of this option. For example, if the default is specified ason, then motion
detection will be on by default and the times specified will have motion detection
turned off. And if the default is specified as off the
times specified would indicate when motion detection would be on.
action
This parameter has the option values ofpause or
stop. When the pause value
is specified the motion detection is paused and the camera will continue to process
images. This will allow the webcontrol to continue to show
images. When this option is specified as stop, the
camera will be shut down and therefore images will not be available via the
webcontrol.
sun, mon, tue, wed, thu, fri, sat
These parameters specify the day and the values specify the time period. The time period is specified in the formathhmm-hhmm where
the first hhmm specifies the start time and the
second hhmm is the end time. If the hours or minutes is
less than 10, leading zeros must be included. Each time value is also inclusive meaning
that the criteria is greater than or equal or less than or equal. For multiple
time periods during the same day specify the parameter multiple times. For example,
wed=0905-1130,wed=1330-1605.
params_file
cleandir_params
-
This parameter specifies the information used for purging older recording and pictures created by Motion. This option
is only applicable if a database has been specified. The default for this parameter is an empty string which means that
no clean directory actions will be performed.
action
String specifying eitherdelete or script. If the option
of script is specified, then the provided script will be executed at the specified
interval. If the option of delete is specified, then all files that were created
by Motion will be deleted from the system according to the schedule. The default for this
parameter is delete
freq
This parameter specifies the frequency that the clean directory will be run. Valid options for this parameter arehourly, daily or weekly.
The default value for this parameter is weekly.
runtime
This parameter specifies the timing for running the clean directory actions. The format of this value varies depending upon the frequency specified.dur_unit
This parameter specifies the unit of duration for the criteria used to select files. Valid options for this parameter arem, h,d or w. For
minutes, hours, days or weeks. The default value for this parameter is d. As an
example, if the dur_unit=d
and the dur_val=7 then all files older than 7 days would be deleted.
dur_val
This parameter specifies the number associated with the duration units for the criteria used to select files. The default value for this parameter is7. As an example, if the dur_unit=d
and the dur_val=7 then all files older than 7 days would be deleted.
removedir
This parameter is a boolean that specifies whether the associated directory (only one level up) should be removed if there are no longer any files in it after the clean process has run. If there are other files in the directory that are not created by Motion, then the directory will not be removed.script
This parameter specifies the full path to a script to run at the scheduled time.params_file
watchdog_tmo
watchdog_kill
camera
config_dir
Devices
v4l2_device
v4l2_params
-
The configuration parameters for v4l2_params are specified by name or ID. They may also be
enclosed in double quotes. Review the Motion log with log_level 8 to see the options that
are applicable to the device. The following is a sample output from the log and
examples of how to specify the parameters
palette
| V4l2 Option | FOURCC | palette option |
| V4L2_PIX_FMT_SN9C10X | S910 | 0 |
| V4L2_PIX_FMT_SBGGR16 | BYR2 | 1 |
| V4L2_PIX_FMT_SBGGR8 | BA81 | 2 |
| V4L2_PIX_FMT_SPCA561 | S561 | 3 |
| V4L2_PIX_FMT_SGBRG8 | GBRG | 4 |
| V4L2_PIX_FMT_SGRBG8 | GRBG | 5 |
| V4L2_PIX_FMT_PAC207 | P207 | 6 |
| V4L2_PIX_FMT_PJPG | PJPG | 7 |
| V4L2_PIX_FMT_MJPEG | MJPG | 8 |
| V4L2_PIX_FMT_JPEG | JPEG | 9 |
| V4L2_PIX_FMT_RGB24 | RGB3 | 10 |
| V4L2_PIX_FMT_SPCA501 | S501 | 11 |
| V4L2_PIX_FMT_SPCA505 | S505 | 12 |
| V4L2_PIX_FMT_SPCA508 | S508 | 13 |
| V4L2_PIX_FMT_UYVY | UYVY | 14 |
| V4L2_PIX_FMT_YUYV | YUYV | 15 |
| V4L2_PIX_FMT_YUV422P | 422P | 16 |
| V4L2_PIX_FMT_YUV420 | YU12 | 17 |
| V4L2_PIX_FMT_Y10 | Y10 | 18 |
| V4L2_PIX_FMT_Y12 | Y12 | 19 |
| V4L2_PIX_FMT_GREY | GREY | 20 |
input
norm
frequency
params_file
libcam_device
libcam_params
Transform(string)
(These are libcamera transform and rotate options and may not provide result you anticipate.)AeEnable(bool)
AeLocked(bool)
AeMeteringMode(int)
AeConstraintMode(int)
AeExposureMode(int)
ExposureValue(float)
ExposureTime(int)
AnalogueGain(float)
Brightness(float)
Contrast(float)
Lux(float)
AwbEnable(bool)
AwbMode(int)
AwbLocked(bool)
ColourGains(Pipe delimited)
ColourTemperature(int)
Saturation(float)
SensorBlackLevels(Pipe delimited)
Sharpness(float)
FocusFoM(int)
ColourCorrectionMatrix(Pipe delimited)
ScalerCrop(Pipe delimited)
DigitalGain(float)
FrameDuration(int)
FrameDurationLimits(Pipe delimited)
SensorTemperature(float)
SensorTimestamp(int)
AfMode(int)
AfRange(0-2)
AfSpeed(int)
AfMetering(int)
AfWindows(Pipe delimited)
AfTrigger(int)
AfPause(int)
LensPosition(float)
AfState(int)
AfPauseState(int)
AePrecaptureTrigger(int)
NoiseReductionMode(int)
ColorCorrectionAberrationMode(int)
AeState(int)
AwbState(int)
SensorRollingShutterSkew(int)
LensShadingMapMode(int)
PipelineDepth(int)
MaxLatency(int)
TestPatternMode(int)
netcam_url
netcam_params
-
Motion uses the ffmpeg libraries to process network cameras. This option is
a comma separated list of the ffmpeg options for the camera. In addition
to the ffmpeg options, Motion includes the following additional options.
capture_rate
The number of frames per second to capture from the camera. This option should be slightly higher than the FPS that the camera is sending image. Users can also specify the capture_rate aspts. When using pts as the capture_rate Motion will sync the timing
of the capture to match between the clock and the presentation time stamps sent from the camera.
decoder
The ffmpeg hardware decoder to use. Note that not all of the hardware decoders provided by ffmpeg are available. The only hardware decoders are those that do not require customization of library usage. The ffmpeg libraries on the computer must usually be built from source in order to enable hardware decoding.interrupt
The duration in seconds permitted for the library functions to respond. For the initial connection to the camera, the maximum duration is set equal to three times the interrupt specified. The default is 90 seconds.input_format
The ffmpeg input format to use for the network camera. For cameras using http/https the input_format defaults to mjpeg. Another common option for this parameter with a http/https stream would be mpegts.params_file
netcam_high_url
netcam_high_params
-
Motion uses the ffmpeg libraries to process network cameras. This option is
a comma separated list of the ffmpeg options for the stream specified by netcam_high_url. In addition
to the ffmpeg options, Motion includes the following additional options.
capture_rate
The number of frames per second to capture from the camera. This option should be slightly higher than the FPS that the camera is sending images. Users can also specify the capture_rate aspts. When using pts as the capture_rate Motion will sync the timing
of the capture to match between the clock and the presentation time stamps sent from the camera.
input_format
The ffmpeg input format to use for the network camera. For cameras using http/https the input_format defaults to mjpeg. Another common option for this parameter with a http/https stream would be mpegts.params_file
netcam_userpass
Image Processing
width
height
framerate
rotate
flip_axis
locate_motion_mode
locate_motion_style
text_left
text_right
text_changes
text_scale
text_event
Motion Detection
emulate_motion
threshold
threshold_maximum
threshold_tune
threshold_sdevx
threshold_sdevy
threshold_sdevxy
threshold_ratio
threshold_ratio_change
secondary_method
secondary_params
-
This option is a comma separated list of the secondary detection model options. In addition to the
options for each of the models, Motion includes the following additional options.
frame_interval
model_file
image_type
rotate
params_file
threshold
scalefactor
minsize
maxsize
padding
threshold_model
winstride
flags
minneighbors
config
classes_file
framework
backend
target
scale
width
height
noise_level
noise_tune
despeckle_filter
area_detect
mask_file
mask_privacy
smart_mask_speed
lightswitch_percent
lightswitch_frames
minimum_motion_frames
event_gap
pre_capture
post_capture
static_object_time
Script Execution
on_event_start
on_event_end
on_picture_save
on_motion_detected
on_area_detected
on_movie_start
on_movie_end
on_camera_lost
on_camera_found
on_secondary_detect
on_action_user
on_sound_alert
Output - Picture Options
picture_output
picture_output_motion
picture_type
picture_quality
picture_exif
picture_filename
snapshot_interval
snapshot_filename
Output - Movie Options
movie_output
movie_output_motion
movie_max_time
movie_bps
movie_quality
movie_container
mkv:libx265
movie_retain
movie_passthrough
movie_filename
movie_extpipe_use
movie_extpipe
movie_all_frames
timelapse_interval
timelapse_mode
timelapse_fps
timelapse_container
timelapse_filename
Output - Pipe Options
video_pipe
video_pipe_motion
Web Control
These options must be placed in the Motion.conf file and not in a camera config files.webcontrol_port
webcontrol_port2
webcontrol_ipv6
webcontrol_localhost
webcontrol_base_path
webcontrol_parms
webcontrol_interface
webcontrol_auth_method
webcontrol_authentication
webcontrol_tls
webcontrol_cert
webcontrol_key
webcontrol_headers
webcontrol_actions
webcontrol_html
motion.conf file is located
at /var/lib/motion/motion.conf, the webcontrol
page must be located in the directory
/var/lib/motion/webcontrol. Additionally, any files
in the webcontrol directory with an extension of html, json, js or css will also
be available as resources to the user html page.
webcontrol_lock_attempt
webcontrol_lock_minutes
webcontrol_lock_script
Live Stream
stream_preview_scale
Numbers greater than 100 are permitted.
stream_preview_newline
stream_preview_params
row
col
offset_col
offset_row
Illustrative sample:
Two cameras on first row, one camera on second row, three cameras on third row.stream_preview_method
stream_preview_ptz
stream_quality
stream_grey
stream_maxrate
stream_motion
stream_scan_time
stream_scan_scale
Database
Only one database can be used by Motion at a time. These options must be placed in the Motion.conf file and not in a camera config files.database_type
database_dbname
database_host
database_port
database_user
database_password
database_busy_timeout
sql_event_end
sql_event_start
sql_movie_end
sql_movie_start
sql_pic_save
Tracking
ptz_auto_track
ptz_wait
ptz_move_track
ptz_pan_left
ptz_pan_right
ptz_tilt_up
ptz_tilt_down
ptz_zoom_in
ptz_zoom_out
Sound
snd_device
snd_params
-
The configuration parameters for snd_device
source
channels
frames
sample_rate
pulse_server
params_file
snd_alerts
-
The configuration parameters for each alert associated with the sound detection. Multiple alerts can be specified
and each one can be set up to check for a different frequency. The following are the parameters that are specified
on each alert.
alert_id
volume_level
volume_count
freq_low
freq_high
trigger_duration
trigger_threshold
alert_nm
params_file
snd_window
snd_show
Command Line Options
- -c : Full path and filename of config file.
- -h : Show help screen
- -b : Run in daemon mode
- -n : Run in non-daemon mode
- -d : Run with message log level 1 - 9
- -k : Run with message log type 1 - 9
- -l : Full path and file name for log file
- -p : Full path and file name for the process id file
- -m : Start in pause mode
Motion [ -hbnsm ] [ -c config file path ] [ -d level ] [ -k level ] [ -p pid_file ] [ -l log_file ]
The Configuration Files
-
Motion will search for the configuration file called 'Motion.conf' in the following order:
- Current directory where Motion was invoked
- The directory called '.Motion' in the current users home directory
- The sub directory of lib/Motion from the directory defined by --localstatedir=DIR during the configure step of installation. If this was not defined, it will default to /var/lib/Motion or /usr/local/var/lib/Motion depending upon your system
- The directory defined by --sysconfdir=DIR during the configure step of installation. If this was not defined, it will default to /etc/Motion or /usr/local/etc/Motion depending upon your system. Please note that the use of this directory for the configuration files is deprecated. Some significant functionality of Motion will not be available if the configuration files are in this directory.
Signals
-
A signal can be sent from the command line by typing
e.g.
kill -s SIGHUP pid, where the last parameter is the process ID for Motion.
| Signal | Description |
|---|---|
| SIGHUP | The config file will be reread. |
| SIGTERM | If needed Motion will create an movie file of the last event and exit |
| SIGUSR1 | Motion will create an movie file of the current event. |