3791b29cf7
-fixed the -i option that was using /etc instaead of /etc/mow -the externalized image comparison executable is now configurable in the config file. -moved the main index.html and theme.css files to the buffer dir, moving even more io to the buffer dir. |
||
---|---|---|
bin | ||
src | ||
.gitignore | ||
build.sh | ||
CMakeLists.txt | ||
install.sh | ||
LICENSE.md | ||
README.md | ||
setup.sh |
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>
-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.
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 parameters supported and descriptions of each.
# Motion Watch config file
#
# 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
# this is the url to the main stream of the IP camera that will be used
# to record footage.
#
web_root = /var/opt/mow/web
# this is the output directory that will be used to store recorded footage
# 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.
#
buffer_path = /var/opt/mow/buf
# 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. 1g of space per camera is
# a good rule of thumb.
#
cam_name = cam-1
# this is the optional camera name parameter to identify the camera. this
# 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.
#
max_event_secs = 30
# this is the maximum amount of secs of video footage that can be
# recorded in a motion event.
#
img_comp_cmd = magick compare -metric FUZZ &prev& &next& /dev/null
# this is the command line template this application will use when calling
# the external image comparison application. the external application is
# expected to compare snapshots from the video stream to determine how
# different the images are from each other. it needs to output a numeric
# score with the higher values meaning very different while low values
# mean similar images. the snapshots pulled from the stream will be bitmap
# formatted so the app will be required to support this format. also avoid
# outputting any special chars, only numeric chars with a single '.' if
# outputting a decimal value. magick is the default if not defined in the
# config file. the special string &prev& will be substituted with the path
# to the "previous" bitmap image, behind in time stamp to the image path
# subtituted in &next&.
#
img_comp_out = stderr
# this is the standard output stream the app defined in img_comp_cmd will
# use to output the comparison score. this can only be stderr or stdout,
# any other stream name is considered invalid.
#
img_thresh = 8000
# this parameter defines the score threshold from img_comp_cmd that will
# be considered motion. any motion events will queue up max_event_secs
# worth of hls clips to be written out to web_root.
#
max_events = 100
# this indicates the maximum amount of motion event video clips to keep
# before deleting the oldest clip.
#
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.
#
post_cmd = move_the_ptz_camera.py
# this an optional command to run with post_secs. one great use for this
# 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.
#
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.
#
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.
Setup/Build/Install
This application is currently only compatible with a Linux based operating systems that are capable of installing the QT API.
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
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.