Basic Setup
-
MotionPlus is able to process images from many different types of cameras. The following is brief overview
of the process to set up the MotionPlus software.
- Determine the type of camera
- Specify the camera in the configuration files.
- Start MotionPlus from a terminal via the command line
- Review the messages to ensure camera was found and press cntrl-c to exit
- Specify a target_dir in the configuration file.
- Enable the web control in the configuration file
- Specify a webcontrol_port
- Optionally turn off webcontrol_localhost if you want to view the webcontrol from a different computer
- Specify which parameters to show on the webcontrol via webcontrol_parms
- Optionally specify a stream_preview_method
- Refine how the image is captured with the image processing parameters
- Specify the motion detection parameters
- Execute scripts, Save pictures or movies.
- Specify stream_preview_method
- Specify webcontrol_parms
- Start MotionPlus and in a web browser navigate to the webcontrol port
- Try adjusting the threshold, noise_level, despeckle_filter and smart_mask_speed
- Make sure to write configuration to file in order to save any changes.
ffmpeg -re -i mymovie.mp4 -f v4l2 /dev/video0 Then in a separate terminal, start Motion
with it set to use the /dev/video0 device as input. This method can can also be used to
reformat the content to a different format. The following outputs the original movie into a gray pixel format.
ffmpeg -re -i mymovie.mp4 -f v4l2 -pix_fmt gray /dev/video0
This can be helpful as a interim process where ffmpeg supports a particular input but that format is not yet supported
by MotionPlus.
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
- -s : Run in setup mode. Also forces 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
motionplus [ -hbnsm ] [ -c config file path ] [ -d level ] [ -k level ] [ -p pid_file ] [ -l log_file ]
The Configuration Files
-
MotionPlus can be invoked with command line option
- Current directory where MotionPlus was invoked
- The directory called '.motionplus' in the current users home directory
- The directory defined by --sysconfdir=DIR during the configure step of installation. If this was not defined, it will default to /etc/motion
-c pathname to specify a specific
configuration file. If the -c option is not specified, MotionPlus will search for the
configuration file called 'motionplus.conf' in the following order:
write configuration option from the webcontrol.
Parameters in distributed configuration files
Since MotionPlus includes over 150 parameters, only a limited subset of the configuration parameters
are included in the sample files. To list all options, use the webcontrol interface to write out
the configuration file.
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 MotionPlus.
| Signal | Description |
|---|---|
| SIGHUP | The config file will be reread. |
| SIGTERM | If needed MotionPlus will create an movie file of the last event and exit |
| SIGUSR1 | MotionPlus will create an movie file of the current event. |
Useful Tips
Persistent v4l2 devices
-
Since the exact device number is set by the kernel upon boot, when there is more than one video device
it is possible that the particular cameras that were assigned to /dev/video0 and /dev/video1 may switch. In
order to set up MotionPlus so that a particular camera is always assigned the same way, users can set up
a symbolic link using udev rules. To do this a unique attribute must be identified for each camera. The
camera attributes can be viewed by using the command
udevadm info -a -p $(udevadm info -q path -n /dev/video0) while the camera is attached. Usually
a serial number can be used. ("Usually" because some cameras have been observed to have the same serial
number for different cameras)
Once a unique attribute has been identified for each camera, edit or create the file
/etc/udev/rules.d/99-local.rules.
Assuming that the unique attribute for the camera was name and was
ATTR{name}=="Philips SPC 900NC webcam" you would add the following line to the
99-local.rules file:
KERNEL=="video[0-9]*", ATTR{name}=="Philips\ SPC\ 900NC*", SYMLINK+="video-webcam0"
Once the change has been made and saved, reboot the computer and there should now be a "sticky" device called
/dev/video-webcam0
Configuration Options-Listed Alphabetically
-
These are the options that can be used in the config file.
Some configuration options are only used if MotionPlus is built on a system that has the matching software installed (MariaDB, PostgreSQL, SQLite, etc).
Configuration Options-Listed by Topic
-
These are the options that can be used in the config file.
Some configuration options are only used if MotionPlus is built on a system that has the matching software libraries installed (MariaDB, PostgreSQL, SQLite, FFMPEG, etc).
System Processing-General Info
| daemon | setup_mode | pid_file | log_file |
| log_level | log_type | native_language | target_dir |
| camera_name | camera_id | camera | camera_dir | camera_tmo | watchdog_tmo | watchdog_kill |
| v4l2_device | v4l2_params | mmalcam_name | mmalcam_params |
| netcam_url | netcam_params | netcam_high_url | netcam_high_params |
| netcam_proxy |
| width | height | framerate | minimum_frame_time |
| rotate | flip_axis | locate_motion_mode | locate_motion_style |
| text_left | text_right | text_changes | text_scale |
| text_event |
| 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 |
| 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_method | stream_preview_ptz |
| stream_quality | stream_grey | stream_maxrate | stream_motion |
| stream_scan_time | stream_scan_scale |
Configuration Options-Detail Descriptions
-
The following section provides detailed descriptions of each of the configuration options.
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Range / Valid values: 1 - 9
- Default: 6
- Type: Discreet Strings
- Range / Valid values: See Below
- Default: ALL
- Type: Boolean
- Range / Valid values: on, off
- Default: on
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined = current directory
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Range / Valid values: 1 - 32000
- Default: The sequence that the camera file is read
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values: Max 4095 characters
- Default: /dev/video0
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Range / Valid values: 0 - 20
- Default: 17
- Type: Integer
- Range / Valid values: -1, 0 - ?
- Default: -1
- Type: Integer
- Range / Valid values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no color)
- Default: 0 (PAL)
- Type: Integer
- Range / Valid values: 0 - 999999
- Default: 0 (Not set)
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ---------Controls---------
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: V4L2 ID Name and Range
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963776 Brightness, 0 to 127
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963777 Contrast, 0 to 63
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963778 Saturation, -100 to 100
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963788 White Balance, Automatic, 0 to 4
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 0 Indoor (Incandescant Lighting)
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 1 Outdoor (Sunlight) Mode
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 2 Indoor (Fluorescent Lighting) M
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 3 Manual Mode
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 4 Auto Mode
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963790 Red Balance, 0 to 255
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963791 Blue Balance, 0 to 255
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963792 Gamma, 0 to 31
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963793 Exposure, 0 to 255
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963794 Gain, Automatic, 0 to 1
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963795 Gain, 0 to 63
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963804 Backlight Compensation, 0 to 1
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963807 Color Effects, 0 to 1
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 0 None
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 1 Black & White
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963809 Band-Stop Filter, 0 to 1
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025216 Auto contour, 0 to 1
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025217 Contour, 0 to 63
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025218 Dynamic Noise Reduction, 0 to 3
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025219 Auto White Balance Speed, 1 to 32
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025220 Auto White Balance Delay, 0 to 63
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025221 Save User Settings, 0 to 0
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025222 Restore User Settings, 0 to 0
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025223 Restore Factory Settings, 0 to 0
- [1:ml1:c1] [INF] [VID] v4l2_ctrls_list: --------------------------
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Horizontal Flip: -hf
- Vertical Flip: -vf
- Rotation: -rot
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Range / Valid values: Device Dependent
- Default: 640
- Type: Integer
- Range / Valid values: Device Dependent
- Default: 480
- Type: Integer
- Range / Valid values: 2 - 100
- Default: 15
- Type: Integer
- Range / Valid values: 0 - 2147483647
- Default: 0
- Type: Discrete Integers
- Range / Valid values: 0, 90, 180, 270
- Default: 0 (not rotated)
- Type: Discrete Strings
- Range / Valid values: none, v, h
- Default: none (no change)
- Type: Discrete Strings
- Range / Valid values: on, off, preview
- Default: off
- Type: Discrete Strings
- Range / Valid values: box, redbox, cross, redcross
- Default: box
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: %Y-%m-%d\\n%T
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Integer
- Range / Valid values: 1 - 10
- Default: 1
- Type: String
- Range / Valid values: Max 4095 characters
- Default: %Y%m%d%H%M%S
- Type: Boolean
- Range / Valid values: on off
- Default: off
- Type: Integer
- Range / Valid values: 1 - 2147483647
- Default: 1500
- Type: Integer
- Range / Valid values: 0, 1 to unlimited
- Default: 0 (off)
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values:
- Default:
- Type: Integer
- Range / Valid values: 1 - 255
- Default: 32
- Type: Boolean
- Range / Valid values: on, off
- Default: on
- Type: String
- Range / Valid values: Combinations of E,e,D,d and l
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- 1 2 3
- 4 5 6
- 7 8 9
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Range / Valid values: 0 - 10
- Default: 0 (disabled)
- Type: Integer
- Range / Valid values: 0 - 100
- Default: 0 (disabled)
- Type: Integer
- Range / Valid values: 1 - 1000
- Default: 5
- Type: Integer
- Range / Valid values: 1 - 1000s
- Default: 1
- Type: Integer
- Range / Valid values: 0 - 2147483647
- Default: 60
- Type: Integer
- Range / Valid values: 0 - 100s
- Default: 0 (disabled)
- Type: Integer
- Range / Valid values: 0 - 2147483647
- Default: 0 (disabled)
- Type:
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type:
- Range / Valid values:
- Default:
- Type: Discrete Strings
- Range / Valid values: on, off, first, best
- Default: off
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Discrete Strings
- Range / Valid values: jpeg, webp, ppm
- Default: jpeg
- Type: Integer
- Range / Valid values: 1 - 100
- Default: 75
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: %v-%Y%m%d%H%M%S-%q
- Type: Integer
- Range / Valid values: 0 - 2147483647
- Default: 0 (disabled)
- Type: String
- Range / Valid values: Max 4095 characters
- Default: %v-%Y%m%d%H%M%S-snapshot
- Type: Boolean
- Range / Valid values: on, off
- Default: on
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Integer
- Default: 120
- Type: Integer
- Default: 400000
- Type: Integer
- Range / Valid values: 0 - 100
- Default: 60
- Type: Discrete Strings
- Range / Valid values: flv, ogg, vp8, mp4, mkv, hevc
- Default: mkv
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: String
- Range / Valid values: Max 4095 characters
- Default: %v-%Y%m%d%H%M%S
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Default: 0 (disabled)
- Type: Discrete Strings
- Range / Valid values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual
- Default: daily
- Type: Integer
- Default: 30
- Type: Discrete Strings
- Range / Valid values: mpg, mpeg4
- Default: mpg
- mpg - Creates mpg file with mpeg-2 encoding. If MotionPlus is shutdown and restarted, new pictures will be appended to any previously created file with name indicated for timelapse.
- mpeg4 - Creates avi file with the default encoding. If MotionPlus is shutdown and restarted, new pictures will create a new file with the name indicated for timelapse.
- Type: String
- Range / Valid values: Max 4095 characters
- Default: %Y%m%d-timelapse
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Default: 0 (disabled)
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Boolean
- Range / Valid values: on, off
- Default: on
- Type: String
- Valid values: Valid url path
- Default:
- Type: Integer
- Range / Valid values: 0 - 3
- Default: 0
- 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 MotionPlus to be restarted to become effective.
- 3: Restricted - User IDs, passwords and "on_" commands.
- Type: Integer
- Range / Valid values: `default`, `user`
- Default: 0
- 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
- Type: Integer
- Range / Valid values: `none`, `basic`, `digest'
- Default: 0
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: * or a valid URI
- Default: Not defined
- Type: String
- Range / Valid values:
- Default: Not defined
- pause: Applies for both Pause and Unpause actions
- event: Applies for both Start Event and End Event actions
- snapshot
- camera_add
- camera_delete
- ptz: Applies for all PTZ commands
- stop
- restart
- config_write
- config: Applies for any and all configuration parameters
- Type: String
- Range / Valid values:
- Default: Not defined
- Type: Integer
- Range / Valid values: 1 to 100s
- Default: 25
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Integer
- Range / Valid values: `mjpg`, `static`
- Default: 0
- Type:
- Range / Valid values: on, off
- Default:
- Type: Integer
- Range / Valid values: 1 - 100
- Default: 50
- Type: Boolean
- Range / Valid values: on, off
- Default: off
- Type: Integer
- Range / Valid values: 1 - 100
- Default: 1
- Type: boolean
- Range / Valid values: on, off
- Default: off
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type: String
- Range / Valid values: mariadb, postgresql, sqlite3
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: localhost
- Type: Integer
- Range / Valid values: 0 - 65535
- Default: 0
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: String
- Range / Valid values: Max 4095 characters
- Default: Not defined
- Type: Integer
- Range / Valid values: 0 - 1000's
- Default: 0
- Type: string
- Range / Valid values: string
- Default:
- Type: string
- Range / Valid values: string
- Default:
- Type: string
- Range / Valid values: string
- Default:
- Type: string
- Range / Valid values: string
- Default:
- Type: string
- Range / Valid values: string
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
- Type:
- Range / Valid values:
- Default:
Conversion Specifiers
| %Y | year | %m | month | %d | day |
| %H | hour | %M | minute | %S | second |
| %T | HH:MM:SS | %v | event | %q | frame number |
| %t | camera 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 | %{dbeventid} | See sql_query_start |
| %$ | camera name | %{fps} | current frames per second | %{host} | name of computer running Motion |
| %{ver} | The version of Motion |
System Processing
daemon
setup_mode
pid_file
log_file
log_level
log_type
native_language
target_dir
camera_name
camera_id
camera
camera_dir
camera_tmo
watchdog_tmo
watchdog_kill
Devices
v4l2_device
v4l2_params
palette
| V4l2 Option | FOURCC | v4l2_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
v4l2_params "Gain, Automatic"=1,ID09963795=50, brightness=30
a equally valid alternative method for specifying this example would be
v4l2_params ID09963794=1,ID09963795=50, ID09963776=30
or another way of specifying it could be
v4l2_params ID09963794=1,"Gain"=50, "brightness"=30
Example 2: Set the saturation to 50 and the contrast to 100
v4l2_params saturation=50,contrast=100
As can be seen in these examples, the specification can use either the control ID or the name of the
control. If the control name has embedded blanks or commas, then it must be enclosed in quotes. Special
care should be taken when using the name. As shown above, there is a comma that separates the name
of the control versus the valid range of values. That comma is NOT part of the control name and only
delimits the end of the name for the MotionPlus log.
mmalcam_name
mmalcam_params
netcam_url
netcam_params
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 as
pts. When using pts as the capture_rate MotionPlus will sync the timing
of the capture to match between the clock and the presentation time stamps sent from the camera.
netcam_high_url
netcam_high_params
netcam_userpass
Image Processing
width
height
framerate
minimum_frame_time
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_interval
secondary_method
secondary_params
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
-
MotionPlus can execute external commands based on the motion detection and related events.
They are described in the sections below.
Security Warning!
Do not enable updates to these parameters via the webcontrol_params when the webcontrol is
exposed. Also make sure that MotionPlus is not running as a super user and is instead
running under a "harmless" user.
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
Output - Picture Options
-
MotionPlus can output different types of pictures. A normal picture
as well as a "motion" or debug type of picture. The debug picture indicates
the changed pixels as well as the various masks that may be applied to the image.
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
v4l2 prefix.
Only webcams that provide mjpeg (v4l2_palette option 8)
or H264 (v4l2_palette option 21) will work with the
movie_passthrough.
When using only the single netcam_url this option will reduce the processing
required when encoding the movie file. Decoding of the image will still occur on the
image in order to process the motion detection.
When using both the netcam_url and the netcam_highres
what will occur is that normal resolution stream will be captured and decoded, when motion is detected, the
high resolution images will be captured and processed into the movie file without going through the decode/encode
processing.
This option should reduce CPU usage but does increase memory requirements.
No image processing is performed so text overlays, privacy masks etc will not be on the resulting video. The
resulting movie may also include a few extra frames at the start that would not exist if the movie was created
without the passthrough option.
Since this option bypasses the decoding of the high resolution images to reduce CPU, when images are saved via
the picture_output option, the pictures provided will be from the normal resolution stream.
movie_filename
movie_extpipe_use
movie_extpipe
movie_extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt:threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -vf denoise3d=16:12:48:4,pp=lb -of avi -o %f.avi - -fps %fps
movie_extpipe x264 - --input-res %wx%h --fps %fps --bitrate 2000 --preset ultrafast --quiet -o %f.mp4
movie_extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:fps=%fps -ovc x264 -x264encopts preset=ultrafast -of lavf -o %f.mp4 - -fps %fps
movie_extpipe ffmpeg -y -f rawvideo -pix_fmt yuv420p -video_size %wx%h -framerate %fps -i pipe:0 -vcodec libx264 -preset ultrafast -f mp4 %f.mp4
timelapse_interval
timelapse_mode
The value 'Manual' means that MotionPlus does not automatically rollover to a new filename. The 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.
timelapse_fps
timelapse_container
timelapse_filename
Output - Pipe Options
-
MotionPlus provides two pipe variations. The first option is a v4l2loopback device with normal images.
Using this pipe option, the video that is captured from the v4l2 device is piped into a new
v4l2 device using the v4l2loopback software. This piping is desired when the user wishes to
use the video device at the same time as MotionPlus is using the same device. By default, only
one application can have a device open at one time. Unlike a physical device, the videoloopback
devices take both input and output. The module simply takes anything that comes on its input
and send it out at the output.
When you install the video loopback device it will create a new device for example /dev/video1 while
the actual webcam device would be /dev/video0. You can then tell MotionPlus to open the physical
device (/dev/video0) and "pipe" the video signal to the /dev/video1. You will then be able to open
the /dev/video1 device with external videoplayers.
Installing
The video loopback device can be added installed via apt in many distributions. The package tested
with MotionPlus is v4l2loopback-dkms. Once the package is installed, you just need to run
sudo modprobe v4l2loopback. This will add a new video device that you
can use for the loopback. As needed, review the documentation of the v4l2loopback
project for additional details on set up..
To activate the vloopback device in MotionPlus set the 'video_pipe' option in the motionplus.conf
file to the device name associated with the one created by v4l2loopback.
You can also view the special motion pictures where you see the changed pixels by setting the option 'video_pipe_motion' in motionplus.conf. When setting the video_pipe and/or video_pipe_motion options specify the input device as e.g. /dev/video1. De-activating should be done with this command
sudo modprobe -r v4l2loopback
The second option for pipe is the same as the above except motion images are sent to the loopback device.