From 5e7f9bea1ce879231a300282304264e3967f96ed Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Fri, 22 Mar 2024 22:10:37 -0600 Subject: [PATCH] Add Motionplus release 0.2.0 --- motionplus_config.html | 79 +- motionplus_examples.html | 161 +- mp0.2.0/motionplus.gif | Bin 0 -> 1913 bytes mp0.2.0/motionplus_build.html | 239 +++ mp0.2.0/motionplus_config.html | 2664 +++++++++++++++++++++++++++++ mp0.2.0/motionplus_examples.html | 600 +++++++ mp0.2.0/motionplus_stylesheet.css | 485 ++++++ 7 files changed, 4210 insertions(+), 18 deletions(-) create mode 100644 mp0.2.0/motionplus.gif create mode 100644 mp0.2.0/motionplus_build.html create mode 100644 mp0.2.0/motionplus_config.html create mode 100644 mp0.2.0/motionplus_examples.html create mode 100644 mp0.2.0/motionplus_stylesheet.css diff --git a/motionplus_config.html b/motionplus_config.html index e671195..1a4400b 100644 --- a/motionplus_config.html +++ b/motionplus_config.html @@ -415,27 +415,31 @@

Configuration Options-Listed by T webcontrol_port + webcontrol_port2 webcontrol_ipv6 webcontrol_localhost - webcontrol_parms + webcontrol_parms webcontrol_interface webcontrol_auth_method webcontrol_authentication - webcontrol_tls + webcontrol_tls webcontrol_cert webcontrol_key webcontrol_headers - webcontrol_actions + webcontrol_actions webcontrol_html webcontrol_base_path webcontrol_lock_attempts + + webcontrol_lock_minutes + webcontrol_lock_script @@ -1091,13 +1095,32 @@

libcam_params

  • AwbCustom = 7
  • AwbLocked(bool)

    +

    ColourGains(Pipe delimited)

    +

    ColourTemperature(int)

    Saturation(float)

    +

    SensorBlackLevels(Pipe delimited)

    +

    Sharpness(float)

    FocusFoM(int)

    -

    ScalerCrop(Rect x-y-h-w)

    +

    ColourCorrectionMatrix(Pipe delimited)

    +
    +

    ScalerCrop(Pipe delimited)

    +

    DigitalGain(float)

    FrameDuration(int)

    +

    FrameDurationLimits(Pipe delimited)

    +

    SensorTemperature(float)

    SensorTimestamp(int)

    AfMode(int)

    @@ -1122,7 +1145,10 @@

    libcam_params

  • AfMeteringAuto = 0
  • AfMeteringWindows = 1
  • -

    AfWindows(rect x-y-h-w)

    +

    AfWindows(Pipe delimited)

    +

    AfTrigger(int)

    -

    SceneFlicker(int)

    -

    PipelineDepth(int)

    MaxLatency(int)

    TestPatternMode(int)

    @@ -1339,7 +1359,7 @@

    rotate

    flip_axis

    @@ -1846,7 +1866,7 @@

    movie_quality

    movie_container

    @@ -1962,6 +1982,15 @@

    webcontrol_port

    +

    webcontrol_port

    + +

    +

    webcontrol_ipv6

    + +

    webcontrol_lock_attempt

    + +

    + +

    webcontrol_lock_minutes

    + +

    + +

    webcontrol_lock_script

    + +

    + +

    Live Stream

    diff --git a/motionplus_examples.html b/motionplus_examples.html index 626e4d0..4f87762 100644 --- a/motionplus_examples.html +++ b/motionplus_examples.html @@ -56,6 +56,8 @@

    Examples

  • DNN setup
  • Haar Model Training
  • Sound Frequency Sample
  • +
  • Fail2Ban example
  • +
  • PTZ command examples
  • @@ -91,19 +93,19 @@

    Sample extpipe commands

    The following are some sample extpipe commands

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

    @@ -172,7 +174,7 @@

    Database Setup

    invited to provide suggestions and corrections to these steps.
      - sudo apt install libmariadb-dev libmariadb3 mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-server + sudo apt install libmariadb-dev libmariadb3 mariadb-client mariadb-client-core mariadb-common mariadb-server
      sudo mariadb
        GRANT ALL ON *.* TO 'YourUserNameHere'@'localhost' IDENTIFIED BY 'YourPasswordHere' WITH GRANT OPTION; @@ -237,6 +239,14 @@

        Webcontrol pages

      • {IP}:{port0}/{camid}/mjpg/motion Stream of motion images for the camera as a mjpg
      • {IP}:{port0}/{camid}/mjpg/source Source image stream of the camera as a mjpg
      + The following mpegts pages are available via the webcontrol. (Update automatically) +
        +
      • {IP}:{port0}/{camid}/mpegts Primary stream for the camera updated as a mpeg transport stream
      • +
      • {IP}:{port0}/{camid}/mpegts/substream Substream for the camera updated as a mpeg transport stream
      • +
      • {IP}:{port0}/{camid}/mpegts/motion Stream of motion images for the camera as a mpeg transport stream
      • +
      • {IP}:{port0}/{camid}/mpegts/source Source image stream of the camera as a mpeg transport stream
      • +
      + The following static pages are available via the webcontrol. (Update manually)
      • {IP}:{port0}/{camid}/static Primary image for the camera
      • @@ -442,6 +452,147 @@

        Sound Frequency Sample

      +

      Fail2Ban Example

      +
        + The following are example files to use with the fail2ban application. This allows users to ban IPs that + may be attempting to get in. This example was created using Debian 11. Adjust as appropriate for other + distros and versions. +
        + Install fail2ban and create the following files: +
        File 1: +
          +
           # Fail2Ban configuration file: /etc/fail2ban/filter.d/motionplus.conf +
           # Author: Mr Dave +
           # +
           [INCLUDES] +
           # Read common prefixes. If any customizations available -- read them from common.local +
           before = common.conf +
            +
           [Definition] +
           daemon = nsd +
            +
           # Option: failregex +
           # Notes.: +
           #  regex to match the log in failures messages in the logfile. The +
           #  host must be matched by a group named "host". The tag "<HOST>" can +
           #  be used for standard IP/hostname matching and is only an alias for +
           #  (?:::f{4,6}:)?(?P[\w\-.^_]+) +
           # Sample: Jul 01 02:50:32 [EMG][STR][00:wc00] webu_failauth_check: Ignoring connection from: 192.168.1.10 +
           # Values: TEXT +
            +
           failregex = ^.*Ignoring connection from: <HOST>$ +
            +
           ignoreregex = +
            +
           datepattern = {^LN-BEG}Epoch +
              {^LN-BEG} +
            +
        +
        File2: +
          +
           #Fail2Ban Jail Configuration File: /etc/fail2ban/jail.d/motionplus-jail.conf +
           [motionplus] +
           enabled = true +
           filter = motionplus +
           logpath = /var/log/motionplus/motionplus.log +
           bantime = 23h +
           banaction = iptables-allports[blocktype="DROP"] +
           maxretry = 0 +
           port = 0:65535 +
        +
        Make sure to adjust the log file location indicated in the jail file as well as how long to ban the IP address. +
      + +

      PTZ command examples

      +
        + The following are some example sources and scripts to send PTZ (Pan Tilt Zoom) commands to cameras. +

        + sofiactl is a Perl script that can control many imported inexpensive cameras. +
        Adjust script location, timing, cameraip, user, etc as appropriate. +
          +
           #!/bin/bash +
            sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomTile --s2 0.5 +
            sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomWide --s2 0.5 +
            sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionUp --s2 2.0 +
            sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionDown --s2 2.0 +
            sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionLeft --s2 2.0 +
            sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionRight --s2 2.0 +
           exit +
        + +
        + camxmctl is a c++ program with a sample HTML page that makes adjusting the parameters + easier. It reuses some of the code from Motionplus and is based upon the JSON files and commands in the + sofiactl script. +
        Adjust location, timing, cameraip, user, etc as appropriate. +
          +
           #!/bin/bash +
             tbd. Review sample page to see post commands. +
           exit +
        + +
        + curl scripts. Example 1 +
        Adjust as appropriate. +
          +
           #!/bin/bash +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnDown +
            sleep 2 +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnDown +
           exit +
           #!/bin/bash +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnLeft +
            sleep 2 +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnLeft +
           exit +
           #!/bin/bash +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnRight +
            sleep 2 +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnRight +
           exit +
           #!/bin/bash +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnUp +
            sleep 2 +
            curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnUp +
           exit +
        + +
        + curl scripts. Example 2 +
        Adjust as appropriate. +
          +
           #!/bin/bash +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=left&-speed=45' +
            sleep 1 +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
           exit +
           #!/bin/bash +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=right&-speed=45' +
            sleep 1 +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
           exit +
           #!/bin/bash +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=down&-speed=45' +
            sleep 1 +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
           exit +
           #!/bin/bash +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=up&-speed=45' +
            sleep 1 +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
           exit +
           #!/bin/bash +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomin&-speed=45' +
            sleep 1 +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
           exit +
           #!/bin/bash +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomout&-speed=45' +
            sleep 1 +
            curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
           exit +
        +
      diff --git a/mp0.2.0/motionplus.gif b/mp0.2.0/motionplus.gif new file mode 100644 index 0000000000000000000000000000000000000000..48df2e29588dea30b3b9eda41b85f618e76622d5 GIT binary patch literal 1913 zcmV-<2Zs1ZNk%w1VaNbH0E8a^b%wCQ$JE-~-dJLU00Sv)d6w|;^PH*8y2H~oL~ck_ zcx8C5M_iH+DOQuAx+yqktGCpOo5opbowL5zvbo2kvCE;UyUxknQ{sN zpS3sv60va^2@C)j5)8r%#0wD-6A%C$u$6Bfg|^Zz0tg!ex^NEz000Z!8)X6{)fER7 z5g2XFa0S!vC;}7(4~-rY2i^zcECK=n7#38hpx_dL0q_!Dpul0kgKTh0DUjgJ0Y4Z5 z(8*(v-~on&?*xppbkCbFS~mXtT>ua)4@hYW9C=l7|J3*!%Mvi`~tx7QUS7C6(WFe z0KtU|QB?>qO5h%bu_OEmh|pnEfxK}OpXf8nF9ZYvE;!&&z(Jl11vC&y-~d4YsER{> z5P)G(f(QrlI9L=htB3#v8dz;mLG%d&wyJfhS870n3V8yso`X}s1_c@nDll@vg9qHU zQ#5~0?E-=W7A8wb(9FXF2@nL2ups-W^Gg;?1X#fRfy)>IoXej%Ae@Qm(3iw_{vf}J z0rKJ01AZw`z<>e@bp9k8AoFaoP(W%VAW+aH6JiLTb4nWL96~U< z*u;LXxFe$nuXwPc3oTMN0|g04XyJsWbilxmHYs3=QX9B57#aB-a6km(2mk}P?LB^dC42Zw4|LzgeUV5cey3?P9q6+kdS00>O5=>!-6FaUQ6 z*!MvqcYOxHT^uBr00#j~aMuN(&9I-6A{gLYCxarY--#SBs$Piu^;wp$GQ@gaK43X8 z5CxukHY=wQ{%ladfdgQmX{;4spysQY)&-S#uSwZQf{>VS>j_Ur>7@vVLRrFoFB&ip zasw1#0b(Z<+uU*`6aY=JCzyqt0rojT6 z{x&fQkOumpmE;IoLc6`b`$4?@A}i9uj;=s3ckk)?9Kj?QATWpnTx24M4I|5gx88Jc z=>ow>(Ai%Qj9fyO7R-X10VdmSVOBKyh!7hG+?1#SB2=%KvA>p>?x=L(<( z6kHtuss2H_n9(|j6p;cL?4wdstG3W(0xt#&aEj0XsxqNqEBx+${I)o6U?z(g`*A|xduw^MPT|62P!8y zoCN9)9za>#y3|4Ev`=&dY}xs26|BCjsth9tKyr>UAq?=4WPH<^3}Gi72FfdhNgVzS zL%8$4oV+hSd5Yf#om0fwA@O|nyO^~$aK+I)FMp(aPXHDr9|j0;fRWOo>{_@tmmO+& zCP07)2lWa>>ZObT@=ku@#yQ5#Z*=yv)&d4FA-MEt6uj6Mk1~WO4RnA`T*{&W8AnLw zx$K1>_}LP%7)IF%sDB>VfGtU2yesVvlcTdh>o~>$0-&q}2>1gpYBS0VF+f5O008z< znM6UdvIT^iVasYs0$k3Lcx8-785{LE3x$qyg^bh%YSOVwG~k%Tqr@f#Kns8LD`QD1 z95n;EN^rVS1r8IK1`u#H3TU8F%7YaKb7j!Csm)ma6p#VtR<{or;BGVVkNyR7sZPF~ zE&(e<5&-Hqk|2&NC(ks+N3zGy7!DGfMl(Q`RD?OM&@71GjOarX^|KEJ%><2_PtlSn z00v~>Ocjyb(8>wI&c6Oz|xxjY~=#0X#s~QfR6CMAA zU;sF+T?}5JDBIrVBr=Tkt#F4++~OMdxX4Yea+i?PkAN~K literal 0 HcmV?d00001 diff --git a/mp0.2.0/motionplus_build.html b/mp0.2.0/motionplus_build.html new file mode 100644 index 0000000..30dfb57 --- /dev/null +++ b/mp0.2.0/motionplus_build.html @@ -0,0 +1,239 @@ + + + + + + MotionPlus + + + + + + + + + +
      + +

      Installing with a release deb package

      +
        + MotionPlus can also be installed from the release deb files. Download the appropriate + deb from the Releases page + and install using dpkg + or gdebi-core. +
      + +

      Building a deb package

      +
        + A script has also been written to allow users to create their own deb package + from either a tagged release or the most current master branch of the code. Download the + script by using the following + command. wget https://raw.githubusercontent.com/Motion-Project/motion-packaging/master/buildplus.sh +

        + Review the script and specify the following few optional parameters. + Username, EmailAddress, branch, install, arch. If + the parameters are not provided, the script will create defaults. +

        +

        + Once the script has been run and the deb file is created, install it as described above. +

        +
      + +

      Building Guide

      +
        +

        +

        +

        + Debian based distros +
          + sudo apt install autoconf automake autopoint build-essential pkgconf libtool libzip-dev + libjpeg-dev git libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev libopencv-dev + libwebp-dev gettext libmicrohttpd-dev libmariadb-dev libcamera-dev libcamera-tools libcamera-v4l2 + libasound2-dev libpulse-dev libfftw3-dev +

          + Note: PostgreSQL or Sqlite3 database may also be added + via sudo apt install libpq-dev libsqlite3-dev. If + no database is running on the system, some functionality of Motionplus will not be available. +

          + Once packages are installed, run the following to build Motionplus +

          + cd ~ +
          git clone https://github.com/Motion-Project/motionplus.git +
          cd motionplus +
          autoreconf -fiv +
          ./configure +
          make +
          make install +

          +
        +

        +
      + +

      Additional Configure Options

      +
        +

        +

        + The following custom configure options can be specified for MotionPlus. +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Options Description Editors comment
        --without-v4l2 Exclude v4l2
        --without-webp Compile without webp image support
        --with-libcam=DIR Specify the pkgconf dir for libcam Use --without-libcam to disable
        --with-ffmpeg=DIR Specify the pkgconf dir for ffmpeg. ffmpeg is required
        --with-opencv=DIR Specify the pkgconf dir for opencv. Use --without-opencv to disable
        --with-mariadb=DIR Specify the pkgconf DIR for MariaDB Use --without-mariadb to disable
        --with-mysql=DIR Specify the pkgconf dir for mysql Use --without-mysql to disable
        --with-pgsql=DIR Specify the pkgconf DIR for PostgreSQL Use --without-pgsql to disable
        --with-sqlite3=DIR Specify the pkgconf DIR for sqlite3. Use --without-sqlite3 to disable
        --with-pulse=DIR Specify the pkgconf DIR for PulseAudio. Use --without-pulse to disable
        --with-alsa=DIR Specify the pkgconf DIR for alsa. Use --without-alsa to disable
        --with-fftw3=DIR Specify the pkgconf DIR for fftw3. Use --without-fftw3 to disable
        --with-developer-flags Add additional warning flags for the compiler.
        +
        +

        +

        +
      + +

      Additional Make Options

      +
        +

        +
        +
        make cleanall
        +
        + This command creates a pristine directory without any of the files generated from + the autoreconf command. +
        +
        +

        + +

        +
        +
        make maintainer-check
        +
        Executes multiple configure and make using the developer flags for various combinations of the options.
        +
        +

        +

        +
      + +
      + diff --git a/mp0.2.0/motionplus_config.html b/mp0.2.0/motionplus_config.html new file mode 100644 index 0000000..1a4400b --- /dev/null +++ b/mp0.2.0/motionplus_config.html @@ -0,0 +1,2664 @@ + + + + + + MotionPlus + + + + + + + + + + + + +
      + +

      Configuration Options-Listed by Topic

      + + +

      Configuration Options-Detail Descriptions

      +
        +

        +

        + The following section provides detailed descriptions of each of the configuration options. +

        + +

        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 MotionPlus
          %{ver} version of MotionPlus %{trig_nbr} sound alert number that was triggered %{trig_nm} sound alert name that was triggered
          %{trig_freq} frequency that triggered the sound alert
          +
          +

          + The use of quotation marks around string is permitted. In addition to the above, the conversion + specifiers include the same options as for the C function strftime (3). +

          +
        + +

        System Processing

        +
          +

          +

          daemon

          +
            +
          • Values: on, off | Default: off
          • + Run in daemon mode. When running MotionPlus under systemd specify as off. +
          +

          + +

          setup_mode

          +
            +
          • Values: on, off | Default: off
          • + Run in setup mode and provide lots of messages related to images processed. +
          +

          + +

          pid_file

          +
            +
          • Values: String | Default: Not defined
          • + The full path and name of the process id file. +
          +

          + +

          log_file

          +
            +
          • Values: String | Default: Not defined
          • + The full path and name for the log file. When not specified, use syslog. +
          +

          + +

          log_level

          +
            +
          • Values: 1 - 9 | Default: 6
          • + Verbosity level(EMR, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL) of messages. +
          +

          + +

          log_type

          +
            +
          • Values: COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL | Default: ALL
          • + The component for which to log messages. +
          +

          + +

          native_language

          +
            +
          • Values: on, off | Default: on
          • + Enable native language messages. +
          +

          + +

          target_dir

          +
            +
          • Values: String | Default: current directory
          • + The full path for the target directory for pictures, snapshots, movies, etc. to be saved. +
          +

          + +

          device_name

          +
            +
          • Values: String | Default: Not defined
          • + The device name to be used in the format specifiers and web interface. +
          +

          + +

          device_id

          +
            +
          • Values: 1 - 32000 | Default: The sequence that the device file is read
          • + Unique numeric id for the device. +
          +

          + +

          camera

          +

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name with the configuration parameters for the individual camera. +
          +

          + +

          config_dir

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

          + +

          device_tmo

          +
            +
          • Values: Integer | Default: 30
          • + Number of seconds that elapse before the device is deemed to be lost. +
          +

          + +

          watchdog_tmo

          +
            +
          • Values: Integer | Default: 30
          • + Number of seconds that elapse before a camera is deemed to be unresponsive and MotionPlus triggers + a watchdog timeout and begins to force the camera to shut down. +
          +

          + +

          watchdog_kill

          +
            +
          • Values: Integer | Default: 10
          • + Number of seconds that elapse after the watchdog_tmo that MotionPlus waits until the + kill processes begin to force the camera to shut down. +
          +

          + +

          pause

          +
            +
          • Values: Boolean | Default: false
          • + Pause detection at start up. +
          +

          + +
        + +

        Devices

        +
          +

          v4l2_device

          +
            +
          • Values: String | Default: Not Defined
          • + The v4l2 device to be used for capturing. +
          +

          + +

          v4l2_params

          +

          +
            +
          • Values: String | Default: Not Defined
          • + Comma separated list of configuration parameters (aka controls) for the v4l2 device. +
          +

          + +
            +

            + The configuration parameters for v4l2_params are specified by name or ID. They may also be + enclosed in double quotes. Review the MotionPlus 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 +

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

            + Additional MotionPlus specific options for v4l2_params are listed below. +
          + +
            +

            palette

            +
            +
              +
            • Values: 0 - 20 | Default: 17
            • + Preferred color palette for MotionPlus to use for the device. See table below for the meaning of + each parameter number value. +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              V4l2 Option FOURCC palette option
              V4L2_PIX_FMT_SN9C10XS9100
              V4L2_PIX_FMT_SBGGR16BYR21
              V4L2_PIX_FMT_SBGGR8BA812
              V4L2_PIX_FMT_SPCA561S5613
              V4L2_PIX_FMT_SGBRG8GBRG4
              V4L2_PIX_FMT_SGRBG8GRBG5
              V4L2_PIX_FMT_PAC207P2076
              V4L2_PIX_FMT_PJPGPJPG + 7
              V4L2_PIX_FMT_MJPEGMJPG + 8
              V4L2_PIX_FMT_JPEGJPEG + 9
              V4L2_PIX_FMT_RGB24RGB3 + 10
              V4L2_PIX_FMT_SPCA501S501 + 11
              V4L2_PIX_FMT_SPCA505S505 + 12
              V4L2_PIX_FMT_SPCA508S508 + 13
              V4L2_PIX_FMT_UYVYUYVY + 14
              V4L2_PIX_FMT_YUYVYUYV + 15
              V4L2_PIX_FMT_YUV422P422P + 16
              V4L2_PIX_FMT_YUV420YU12 + 17
              V4L2_PIX_FMT_Y10Y10 + 18
              V4L2_PIX_FMT_Y12Y12 + 19
              V4L2_PIX_FMT_GREYGREY + 20
              +
              +
            +

            +

            +
            + +

            input

            +
            +
              +
            • Values: Integer | Default: -1
            • + Input channel for the v4l2 device. Use -1 for web cams. +
            +

            +
            + +

            norm

            +
            +
              +
            • Values: 0-3: | Default: 0
            • + The TV norm to use for the device (PAL, NTSC, SECCAM, PAL-BW) +
            +

            +
            + +

            frequency

            +
            +
              +
            • Values: Long | Default: 0
            • + The tuner frequency to use for the device. +
            +

            +
            + +

            params_file

            +
            +
              +
            • Values: String | Default: Not Defined
            • + Full path and file name for a file containing the params listed one per line. +
            +

            +
            +
          +

          + +

          libcam_device

          +
            +
          • Values: String | Default: Not Defined
          • + The libcamera device. The value of 'camera0' is the only currently supported device. +
          +

          + +

          libcam_params

          +

          +
            +
          • Values: String | Default: Not Defined
          • + Comma separated list of configuration parameters (aka controls) for the libcamera device. +
          +
            +

            Transform(string)

            + (These are libcamera transform and rotate options and may not provide result you anticipate.) +
              +
            • 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
            • +
            + +

            AeEnable(bool)

            +

            AeLocked(bool)

            +

            AeMeteringMode(int)

            +
              +
            • MeteringCentreWeighted = 0 +
            • MeteringSpot = 1
            • +
            • MeteringMatrix = 2
            • +
            • MeteringCustom = 3
            • +
            +

            AeConstraintMode(int)

            +
              +
            • ConstraintNormal = 0
            • +
            • ConstraintHighlight = 1
            • +
            • ConstraintShadows = 2
            • +
            • ConstraintCustom = 3
            • +
            +

            AeExposureMode(int)

            +
              +
            • ExposureNormal = 0
            • +
            • ExposureShort = 1
            • +
            • ExposureLong = 2
            • +
            • ExposureCustom = 3
            • +
            +

            ExposureValue(float)

            +

            ExposureTime(int)

            +

            AnalogueGain(float)

            +

            Brightness(float)

            +

            Contrast(float)

            +

            Lux(float)

            +

            AwbEnable(bool)

            +

            AwbMode(int)

            +
              +
            • AwbAuto = 0
            • +
            • AwbIncandescent = 1
            • +
            • AwbTungsten = 2
            • +
            • AwbFluorescent = 3
            • +
            • AwbIndoor = 4
            • +
            • AwbDaylight = 5
            • +
            • AwbCloudy = 6
            • +
            • AwbCustom = 7
            • +
            +

            AwbLocked(bool)

            +

            ColourGains(Pipe delimited)

            +
              +
            • Red | Blue
            • +
            +

            ColourTemperature(int)

            +

            Saturation(float)

            +

            SensorBlackLevels(Pipe delimited)

            +
              +
            • var1|var2|var3|var4
            • +
            +

            Sharpness(float)

            +

            FocusFoM(int)

            +

            ColourCorrectionMatrix(Pipe delimited)

            +
              +
            • var1|var2|var3|var4|var5|var6|var7|var8|var9
            • +
            +

            ScalerCrop(Pipe delimited)

            +
              +
            • x|y|height|width
            • +
            +

            DigitalGain(float)

            +

            FrameDuration(int)

            +

            FrameDurationLimits(Pipe delimited)

            +
              +
            • min|max
            • +
            +

            SensorTemperature(float)

            +

            SensorTimestamp(int)

            +

            AfMode(int)

            +
              +
            • AfModeManual = 0
            • +
            • AfModeAuto = 1
            • +
            • AfModeContinuous = 2
            • +
            +

            AfRange(0-2)

            +
              +
            • AfRangeNormal = 0
            • +
            • AfRangeMacro = 1
            • +
            • AfRangeFull = 2
            • +
            +

            AfSpeed(int)

            +
              +
            • AfSpeedNormal = 0
            • +
            • AfSpeedFast = 1
            • +
            +

            AfMetering(int)

            +
              +
            • AfMeteringAuto = 0
            • +
            • AfMeteringWindows = 1
            • +
            +

            AfWindows(Pipe delimited)

            +
              +
            • x|y|height|width
            • +
            +

            AfTrigger(int)

            +
              +
            • AfTriggerStart = 0
            • +
            • AfTriggerCancel = 1
            • +
            +

            AfPause(int)

            +
              +
            • AfPauseImmediate = 0
            • +
            • AfPauseDeferred = 1
            • +
            • AfPauseResume = 2
            • +
            +

            LensPosition(float)

            +

            AfState(int)

            +
              +
            • AfStateIdle = 0
            • +
            • AfStateScanning = 1
            • +
            • AfStateFocused = 2
            • +
            • AfStateFailed = 3
            • +
            +

            AfPauseState(int)

            +
              +
            • AfPauseStateRunning = 0
            • +
            • AfPauseStatePausing = 1
            • +
            • AfPauseStatePaused = 2
            • +
            +

            AePrecaptureTrigger(int)

            +
              +
            • AePrecaptureTriggerIdle = 0
            • +
            • AePrecaptureTriggerStart = 1
            • +
            • AePrecaptureTriggerCancel = 2
            • +
            +

            NoiseReductionMode(int)

            +
              +
            • NoiseReductionModeOff = 0
            • +
            • NoiseReductionModeFast = 1
            • +
            • NoiseReductionModeHighQuality = 2
            • +
            • NoiseReductionModeMinimal = 3
            • +
            • NoiseReductionModeZSL = 4
            • +
            +

            ColorCorrectionAberrationMode(int)

            +
              +
            • ColorCorrectionAberrationOff = 0
            • +
            • ColorCorrectionAberrationFast = 1
            • +
            • ColorCorrectionAberrationHighQuality = 2
            • +
            +

            AeState(int)

            +
              +
            • AeStateSearching = 1
            • +
            • AeStateConverged = 2
            • +
            • AeStateLocked = 3
            • +
            • AeStateFlashRequired = 4
            • +
            • AeStatePrecapture = 5
            • +
            +

            AwbState(int)

            +
              +
            • AwbStateInactive = 0
            • +
            • AwbStateSearching = 1
            • +
            • AwbConverged = 2
            • +
            • AwbLocked = 3
            • +
            +

            SensorRollingShutterSkew(int)

            +

            LensShadingMapMode(int)

            +
              +
            • LensShadingMapModeOff = 0
            • +
            • LensShadingMapModeOn = 1
            • +
            +

            PipelineDepth(int)

            +

            MaxLatency(int)

            +

            TestPatternMode(int)

            +
              +
            • TestPatternModeOff = 0
            • +
            • TestPatternModeSolidColor = 1
            • +
            • TestPatternModeColorBars = 2
            • +
            • TestPatternModeColorBarsFadeToGray = 3
            • +
            • TestPatternModePn9 = 4
            • +
            • TestPatternModeCustom1 = 256
            • +
            + +
          +

          + +

          netcam_url

          +
            +
          • Values: String | Default: Not defined
          • + URL associated with the network camera. +
          +

          + +

          netcam_params

          +
            +
          • Values: String | Default: Not Defined
          • + Comma separated list of configuration parameters. Format is: option=value,option2=value2 +
          +
            +

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

            + +
            +

            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 libary usage. The + ffmpeg libaries on the computer must usually be built from source in order to enable hardware decoding. +
            +

            + +
            +

            params_file

            +
              +
            • Values: String | Default: Not Defined
            • + Full path and file name for a file containing the params listed one per line. +
            +
            +
          +

          + +

          netcam_high_url

          +

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

          + +

          netcam_high_params

          +
            +
          • Values: String | Default: Not Defined
          • + Comma separated list of configuration parameters. Format is: option=value,option2=value2 +
          +
            +

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

            + +
            +

            params_file

            +
              +
            • Values: String | Default: Not Defined
            • + Full path and file name for a file containing the params listed one per line. +
            +
            +
          +

          + +

          netcam_userpass

          +
            +
          • Values: String | Default: Not defined
          • + Username and password for the network camera specified as username:password. +
          +

          + +
        + +

        Image Processing

        +
          +

          width

          +
            +
          • Values: Integer | Default: 640
          • + The width of the image in pixels. Must be a multiple of 8. +
          +

          + +

          height

          +
            +
          • Values: Integer | Default: 480
          • + The height of the image in pixels. Must be a multiple of 8. +
          +

          + +

          framerate

          +
            +
          • Values: 2 - 100 | Default: 15
          • + The number of frames to be processed per second for motion detection. +
          +

          + +

          rotate

          +
            +
          • Values: 0, 90, 180, 270 | Default: 0
          • + Rotate image the given number of degrees. +
          +

          + +

          flip_axis

          +
            +
          • Values: none, vertical, horizontal | Default: none
          • + Flip the image according to specified axis. +
          +

          + +

          locate_motion_mode

          +
            +
          • Values: on, off, preview | Default: off
          • + Locate and draw around/on the moving object. Preview only applies to pictures. +
          + +

          locate_motion_style

          +
            +
          • Values: box, redbox, cross, redcross | Default: box
          • + Set the look and style of the locate mode. +
          +

          + +

          text_left

          +
            +
          • Values: String | Default: Not defined
          • + User defined text overlaid in the lower left corner. +
          +

          + +

          text_right

          +
            +
          • Values: String | Default: %Y-%m-%d\\n%T
          • + User defined text overlaid in the lower right corner. +
          +

          + +

          text_changes

          +
            +
          • Values: on, off | Default: off
          • + Show the number of pixels that changed in the upper right corner. +
          +

          + +

          text_scale

          +
            +
          • Values: 1 - 10 | Default: 1
          • + Scale factor for text drawn on images. +
          +

          + +

          text_event

          +
            +
          • Values: String | Default: %Y%m%d%H%M%S
          • + Creates conversion specifier %C +
          +

          +
        + +

        Motion Detection

        +
          +

          emulate_motion

          +
            +
          • Values: on, off | Default: off
          • + Always save images even if there was no motion +
          +

          + +

          threshold

          +
            +
          • Values: Integer | Default: 1500
          • + Minimum number of changed pixels that triggers an event. +
          +

          + +

          threshold_maximum

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

          + + +

          threshold_tune

          +
            +
          • Values: on, off | Default: off
          • + Continuously adjust the threshold for triggering an event. +
          +

          + + +

          threshold_sdevx

          +
            +
          • Values: Integer | Default: 0
          • + The maximum standard deviation of the changed pixels in the x (width) axis. +
          +

          + +

          threshold_sdevy

          +
            +
          • Values: Integer | Default: 0
          • + The maximum standard deviation of the changed pixels in the y (height) axis. +
          +

          + +

          threshold_sdevxy

          +
            +
          • Values: Integer | Default: 0
          • + The maximum standard deviation of the changed pixels in the x (width) and y(height) axis. +
          +

          + +

          threshold_ratio

          +
            +
          • Values: Integer | Default:
          • + The maximum ratio comparing the pixels that went white to black and vice versa. +
          +

          + +

          threshold_ratio_change

          +
            +
          • Values: Integer | Default:
          • + The minimum change in the ratio to trigger a event. +
          +

          + +

          secondary_method

          +
            +
          • Values: haar, hog, dnn | Default: Not Defined
          • + The secondary detection method. +
          +

          + +

          +

          secondary_params

          +
            +
          • Values: String | Default: Not Defined
          • + Comma separated list of configuration parameters for the camera. Format is option=value,option2=value2 +
          +
            +

            + This option is a comma separated list of the secondary detection model options. In addition to the + options for each of the models, MotionPlus includes the following additional options. +

            + +
            +

            frame_interval

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

            +
            + +
            +

            model_file

            +
              +
            • Values: String | Default: Not Defined
            • + Full path and file name for the model file associated with the secondary model. +
            +

            +
            + +
            +

            image_type

            +
              +
            • Values: full, grey, roi | Default: full
            • + Process full color image, the full grey image or just the region of interest(roi). +
            +

            +
            + +
            +

            rotate

            +
              +
            • Values: Integer | Default: 0
            • + Rotation of image when being processed through secondary detection model. +
            +

            +
            + +
            +

            params_file

            +
              +
            • Values: String | Default: Not Defined
            • + Full path and file name for a file containing the params listed one per line. +
            +

            +
            + +
          +

          + + +

          noise_level

          +
            +
          • Values: 1 - 255 | Default: 32
          • + The minimum amount of change in a single pixel before it is counted towards the threshold value. +
          + +

          noise_tune

          +
            +
          • Values: on, off | Default: on
          • + Continuously adjust the noise_level parameter. +
          +

          + +

          despeckle_filter

          +
            +
          • Values: Combinations of E,e,D,d and l | Default: Not defined
          • + 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. Typical value is EedDl +
          +

          + +

          area_detect

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

          + +

          mask_file

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

          + + +

          mask_privacy

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

          + +

          smart_mask_speed

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

          + +

          lightswitch_percent

          +
            +
          • Values: 0 - 100 | Default: 0
          • + The minimum change in the portion of the image that will trigger a lightswitch condition +
          +

          + +

          lightswitch_frames

          +
            +
          • Values: Integer | Default: 5
          • + The number of frames to ignore when the lightswitch condition is triggered (see above). +
          +

          + +

          minimum_motion_frames

          +
            +
          • Values: Integer | Default: 1
          • + The number of frames that must contain motion in order to trigger an event. +
          +

          + +

          event_gap

          +
            +
          • Values: Integer | Default: 60
          • + The seconds of no motion detection that triggers the end of an event. +
          +

          + +

          pre_capture

          +
            +
          • Values: Integer | Default: 0
          • + The number of pre-captured (buffered) frames to be captured before an event. +
          +

          + +

          post_capture

          +
            +
          • Values: Integer | Default: 0
          • + The number of frames to be captured after an event has ended. +
          +

          + +

          static_object_time

          +
            +
          • Values: Integer | Default:
          • + Number of seconds before a new object is included in the reference image. +
          +

          + +
        + +

        Script Execution

        +
          +

          on_event_start

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name of the program/script to be executed at the start of an event. +
          +

          + +

          on_event_end

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name of the program/script to be executed at the end of an event. +
          +

          + +

          on_picture_save

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name of the program/script to be executed when a picture is saved. +
          +

          + +

          on_motion_detected

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name of the program/script to be executed when motion is detected. +
          +

          + +

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

          + +

          on_movie_start

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name of the program/script to be executed at the creation of a movie. +
          +

          + +

          on_movie_end

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name of the program/script to be executed when a movie ends. +
          +

          + +

          on_camera_lost

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

          + +

          on_camera_found

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

          + +

          on_secondary_detect

          +
            +
          • Values: String | Default: Not Defined
          • + The full path and file name of the program/script to be executed when secondary detection occurs. +
          +

          + +

          on_action_user

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

          + +

          on_sound_alert

          +
            +
          • Values: String | Default: Not Defined
          • + The full path and file name of the program/script to be executed when a sound alert is triggered. +
          +

          + +
        + +

        Output - Picture Options

        +
          +

          picture_output

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

          + +

          picture_output_motion

          +
            +
          • Values: on, off | 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. +
          +

          + +

          picture_type

          +
            +
          • Values: jpeg, webp, ppm | Default: jpeg
          • + The type of picture file to output. +
          +

          + +

          picture_quality

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

          + +

          picture_exif

          +
            +
          • Values: String | Default: Not defined
          • + The text for the JPEG EXIF comment with the EXIF timestamp. +
          +

          + +

          picture_filename

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

          + +

          snapshot_interval

          +
            +
          • Values: Integer | Default: 0
          • + The number of seconds between snapshots +
          +

          + +

          snapshot_filename

          +
            +
          • 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' +
          +

          + +
        + +

        Output - Movie Options

        +
          +

          movie_output

          +
            +
          • Values: on, off | Default: on
          • + Encode movies of the motion events. +
          +

          + +

          movie_output_motion

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

          + +

          movie_max_time

          +
            +
          • Values: Integer | Default: 120
          • + The maximum length of a movie in seconds. Set this to zero for unlimited length. +
          +

          + +

          movie_bps

          +
            +
          • Values: Integer | Default: 400000
          • + Bitrate to use in encoding of movies. This option is ignored if movie_quality is specified. +
          +

          + +

          movie_quality

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

          + +

          movie_container

          +
            +
          • 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. mkv:libx265 +
          +

          + +

          movie_retain

          +
            +
          • Values: on, off | Default: off
          • + Retain movie only if the secondary detection occurred. +
          +

          + +

          movie_passthrough

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

          + +

          movie_filename

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

          + +

          movie_extpipe_use

          +
            +
          • Values: on, off | Default: off
          • + Specifies whether to send the pictures to pipe for external encoding into a movie. +
          +

          + +

          movie_extpipe

          +
            +
          • Values: String | Default: Not defined
          • + The program name and options for processing the images. +
          +

          + +

          timelapse_interval

          +
            +
          • Values: Integer | Default: 0
          • + Interval in seconds for saving a picture into timelapse movie. Zero disables timelapse. +
          +

          + +

          timelapse_mode

          +
            +
          • Values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual | Default: daily
          • + File rollover mode of the timelapse video. +
          +

          + +

          timelapse_fps

          +
            +
          • Values: Integer | Default: 30
          • + The frame per second rate to use in the playback of the timelapse video. +
          +

          + +

          timelapse_container

          +
            +
          • Values: mpg, mpeg4 | Default: mpg
          • + Container to be used by timelapse video. +
              +
            • 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.
            • +
            +
          +

          + +

          timelapse_filename

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

          + +
        + +

        Output - Pipe Options

        +
          +

          video_pipe

          +
            +
          • Values: String | Default: Not defined
          • + The video4linux video loopback device for normal images. The device would be specified + in the format like /dev/video1 +
          +

          + +

          video_pipe_motion

          +
            +
          • Values: String | Default: Not defined
          • + The video4linux video loopback device for motion images. The device would be specified + in the format like /dev/video1 +
          +

          +
        + +

        Web Control

        +

        + These options must be placed in the motionplus.conf file and not in a camera config files. +
          +

          webcontrol_port

          +
            +
          • Values: 0 to 65535 | Default: 0 (disabled)
          • + The port number for the web based control of MotionPlus. +
          +

          + +

          webcontrol_port

          +
            +
          • Values: 0 to 65535 | Default: 0 (disabled)
          • + Second port for the web control 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. +
          +

          + +

          webcontrol_ipv6

          +
            +
          • Values: on, off | Default: off
          • + Listen for connections from IPv6 and IPV4. +
          +

          + +

          webcontrol_localhost

          +
            +
          • Values: on, off | Default: on
          • + Restrict the webcontrol of MotionPlus to the localhost. +
          +

          + +

          webcontrol_base_path

          +
            +
          • Values: Valid url path | Default: Not Defined
          • + Specify new base url path for the webcontrol. +
          +

          + +

          webcontrol_parms

          +
            +
          • Values: 0 - 3 | Default: 0
          • + 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 MotionPlus to be restarted to become effective.
            • +
            • 3: Restricted - User IDs, passwords and "on_" commands.
            • +
            + The default for this parameter is 0 (none) to enhance the security of the web interface. The + setting of the webcontrol_parms is not included on the web interface and this parameter + can only be specified via the configuration file. +

            + Once MotionPlus has been configured, it is advised to complete the setup by setting + this value to zero. +
          +

          + +

          webcontrol_interface

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

          + +

          webcontrol_auth_method

          +
            +
          • Values: none, basic, digest | Default: none
          • + Authentication method to use for the webcontrol port +
          +

          + +

          webcontrol_authentication

          +
            +
          • Values: String | Default: Not defined
          • + The username and password specified as username:password +
          +

          + +

          webcontrol_tls

          +
            +
          • Values: on, off | Default: off
          • + Enable SSL/TLS (https) for the webcontrol. +
          +

          + +

          webcontrol_cert

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

          + +

          webcontrol_key

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

          + +

          webcontrol_headers

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

          + +

          webcontrol_actions

          +
            +
          • 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 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
            • +
            • 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)
            • +
            + Specify each of these using values of `on` or `off` to permit or deny respectively. The specification in + this parameter will override the default that is associated with + webcontrol_parms. +
          +

          + +

          webcontrol_html

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name for a user specified html page to use as the webcontrol. +
          +

          + +

          webcontrol_lock_attempt

          +
            +
          • Values: Integer | Default: 3
          • + Number of permitted attempts to log in before triggering lockout. +
          +

          + +

          webcontrol_lock_minutes

          +
            +
          • Values: Integer | Default: 10
          • + Number of minutes that the IP will be locked out from further attempts to log in. +
          +

          + +

          webcontrol_lock_script

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

          + + +
        + +

        Live Stream

        +
          +

          stream_preview_scale

          +
            +
          • Values: Integer | Default: 25
          • + The percentage to scale the stream image when it is placed on the webcontrol + page. Numbers greater than 100 are permitted. +
          +

          + +

          stream_preview_newline

          +
            +
          • Values: on, off | Default: off
          • + Insert a new line indicator prior to the image on the webcontrol web page. +
          +

          + +

          stream_preview_method

          +
            +
          • Values: `mjpg`, `static` | Default: `mjpg`
          • + This option determines the method used for displaying images on the webcontrol page. Use + `static` to get around browser limits on the concurrent number connections to server. +
          +

          + +

          stream_preview_ptz

          +
            +
          • Values: on, off | Default: on
          • + Include the PTZ buttons on the webcontrol page. +
          +

          + +

          stream_quality

          +
            +
          • Values: 1 - 100 | Default: 50
          • + JPG compression quality setting in percent for the images transferred to live stream. +
          +

          + +

          stream_grey

          +
            +
          • Values: on, off | Default: off
          • + Send the live stream in grey rather than color. +
          +

          + +

          stream_maxrate

          +
            +
          • Values: Integer | Default: 1
          • + The frames per second for the webcontrol camera stream. +
          +

          + +

          stream_motion

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

          + +

          stream_scan_time

          +
            +
          • Values: Integer | Default: 5
          • + Time in seconds to display image when in scan mode. +
          +

          + +

          stream_scan_scale

          +
            +
          • Values: Integer | Default: 25
          • + Percentage scaling factor to apply on the image when in scan mode. +
          +

          +
        + +

        Database

        + Only one database can be used by MotionPlus at a time. These options must be placed in the motionplus.conf + file and not in a camera config files. +
          +

          database_type

          +
            +
          • Values: mariadb, postgresql, sqlite3 | Default: Not defined
          • + The database type. +
          +

          + +

          database_dbname

          +
            +
          • Values: String | Default: Not defined
          • + The full path and file name to the Sqlite3 database. +
          +

          + +

          database_host

          +
            +
          • Values: String | Default: localhost
          • + The host on which the database is located +
          +

          + +

          database_port

          +
            +
          • Values: 0 - 65535 | Default: 0
          • + The port number that is used for the database. Typical values are: MariaDB=3306 and postgresql=5432 +
          +

          + +

          database_user

          +
            +
          • Values: String | Default: Not defined
          • + The user account name for database +
          +

          + +

          database_password

          +
            +
          • Values: String | Default: Not defined
          • + The user password for database +
          +

          + +

          database_busy_timeout

          +
            +
          • Values: Integer | Default: 0
          • + The time to wait before issuing a timeout message for sqlite3. +
          +

          + +

          sql_event_end

          +
            +
          • Values: String | Default:
          • + SQL query to execute at the end of the event. +
          +

          + +

          sql_event_start

          +
            +
          • Values: String | Default:
          • + SQL query to execute at the start of the event. +
          +

          + +

          sql_movie_end

          +
            +
          • Values: String | Default:
          • + SQL query to execute at the end of the movie. +
          +

          + +

          sql_movie_start

          +
            +
          • Values: String | Default:
          • + SQL query to execute at the start of the movie. +
          +

          + +

          sql_pic_save

          +
            +
          • Values: String | Default:
          • + SQL query to execute when a picture has been saved. +
          +

          +
        + +

        Tracking

        +
          +

          ptz_auto_track

          +
            +
          • Values: on,off Default: off
          • + Enable automatic tracking. +
          +

          + +

          ptz_wait

          +
            +
          • Values: Integer | Default: 0
          • + Time in seconds to wait after a PTZ script is called before resuming motion detection. +
          +

          + +

          ptz_move_track

          +
            +
          • Values: String | Default: Not Defined
          • + Full path and file name for script to execute for auto tracking. +
          +

          + +

          ptz_pan_left

          +

          +
            +
          • Values: String | Default: Not Defined
          • + Full path and file name for script to pan the camera left. +
          +

          + +

          ptz_pan_right

          +
            +
          • Values: String | Default: Not Defined
          • + Full path and file name for script to pan the camera right. +
          +

          + +

          ptz_tilt_up

          +
            +
          • Values: String | Default:
          • + Full path and file name for script to tilt the camera up. +
          +

          + +

          ptz_tilt_down

          +
            +
          • Values: String | Default: Not Defined
          • + Full path and file name for script to tilt the camera down. +
          +

          + +

          ptz_zoom_in

          +
            +
          • Values: String | Default: Not Defined
          • + Full path and file name for script to zoom the camera in . +
          +

          + +

          ptz_zoom_out

          +
            +
          • Values: String | Default: Not Defined
          • + Full path and file name for script to zoom the camera out. +
          +

          +
        + +

        Sound

        +
          +

          snd_device

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

          + +

          snd_params

          +

          +
            +
          • Values: String | Default: Not Defined
          • + Comma separated list of configuration parameters for the sound device. +
          +

          +
            +

            + The configuration parameters for snd_device +
              +

              source

              +
              +
                +
              • Values: String | Default: alsa
              • + The type of source for the sound device. Currently supported sources are 'alsa' or 'pulse'. +
              +

              +
              + +

              channels

              +
              +
                +
              • Values: Integer: | Default: 1
              • + The number of audio channels for the sound device +
              +

              +
              + +

              frames

              +
              +
                +
              • Values: Integer | Default: 2048
              • + The number of bytes to read in for each frame from the sound device. +
              +

              +
              + +

              sample_rate

              +
              +
                +
              • Values: Integer | Default: 44100
              • + The sample rate for the sound device. +
              +

              +
              + +

              pulse_server

              +
              +
                +
              • Values: String | Default: Not defined
              • + The override name of the pulse server to use. +
              +

              +
              + +

              params_file

              +
              +
                +
              • Values: String | Default: Not Defined
              • + Full path and file name for a file containing the params listed one per line. +
              +

              +
              +
            +

            + +

            snd_alerts

            +
              +
            • Values: String | Default: Not Defined
            • + Comma separated list of configuration parameters for the criteria of each alert. +

              + Multiple specifications of this parameter are permitted. +
            +

            +
              +

              + 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

              +
              +
                +
              • Values: Integer | Default:
              • + The unique number associated with the alert. +
              +

              +
              + +

              volume_level

              +
              +
                +
              • Values: Integer | Default: 0
              • + The minimum volume level required to be start the detection process +
              +

              +
              + +

              volume_count

              +
              +
                +
              • Values: Integer | Default: 100
              • + The minimum number of times that the frequency must be detected above the volume_level before triggering event. +
              +

              +
              + +

              freq_low

              +
              +
                +
              • Values: Float | Default: 0
              • + The minimum frequency associated with the detection. +
              +

              +
              + +

              freq_high

              +
              +
                +
              • Values: Float | Default: 10000
              • + The maximum frequency associated with the detection. +
              +

              +
              + +

              trigger_duration

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

              +
              + +

              trigger_threshold

              +
              +
                +
              • Values: Integer | Default: 10
              • + The number of times that the alert must be triggered before invoking the on_sound_event +
              +

              +
              + +

              alert_nm

              +
              +
                +
              • Values: String | Default: Not defined
              • + The description associated with the alert. +
              +

              +
              + +

              params_file

              +
              +
                +
              • Values: String | Default: Not Defined
              • + Full path and file name for a file containing the params listed one per line. +
              +

              +
              +
            +

            +
          + +

          snd_window

          +

          +
            +
          • Values: hamming, hann, none | Default: hamming
          • + The sound frequency detection window function method to use. +
          +

          + +

          snd_show

          +
            +
          • Values: boolean | Default: off
          • + Write to the log the frequencies being detected. +
          +

          + +
        + +
      + +

      Command Line Options

      +
        +

        + motionplus [ -hbnsm ] [ -c config file path ] [ -d level ] [ -k level ] [ -p pid_file ] [ -l log_file ] +

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

        +

        +
      + +

      The Configuration Files

      +
        +

        + MotionPlus will search for the configuration file called 'motionplus.conf' in the following order: +

        +
          +
        1. Current directory where MotionPlus was invoked
        2. +
        3. The directory called '.motionplus' in the current users home directory
        4. +
        5. The directory defined by --sysconfdir=DIR during the configure step of installation. If this was + not defined, it will default to /etc/motionplus
        6. +
        +

        + The motionplus.conf file specifies parameters for the entire MotionPlus application and defaults for + each camera. Specifications that are unique to each camera are included in separate files. +

        + +
      + +

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

        +

        +
      + +
      + + + + diff --git a/mp0.2.0/motionplus_examples.html b/mp0.2.0/motionplus_examples.html new file mode 100644 index 0000000..4f87762 --- /dev/null +++ b/mp0.2.0/motionplus_examples.html @@ -0,0 +1,600 @@ + + + + + + MotionPlus + + + + + + + +
      + +

      Examples

      + +

      +

      + +

      Persistent v4l2 device name

      +
        + 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 Motion 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 +

        +
      + +

      Sample extpipe commands

      +
        + The following are some sample extpipe commands +

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

        +
      + +

      Loopback device setup

      +
        + The video loopback device can be added installed via apt in many distributions. The package tested + with Motion 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. It is believed that there are additional options associated with the + v4l2loopback that allows for adding more than one device. See the documentation of the v4l2loopback + project for additional details. +

        + To activate the vloopback device in Motion set the 'video_pipe' option in the motion.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 motion.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 +

        +
      + +

      Use ffmpeg as input device

      +
        + Sometimes the particular device is not function for MotionPlus but does work with FFmpeg. In + this situation the device can be setup to be used in MotionPlus using FFMpeg as an intermediate + application. The process would be to set up a loopback device and then have FFmpeg feed the + video into that device and then Motion can read from it. The following are some examples. First set up + the loopback device and set it to /dev/video0. Then start ffmpeg using options such as the following. + ffmpeg -re -i mymovie.mp4 -f v4l2 /dev/video0 Then in a separate terminal, start MotionPlus + 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 +
      + +

      Database Setup

      +
        + If a database is specified in the MotionPlus configuration, upon start up, MotionPlus will check for a table in + the database called "motionplus" and if it is not found, it will create it. This MotionPlus specific table is + required so that movies can be displayed on the webcontrol page. It tracks the movies created by MotionPlus along + with the various metadata about the movies. The following is a brief overview of how to create a simple database + and specify it within the MotionPlus parameters so recordings can be downloaded from the webcontrol. +
          +
          +

          sqlite3

          + This database type is by far the easiest to set up since it is file based. Simply provide the + parameters in the MotionPlus configuration parameters +
            + + database_type sqlite3 +
            database_dbname /full/path/and/file/name.db +
            +
          + While this is the easiest to set up, it has also been observed that it can at times be unstable. This + is especially true if the database file is included as part of a archive process while in use by MotionPlus. +
          +

          + +
          +

          mariadb

          + The following describes the process to set up a Mariadb database. If your machine already has a Mariadb database, + adjust as appropriate to the situation that exists on your computer. Those with more experience with MariaDb are + invited to provide suggestions and corrections to these steps. + +
            + sudo apt install libmariadb-dev libmariadb3 mariadb-client mariadb-client-core mariadb-common mariadb-server +
            sudo mariadb +
              + GRANT ALL ON *.* TO 'YourUserNameHere'@'localhost' IDENTIFIED BY 'YourPasswordHere' WITH GRANT OPTION; +
              FLUSH PRIVILEGES; +
              exit +
            + mariadb -u YourUserNameHere -p +
              + {enter YourPasswordHere} +
              create database motionplus; +
              use motionplus; +
              quit; +
            +
            +
          + + Once the database is set up, check the status of Mariadb via systemctl. +
            + + sudo systemctl status mariadb + +
          + + Specify the following in the MotionPlus configuration parameters. +
            + + database_type mariadb +
            database_dbname motionplus +
            database_host localhost +
            database_port 3306 +
            database_user YourUserNameHere +
            database_password YourPasswordHere +
            +
          +
          +

          + +
          +

          pgsql

          + ToDo +

          + + +
        + +
      + +

      Webcontrol pages

      +
        +
      • {IP}:{port0}/ Home html page with streams for all cameras
      • + + The following JSON pages are available via the webcontrol. +
          +
        • {IP}:{port0}/0/config.json JSON object with the configuration information for all cameras
        • +
        • {IP}:{port0}/0/status.json JSON object with information about status of all cameras
        • +
        • {IP}:{port0}/0/movies.json JSON object with information about all movies
        • +
        + The following mjpg pages are available via the webcontrol. (Update automatically) +
          +
        • {IP}:{port0}/{camid}/mjpg Primary stream for the camera updated as a mjpg
        • +
        • {IP}:{port0}/{camid}/mjpg/substream Substream for the camera updated as a mjpg
        • +
        • {IP}:{port0}/{camid}/mjpg/motion Stream of motion images for the camera as a mjpg
        • +
        • {IP}:{port0}/{camid}/mjpg/source Source image stream of the camera as a mjpg
        • +
        + The following mpegts pages are available via the webcontrol. (Update automatically) +
          +
        • {IP}:{port0}/{camid}/mpegts Primary stream for the camera updated as a mpeg transport stream
        • +
        • {IP}:{port0}/{camid}/mpegts/substream Substream for the camera updated as a mpeg transport stream
        • +
        • {IP}:{port0}/{camid}/mpegts/motion Stream of motion images for the camera as a mpeg transport stream
        • +
        • {IP}:{port0}/{camid}/mpegts/source Source image stream of the camera as a mpeg transport stream
        • +
        + + The following static pages are available via the webcontrol. (Update manually) +
          +
        • {IP}:{port0}/{camid}/static Primary image for the camera
        • +
        • {IP}:{port0}/{camid}/static/substream Substream image for the camera
        • +
        • {IP}:{port0}/{camid}/static/motion Motion image for the camera
        • +
        • {IP}:{port0}/{camid}/static/source Source image of the camera
        • +
        +
      + +

      HAAR setup

      +
        +
      • Set the following Motionplus items within the secondardy_params
      • +
          +
        • frame_intervalDefault: 5 | The number of images between each secondary detection
        • +
        • image_typeDefault: full | Type of image to process through secondary detection
        • +
        • model_fileDefault: None | Full path and file name for the haar model
        • +
        • rotateDefault: 0 | Degrees of rotation of the image when processing through secondary detection
        • +
        • thresholdDefault: 1.10 | weights of detected values
        • +
        +
      • Set the following parameters to the OpenCV function CascadeClassifier::detectMultScale within the secondardy_params
      • + +
      • scalefactorDefault: 1.10 | Scale factor to apply to the image
      • +
      • flagsDefault: 0 |
      • +
      • maxsizeDefault: 1024 |
      • +
      • minsizeDefault: 8 |
      • +
      • minneighborsDefault: 8 |
      • +
      + +
    + +

    HOG setup

    +
      +
    • Set the following items within the secondardy_params
    • +
        +
      • frame_intervalDefault: 5 | The number of images between each secondary detection
      • +
      • image_typeDefault: full | Type of image to process through secondary detection
      • +
      • model_fileDefault: None | Full path and file name for the haar model
      • +
      • rotateDefault: 0 | Degrees of rotation of the image when processing through secondary detection
      • +
      • thresholdDefault: 1.10 | Weights of detected values
      • +
      +
    • Set the following parameters to the OpenCV function HOGDescriptor::detectMultScale within the secondardy_params
    • +
        +
      • threshold_modelDefault: 2.00 |
      • +
      • scalefactorDefault: 1.05 |
      • +
      • paddingDefault: 8 |
      • +
      • winstrideDefault: 8 |
      • +
      + +
    + +

    DNN setup

    +
      +
    • Set the following items within the secondardy_params
    • +
        +
      • model_fileDefault: None | Full path and file name for the haar model
      • +
      • frame_intervalDefault: 5 | The number of images between each secondary detection
      • +
      • image_typeDefault: full | Type of image to process through secondary detection
      • +
      • rotateDefault: 0 | Degrees of rotation of the image when processing through secondary detection
      • +
      • thresholdDefault: 0.75 | Confidence threshold
      • +
      • scalefactorDefault: 1.05 |
      • + +
      • backendDefault: 0(DNN_BACKEND_DEFAULT) |
      • +
      • targetDefault: 0(DNN_TARGET_CPU) |
      • +
      • widthDefault: none | Width for the model (not the source image)
      • +
      • heightDefault: none | Height for the model (not the source image)
      • +
      • scaleDefault: none | Scale used in the model
      • +
      • configDefault: none |
      • +
      • classes_fileDefault: none | Full path and name for a file with the names of the classes
      • +
      • frameworkDefault: none |
      • +
      + +
    + +

    Haar Model Training

    +
      + The OpenCV documentation is the definitive source for instructions on how to train + a Haar model. This brief introduction only provides a few scripts that may be + helpful in using MotionPlus to get positive and negative images to feed into the + training process. +
      +
      Start with creating positive images movie as input file. +
      Run with picture_output_motion roi +
      Remove any pictures that are not desired. +
      Run the script to create the positive file list +
      Run while in the directory with the positive images. +
        + opencv_createsamples -vec posfiles.vec -info poslist.txt -num 350 -h 96 -w 96 +
      + Next get a sample file that does not have desired positives. +
      Change to picture_output on and turn off motion roi +
      Change threshold to tiny number and run to create negatives +
        + opencv_traincascade -data ./model -vec ./pos/posfiles.vec -bg neglist.txt -numPos 350 -numNeg 325 +
      + The following are the simple scripts to create positive and negative list files for training + +
        + !/bin/bash +
        FILES=./pos/*.jpg +
        for FULLNAME in $FILES +
        do +
        HW=$(identify -format '%w %h' $FULLNAME) +
        printf "$FULLNAME 1 0 0 $HW \n" >>poslist.txt +
        done +
      +
        +
        !/bin/bash +
        FILES=./neg/*.jpg +
        for FULLNAME in $FILES +
        do +
        printf "$FULLNAME \n" >>neglist.txt +
        done +
      +
      + +
    + +

    Sound Frequency Sample

    +
      + Since sound frequency processing is new to MotionPlus, the following provides an illustrative sample of setting + up the sound and the associated alerts processing. This example will use ALSA. For PulseAudio, MotionPlus uses + the default audio recording device. Although MotionPlus has parameters for the PulseAudio server and device, + the set up is not straight forward and it is just recommended to change the PulseAudio default. +
      +
      Go to the command prompt and use arecord -l to get the + device name such as hw:1,0 +
      Specify log_level 8 in MotionPlus.conf +
      Do not specify a log file so that it is console output. +
      Specify snd_device and snd_show in the sound configuration file such as +
      snd_device hw:1,0 +
      snd_show on +
      Start MotionPlus and make a noise to test the output. +
      Once MotionPlus responds to sounds, press the test button on the device to be monitored. +
      Note that while the various devices being monitored may be the same, the detected frequency from + each may be slightly different. Care should be taken to not be too precise in the setting of the alert + range for MotionPlus. For example, the frequency may be reported as 3402.2456 and MotionPlus can be + set up to look for that precise number but devices age and the frequency may change. Also, note that the + frequency resolution of MotionPlus is limited by the sample rate and frames from the audio device. + The maximum resolution is determined by the following formula. Sample Rate / (frames * 2). So with the + default sample rate of 44100hz, and frames of 2048, the maximum resolution is appoximately 10.7666hz. This + means that the frequencies detected around the range reported above would be 3413.0122, 3402.2456 + or 3391.4790 and no values between. +
      Once the frequencies of all the devices have been logged, set up the alerts in the sound configuration + file as well as the on_sound_alert and turn off the showing of frequencies. (The frequencies in this sample + are random) +
        +
        snd_alerts alert_id=01,volume_level=01,volume_count=10,freq_low=2976,freq_high=2977,alert_nm=smokedown1 +
        snd_alerts alert_id=02,volume_level=01,volume_count=10,freq_low=3400,freq_high=3450,alert_nm=smokelr +
        snd_alerts alert_id=03,volume_level=01,volume_count=10,freq_low=3388,freq_high=3399,alert_nm=smokebr1 +
        snd_alerts alert_id=11,volume_level=01,volume_count=10,freq_low=3378,freq_high=3379,alert_nm=furnace +
        snd_alerts alert_id=22,volume_level=01,volume_count=10,freq_low=3281,freq_high=3399,alert_nm=waterheater +
        snd_alerts alert_id=22,volume_level=01,volume_count=10,freq_low=3270,freq_high=3279,alert_nm=kitchBath +
        snd_show off +
        on_sound_alert %{trig_nbr} %{trig_nm} %{trig_freq} +
          +
      + Then you can set up a script to send email or text messages using the sendemail + application like below + +
        +
        #!/bin/bash +
          ALRTNBR=$1 +
          ALRTNM=$2 +
          FREQ=$3 +
          ATCH=$4 +
          MYSTR="" +
          MYSTR=$MYSTR" -f \"Friendly Name \" " +
          MYSTR=$MYSTR" -t \"DestinationEmailAddress@gwhatever.com\" " +
          MYSTR=$MYSTR" -u \"MotionPlus Notification\" " +
          MYSTR=$MYSTR" -s \"smtp.gwhatever.com:587\" " +
          MYSTR=$MYSTR" -xu \"SendingEmailAddress@gwhatever.com\" " +
          MYSTR=$MYSTR" -xp \"SendingEmailPassword\" " +
          BODY="" +
          if [[ "$ALRTNBR" -ge 1 && "$ALRTNBR" -le 9 ]]; then +
           BODY="So, hey. Sorry to bother you. But thought I'd just let" +
           BODY=$BODY" you know that your house is burning down. The neighbors" +
           BODY=$BODY" may get annoyed so you should think about doing something. " +
           BODY=$BODY" The "$ALRTNM" alert numbered "$ALRTNBR" was triggered with " +
           BODY=$BODY" frequency "$FREQ +
          elif [[ "$ALRTNBR" -ge 10 && "$ALRTNBR" -le 19 ]]; then +
           BODY="Hi. So I noticed that the natural gas leak alarm is going off." +
           BODY=$BODY" Nothing too urgent or anything but when you get home, you" +
           BODY=$BODY" may want to hold off making any sparks to avoid blowing yourself up." +
           BODY=$BODY" The "$ALRTNM" alert numbered "$ALRTNBR" was triggered with " +
           BODY=$BODY" frequency "$FREQ +
          elif [[ "$ALRTNBR" -ge 20 && "$ALRTNBR" -le 29 ]]; then +
           BODY="Ahoy! Your house is going to be next water park attraction in" +
           BODY=$BODY" the neighborhood!!! The water is filling it up and the" +
           BODY=$BODY" children will be splashing around in it soon." +
           BODY=$BODY" The "$ALRTNM" alert numbered "$ALRTNBR" was triggered with " +
           BODY=$BODY" frequency "$FREQ +
          fi +
          if [ "$BODY" != "" ]; then +
           MYSTR=$MYSTR" -m \""$BODY"\" " +
           if [ -f "$ATCH" ]; then +
            MYSTR=$MYSTR" -m \""$ATCH"\" " +
           fi +
           sendemail $MYSTR +
          fi +
        exit 0 +
      +
      + +
    + +

    Fail2Ban Example

    +
      + The following are example files to use with the fail2ban application. This allows users to ban IPs that + may be attempting to get in. This example was created using Debian 11. Adjust as appropriate for other + distros and versions. +
      + Install fail2ban and create the following files: +
      File 1: +
        +
         # Fail2Ban configuration file: /etc/fail2ban/filter.d/motionplus.conf +
         # Author: Mr Dave +
         # +
         [INCLUDES] +
         # Read common prefixes. If any customizations available -- read them from common.local +
         before = common.conf +
          +
         [Definition] +
         daemon = nsd +
          +
         # Option: failregex +
         # Notes.: +
         #  regex to match the log in failures messages in the logfile. The +
         #  host must be matched by a group named "host". The tag "<HOST>" can +
         #  be used for standard IP/hostname matching and is only an alias for +
         #  (?:::f{4,6}:)?(?P[\w\-.^_]+) +
         # Sample: Jul 01 02:50:32 [EMG][STR][00:wc00] webu_failauth_check: Ignoring connection from: 192.168.1.10 +
         # Values: TEXT +
          +
         failregex = ^.*Ignoring connection from: <HOST>$ +
          +
         ignoreregex = +
          +
         datepattern = {^LN-BEG}Epoch +
            {^LN-BEG} +
          +
      +
      File2: +
        +
         #Fail2Ban Jail Configuration File: /etc/fail2ban/jail.d/motionplus-jail.conf +
         [motionplus] +
         enabled = true +
         filter = motionplus +
         logpath = /var/log/motionplus/motionplus.log +
         bantime = 23h +
         banaction = iptables-allports[blocktype="DROP"] +
         maxretry = 0 +
         port = 0:65535 +
      +
      Make sure to adjust the log file location indicated in the jail file as well as how long to ban the IP address. +
    + +

    PTZ command examples

    +
      + The following are some example sources and scripts to send PTZ (Pan Tilt Zoom) commands to cameras. +

      + sofiactl is a Perl script that can control many imported inexpensive cameras. +
      Adjust script location, timing, cameraip, user, etc as appropriate. +
        +
         #!/bin/bash +
          sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomTile --s2 0.5 +
          sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomWide --s2 0.5 +
          sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionUp --s2 2.0 +
          sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionDown --s2 2.0 +
          sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionLeft --s2 2.0 +
          sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionRight --s2 2.0 +
         exit +
      + +
      + camxmctl is a c++ program with a sample HTML page that makes adjusting the parameters + easier. It reuses some of the code from Motionplus and is based upon the JSON files and commands in the + sofiactl script. +
      Adjust location, timing, cameraip, user, etc as appropriate. +
        +
         #!/bin/bash +
           tbd. Review sample page to see post commands. +
         exit +
      + +
      + curl scripts. Example 1 +
      Adjust as appropriate. +
        +
         #!/bin/bash +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnDown +
          sleep 2 +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnDown +
         exit +
         #!/bin/bash +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnLeft +
          sleep 2 +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnLeft +
         exit +
         #!/bin/bash +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnRight +
          sleep 2 +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnRight +
         exit +
         #!/bin/bash +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnUp +
          sleep 2 +
          curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnUp +
         exit +
      + +
      + curl scripts. Example 2 +
      Adjust as appropriate. +
        +
         #!/bin/bash +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=left&-speed=45' +
          sleep 1 +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
         exit +
         #!/bin/bash +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=right&-speed=45' +
          sleep 1 +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
         exit +
         #!/bin/bash +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=down&-speed=45' +
          sleep 1 +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
         exit +
         #!/bin/bash +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=up&-speed=45' +
          sleep 1 +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
         exit +
         #!/bin/bash +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomin&-speed=45' +
          sleep 1 +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
         exit +
         #!/bin/bash +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomout&-speed=45' +
          sleep 1 +
          curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45' +
         exit +
      +
    + + + + + diff --git a/mp0.2.0/motionplus_stylesheet.css b/mp0.2.0/motionplus_stylesheet.css new file mode 100644 index 0000000..77dc5d9 --- /dev/null +++ b/mp0.2.0/motionplus_stylesheet.css @@ -0,0 +1,485 @@ +* { + box-sizing: border-box;} + +body { + padding: 0; + margin: 0; + font-family: Helvetica, Arial, sans-serif; + word-wrap: break-word; + font-size: 16px; + line-height: 1.5; + color: #606c71; } +a { + color: #0f7040; + text-decoration: none;} +a:hover { + text-decoration: underline; } +.btn { + display: inline-block; + margin-bottom: 1rem; + color: rgba(255, 255, 255, 0.7); + background-color: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.2); + border-style: solid; + border-width: 1px; + border-radius: 0.3rem; + transition: color 0.2s, background-color 0.2s, border-color 0.2s; } +.btn + .btn { + margin-left: 1rem; } +.btn:hover { + color: rgba(255, 255, 255, 0.8); + text-decoration: none; + background-color: rgba(255, 255, 255, 0.2); + border-color: rgba(255, 255, 255, 0.3); } +.page-header { + color: #fff; + text-align: center; + background-color: #155799; + background-image: linear-gradient(120deg, #159957, #155799); } +.page-header h1 { + margin-bottom: 0.1em; + margin-top: 0.1em;} +.project-name { + margin-top: 0; + margin-bottom: 0.1rem; } +.project-tagline { + margin-bottom: 2rem; + font-weight: normal; + opacity: 0.7; } +.main-content :first-child { + margin-top: 0; } +.main-content img { + max-width: 100%; } +.main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 { + margin-top: 0.5em; + margin-bottom: 0.5em; + font-weight: normal; + color: #159957;} +.main-content p { + margin-bottom: 1em; } +.main-content code { + padding: 2px 4px; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + color: #383e41; + background-color: #f3f6fa; + border-radius: 0.3rem;} +.main-content pre { + padding: 0.8rem; + margin-top: 0; + margin-bottom: 1rem; + font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace; + color: #567482; + background-color: #f3f6fa; + border: solid 1px #dce6f0; + border-radius: 0.3rem;} +.main-content pre > code { + padding: 0; + margin: 0; + font-size: 0.9rem; + color: #567482; + word-break: normal; + white-space: pre; + background: transparent; + border: 0;} +.main-content .highlight { + margin-bottom: 1rem; } +.main-content .highlight pre { + margin-bottom: 0; + word-break: normal; } +.main-content .highlight pre, .main-content pre { + padding: 0.8rem; + overflow: auto; + font-size: 0.9rem; + line-height: 1.45; + border-radius: 0.3rem;} +.main-content pre code, .main-content pre tt { + display: inline; + padding: 0; + margin: 0; + overflow: scroll; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0; } +.main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after { + content: normal; } +.main-content ul, .main-content ol { + margin-top: 0; } +.main-content blockquote { + padding: 0 1rem; + margin-left: 0; + color: #819198; + border-left: 0.3rem solid #dce6f0; } +.main-content blockquote > :first-child { + margin-top: 0; } +.main-content blockquote > :last-child { + margin-bottom: 0; } +/* +.main-content table { + display: block; + overflow: auto; + word-break: normal; + } +.main-content table th { + font-weight: bold; } +.main-content table th, .main-content table td { + padding: 0.5rem 1rem; + border: 1px solid #e9ebec;} +*/ +.main-content dl { + padding: 0; } +.main-content dl dt { + padding: 0; + margin-top: 1rem; + font-size: 1rem; + font-weight: bold;} +.main-content dl dd { + padding: 0; + margin-bottom: 1rem;} +.main-content hr { + height: 2px; + padding: 0; + margin: 1rem 0; + background-color: #eff0f1; + border: 0;} + +.site-footer { + padding-top: 2rem; + margin-top: 2rem; + border-top: solid 1px #eff0f1;} +.site-footer-owner { + display: block; + font-weight: bold; } +.site-footer-credits { + color: #819198;} + +.topnav-d, .topnav-m { + color: #1e6bb8; + text-decoration: none; +} +.topnav { + background-color: #333; + overflow: hidden; +} +.topnav a, .topnav-m, .topnav-d { + float: left; + display: block; + color: #f2f2f2; + text-align: center; + padding: 14px 16px; + text-decoration: none; + font-size: 17px; +} +.topnav .icon { + display: none; +} +.topnav a:hover{ + background-color: #555; + color: white; +} +@media screen and (min-width: 48em) { + .topnav a { + float: right; + } + + .topnav .topnav-d { + float: right; + display: block; + } + + .topnav .topnav-m { + float: right; + display: none; + } + + .topnav .logoimg { + width:auto; + height:3.0em;} + +} +@media screen and (max-width: 48em) { + + .topnav a:not(:first-child) { + display: none; + } + + .topnav .topnav-d{ + display: none; + } + + .topnav .topnav-m:not(:first-child) { + display: none; + } + + .topnav a.icon { + float: right; + display: block; + } + + .topnav.responsive {position: relative;} + .topnav.responsive a.icon { + position: absolute; + right: 0; + top: 0; + } + .topnav.responsive a { + float: none; + display: block; + text-align: left; + } + + .topnav.responsive .topnav-d { + float: none; + display: none; + text-align: left; + } + + .topnav.responsive .topnav-m { + float: none; + display: block; + text-align: left; + } + + .topnav.responsive .dropdown {float: none;} + .topnav.responsive .dropdown-content {position: relative;} + .topnav.responsive .dropdown .dropbtn { + display: block; + width: 100%; + text-align: left; + } + +} + + +.subnav { + overflow: hidden; + background-color: #155799; + background-image: linear-gradient(120deg, #159957, #155799); + border-top: 2px solid black; +} +.subnav a { + float: left; + display: block; + color: white; + text-align: center; + padding: 5px; + text-decoration: none; + font-size: 12px; +} +.subnav .icon { + display: none; +} +.dropdown { + float: left; + overflow: hidden; +} +.dropdown .dropbtn { + font-size: 12px; + border: none; + outline: none; + color: white; + padding: 14px 16px; + background-color: inherit; + font-family: inherit; + margin: 0; +} +.dropdown-content { + display: none; + position: absolute; + background-color: #f1f1f1; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; +} +.dropdown-content a { + float: none; + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left; +} +.subnav a:hover, .dropdown:hover .dropbtn { + background-color: #555; + color: white; +} +.dropdown-content a:hover { + background-color: #ddd + color: black; +} +.dropdown:hover .dropdown-content { + display: block; +} + +@media screen and (min-width: 48em) { + .subnav a { + float: left; + } +} +@media screen and (max-width: 48em) { + .subnav a:not(:first-child), .dropdown .dropbtn { + display: none; + } + .subnav a.icon { + float: right; + display: block; + } + .subnav.responsive {position: relative;} + .subnav.responsive a.icon { + position: absolute; + right: 0; + top: 0; + } + .subnav.responsive a { + float: none; + display: block; + text-align: left; + } + .subnav.responsive .dropdown {float: none;} + .subnav.responsive .dropdown-content {position: relative;} + .subnav.responsive .dropdown .dropbtn { + display: block; + width: 100%; + text-align: left; + } +} + +.panel { + padding: 0.5em 1.4em 0.4em 1.6em; + background-color: white; + max-height: 0; + overflow: scroll; + overflow-x: hidden; + transition: max-height 0.2s ease-out; +} +.active { + background-color: #4CAF50; + color: white; +} +.logoimg { + width:auto; + height:3.0em; +} + + + +@media screen and (min-width: 48em) { + .nav-vertical { font-size: 1em; } + .accordian { font-size: 1em; } + .nav-button { + font-size: 1em; + height: 2.5em;} + .vertical-menu { font-size: 1em; } + .panel { font-size: 1em; } + .site-footer { font-size: 1em; } + .project-tagline { font-size: 1.25em; } + .project-name { font-size: 3.25em; } + .page-header { + padding: 0.1rem 0.1rem; + font-size: 1rem; + } + .btn { + padding: 0.75em 1em; } + .main-content { + padding: 0.5em 0.5em; + font-size: 1.1rem; } + + .tblalpha td { + height: 17px; + } + +} + +@media screen and (max-width: 48em) { + .logoimg { + width:auto; + height:3em; + } + .nav-vertical { font-size: 0.5rem; } + .nav-button { + font-size: 0.6em; + height: 3em; + } + + .vertical-menu { font-size: 0.9rem; } + .vertical-menu a { font-size: 0.7rem; } + .accordian { font-size: 0.5rem; } + .panel { font-size: 0.5rem; } + .site-footer { font-size: 0.5rem;} + .project-tagline { font-size: 1rem; } + .project-name { font-size: 1.75rem; } + .page-header{ + font-size: 1rem; + padding: 0.1rem 0.1rem; + } + .btn { + display: block; + padding: 0.75rem; + font-size: 0.9rem; } + .btn + .btn { + margin-top: 1rem; + margin-left: 0; } + .main-content { + padding: 0.5rem 0.5rem; + font-size: 0.7rem;} + .main-content { + table-layout: auto; + } +} + +@media screen and (max-width: 48em) { + + + .tblsignal table,.tblsignal thead,.tblsignal tbody,.tblsignal th,.tblsignal td,.tblsignal tr, + .tblalpha table,.tblalpha thead,.tblalpha tbody,.tblalpha th,.tblalpha td,.tblalpha tr, + .tbldetail table,.tbldetail thead,.tbldetail tbody,.tbldetail th,.tbldetail td,.tbldetail tr, + .tblconvr table,.tblconvr thead,.tblconvr tbody,.tblconvr th,.tblconvr td,.tblconvr tr, + .tblpaltte table,.tblpaltte thead,.tblpaltte tbody,.tblpaltte th,.tblpaltte td,.tblpaltte tr, + .tblconfig table,.tblconfig thead,.tblconfig tbody,.tblconfig th,.tblconfig td,.tblconfig tr + { + display: block; + } + .tblsignal thead tr, .tblalpha thead tr, .tbldetail thead tr, .tblconvr thead tr, + .tblpaltte thead tr, .tblconfig thead tr { + position: absolute; + top: -9999px; + left: -9999px; + } + .tblsignal tr, .tblalpha tr, .tbldetail tr, .tblconvr tr, + .tblpaltte tr, .tblconfig tr { + border: 1px solid #ccc; + } + .tblsignal td, .tbldetail td, .tblconvr td, .tblpaltte td { + border: none; + border-bottom: 1px solid #eee; + position: relative; + padding-left: 5%; + height: 2.8em; + } + .tblsignal td:before, .tbldetail td:before, .tblconvr td:before, + .tblpaltte td:before, .tblconfig td:before { + position: absolute; + top: 6px; + left: 6px; + width: 65%; + padding-top: 10px; + white-space: nowrap; + padding-left: 5%; + } + .tblalpha td{ + border: none; + border-bottom: 1px solid #eee; + position: relative; + padding-left: 15px; + height: 2.8em; + } + .tblconfig td { + border: none; + border-bottom: 1px solid #eee; + position: relative; + padding-left: 5%; + min-height: 2.8em; + height: auto; + } + +}