2022-07-08 15:24:45 -04:00
|
|
|
# Motion Watch #
|
|
|
|
|
|
|
|
Motion Watch is a video surveillance application that monitors the video feeds
|
|
|
|
of an IP camera and records only footage that contains motion. The main
|
|
|
|
advantage of this is reduced storage requirements as opposed to continuous
|
|
|
|
recording because only video footage of interest is recorded to storage.
|
|
|
|
|
|
|
|
### Usage ###
|
|
|
|
|
|
|
|
```
|
|
|
|
Usage: mow <argument>
|
|
|
|
|
2023-06-01 16:11:58 -04:00
|
|
|
-h : display usage information about this application.
|
|
|
|
-c : path to the config file used to run a single camera instance.
|
|
|
|
-d : path to a directory that can contain multiple config files.
|
|
|
|
each file found in the directory will be used to run a
|
|
|
|
camera instance.
|
|
|
|
-v : display the current version.
|
2022-07-08 15:24:45 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
### Config File ###
|
|
|
|
|
|
|
|
The config file is a simple text file that contain parameters that dictate the
|
|
|
|
behavior of the application. Below is an example of a config file with all
|
2022-12-24 13:48:51 -05:00
|
|
|
parameters supported and descriptions of each.
|
2022-07-08 15:24:45 -04:00
|
|
|
```
|
2022-09-23 21:50:06 -04:00
|
|
|
# Motion Watch config file
|
2022-07-08 15:24:45 -04:00
|
|
|
#
|
|
|
|
# note all lines in this config file that starts with a '#' are ignored.
|
|
|
|
# also note to avoid using empty lines. if you're going to need an empty
|
|
|
|
# line, start it with a '#'
|
|
|
|
#
|
|
|
|
recording_stream = rtsp://1.2.3.4:554/h264
|
2022-07-28 10:30:07 -04:00
|
|
|
# this is the url to the main stream of the IP camera that will be used
|
2022-08-12 21:46:36 -04:00
|
|
|
# to record footage.
|
2022-07-08 15:24:45 -04:00
|
|
|
#
|
2022-12-18 10:25:46 -05:00
|
|
|
web_root = /var/www/html
|
2022-07-08 15:24:45 -04:00
|
|
|
# this is the output directory that will be used to store recorded footage
|
2022-12-24 13:48:51 -05:00
|
|
|
# from the cameras as well as the web interface for the application.
|
|
|
|
# warning: this will overwrite any existing index.html files so be sure
|
|
|
|
# to choose a directory that doesn't have an existing website.
|
2022-07-28 10:30:07 -04:00
|
|
|
#
|
2023-07-18 18:47:14 -04:00
|
|
|
buffer_path = /tmp
|
|
|
|
# this is the work directory the app will use to store live footage and
|
|
|
|
# image frames. it's recommended to use a ram disk for this since there
|
|
|
|
# will be large amounts of io occuring here.
|
|
|
|
#
|
2022-12-18 10:25:46 -05:00
|
|
|
cam_name = cam-1
|
|
|
|
# this is the optional camera name parameter to identify the camera. this
|
2023-03-28 20:27:12 -04:00
|
|
|
# name will also be used to as the base directory in web_root. if not
|
|
|
|
# defined, the name of the config file will be used.
|
2022-07-28 10:30:07 -04:00
|
|
|
#
|
2023-06-01 16:11:58 -04:00
|
|
|
max_event_secs = 30
|
|
|
|
# this is the maximum amount of secs of video footage that can be
|
|
|
|
# recorded in a motion event.
|
2022-07-08 15:24:45 -04:00
|
|
|
#
|
2023-06-18 09:06:12 -04:00
|
|
|
img_thresh = 8000
|
2023-06-01 16:11:58 -04:00
|
|
|
# this application uses 'magick compare' to score the differences between
|
|
|
|
# two, one second gapped snapshots of the camera stream. any image pairs
|
|
|
|
# that score greater than this value is considered motion and queues up
|
|
|
|
# max_event_secs worth of hls clips to be written out as a motion event.
|
2023-05-06 09:08:47 -04:00
|
|
|
#
|
2023-06-01 16:11:58 -04:00
|
|
|
max_events = 100
|
2023-03-28 20:27:12 -04:00
|
|
|
# this indicates the maximum amount of motion event video clips to keep
|
|
|
|
# before deleting the oldest clip.
|
2022-07-08 15:24:45 -04:00
|
|
|
#
|
2023-05-06 09:08:47 -04:00
|
|
|
post_secs = 60
|
|
|
|
# this is the amount of seconds to wait before running the command
|
|
|
|
# defined in post_cmd. the command will not run if motion was detected
|
|
|
|
# in the space before post_secs elapsed.
|
2022-12-24 13:48:51 -05:00
|
|
|
#
|
|
|
|
post_cmd = move_the_ptz_camera.py
|
2023-05-06 09:08:47 -04:00
|
|
|
# this an optional command to run with post_secs. one great use for this
|
2023-03-28 20:27:12 -04:00
|
|
|
# is to move a ptz camera to the next position of it's patrol pattern.
|
|
|
|
# note: the call to this command will be delayed if motion was detected.
|
2022-12-18 10:25:46 -05:00
|
|
|
#
|
|
|
|
max_log_size = 50000
|
|
|
|
# this is the maximum byte size of all log files that can be stored in
|
|
|
|
# web_root. whenever this limit is met, the log file will be deleted and
|
|
|
|
# then eventually recreated blank.
|
2022-09-11 12:56:32 -04:00
|
|
|
#
|
2022-12-18 10:25:46 -05:00
|
|
|
web_text = #dee5ee
|
|
|
|
# this can be used to customize the color of the text in the web
|
|
|
|
# interface. it can be defined as any color understood by html5 standard.
|
|
|
|
#
|
|
|
|
web_bg = #485564
|
|
|
|
# this can be used to customize the background color of the web
|
|
|
|
# interface. just like web_text, it also follows the html5 standard.
|
|
|
|
#
|
|
|
|
web_font = courier
|
|
|
|
# this will customize the text font family to use in the web interface.
|
|
|
|
# it is recommended to use mono-spaced font because this is also used to
|
|
|
|
# display logs and logs are best displayed in mono-spaced font.
|
2022-07-08 15:24:45 -04:00
|
|
|
```
|
|
|
|
|
2022-09-17 09:53:52 -04:00
|
|
|
### Setup/Build/Install ###
|
2022-07-08 15:24:45 -04:00
|
|
|
|
|
|
|
This application is currently only compatible with a Linux based operating
|
2023-06-01 16:11:58 -04:00
|
|
|
systems that are capable of installing the QT API.
|
2022-09-17 09:53:52 -04:00
|
|
|
|
2022-07-08 15:24:45 -04:00
|
|
|
```
|
2022-09-17 09:53:52 -04:00
|
|
|
sh ./setup.sh <--- only need to run this once if compiling for the first
|
|
|
|
sh ./build.sh time or if upgrading from the ground up.
|
|
|
|
sh ./install.sh
|
2022-07-08 15:24:45 -04:00
|
|
|
```
|
2022-12-18 10:25:46 -05:00
|
|
|
```
|
|
|
|
note 1: be sure to run setup.sh and install.sh as root (or use sudo).
|
|
|
|
note 2: if building from scratch the following scripts will need to
|
|
|
|
be run in this order - setup.sh -> build.sh -> install.sh.
|
|
|
|
```
|