From c22d4a46d0294087e72f116376edfcd16c9d8e35 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Wed, 14 Nov 2018 19:47:14 -0700 Subject: [PATCH 01/16] Update version number to 4.2+git --- CHANGELOG | 5 +++-- version.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 77f205954..1045a89d5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ + * Change version number to 4.2+git Summary of Changes for version 4.2 are below * html fixes for legacy interface * Fix typo in guide @@ -89,7 +90,7 @@ Summary of Changes for version 4.2 are below * Revise %{host} and add %{ver} (tosiara) * Update for passthrough processing of cameras * Updated motion_guide.html - * Revise webcontrol page to indicate the webcontrol_parms selection + * Revise webcontrol page to indicate the webcontrol_parms selection * Validate v4l2 parms when using v4l2 via netcam * Capture images at start to prevent immediate events * Initialize thread number to eliminate inaccurate log notice. @@ -101,7 +102,7 @@ Summary of Changes for version 4.2 are below * Include EXIF for webp images. * Report to log when user specifies invalid URL. * Update guide that is installed locally. - * Updated version script to include date and dirty vs clean. + * Updated version script to include date and dirty vs clean. Version 4.1.1 Changes Below * Fix file name for debug movies * Fix image saving when using highres option diff --git a/version.sh b/version.sh index e7b3b31d2..c6b1aa188 100755 --- a/version.sh +++ b/version.sh @@ -13,5 +13,5 @@ if [ -d .git ]; then else GIT_COMMIT="gitUNKNOWN" fi -printf "$BASE_VERSION" -#printf "$BASE_VERSION+$GIT_COMMIT" +#printf "$BASE_VERSION" +printf "$BASE_VERSION+$GIT_COMMIT" From 8d9c585e3d21bc681af44be50e3444bd8bc9719d Mon Sep 17 00:00:00 2001 From: tosiara Date: Thu, 15 Nov 2018 04:56:53 +0200 Subject: [PATCH 02/16] Obsolete function Has been removed with cleanup of deprecated substream code --- picture.h | 1 - 1 file changed, 1 deletion(-) diff --git a/picture.h b/picture.h index 5076bcbb7..f15a71fa9 100644 --- a/picture.h +++ b/picture.h @@ -20,7 +20,6 @@ int put_picture_memory(struct context *, unsigned char*, int, unsigned char *, i void put_picture(struct context *, char *, unsigned char *, int); unsigned char *get_pgm(FILE *, int, int); void preview_save(struct context *); -unsigned char *scale_half_yuv420p(int origwidth, int origheight, unsigned char *img); void pic_scale_img(int width_src, int height_src, unsigned char *img_src, unsigned char *img_dst); #endif /* _INCLUDE_PICTURE_H_ */ From f65fb529d6eb27f8d53b0392f581f04611b071ac Mon Sep 17 00:00:00 2001 From: adameat <34044711+adameat@users.noreply.github.com> Date: Thu, 15 Nov 2018 05:59:54 +0300 Subject: [PATCH 03/16] webstream rate calculations --- webu_stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webu_stream.c b/webu_stream.c index c704bbe76..02e0d9ae8 100644 --- a/webu_stream.c +++ b/webu_stream.c @@ -44,8 +44,8 @@ static void webu_stream_mjpeg_delay(struct webui_ctx *webui) { /* The stream rate MUST be less than 1000000000 otherwise undefined behaviour * will occur with the SLEEP function. */ - stream_delay = ((time_curr.tv_usec - webui->time_last.tv_usec)*1000000) - - ((time_curr.tv_sec - webui->time_last.tv_sec)*1000000000); + stream_delay = ((time_curr.tv_usec - webui->time_last.tv_usec)*1000) - + ((time_curr.tv_sec - webui->time_last.tv_sec)*1000000); if (stream_delay < 0) stream_delay = 0; if (stream_delay > 1000000000 ) stream_delay = 1000000000; @@ -330,4 +330,4 @@ int webu_stream_static(struct webui_ctx *webui) { MHD_destroy_response (response); return retcd; -} \ No newline at end of file +} From 1919f22fe5b79cb315eefb04ff20d371e79a03de Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Wed, 14 Nov 2018 21:29:56 -0700 Subject: [PATCH 04/16] Webstream Rate Update --- webu_stream.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/webu_stream.c b/webu_stream.c index 02e0d9ae8..e2adf25ca 100644 --- a/webu_stream.c +++ b/webu_stream.c @@ -44,20 +44,18 @@ static void webu_stream_mjpeg_delay(struct webui_ctx *webui) { /* The stream rate MUST be less than 1000000000 otherwise undefined behaviour * will occur with the SLEEP function. */ - stream_delay = ((time_curr.tv_usec - webui->time_last.tv_usec)*1000) - - ((time_curr.tv_sec - webui->time_last.tv_sec)*1000000); + stream_delay = ((time_curr.tv_usec - webui->time_last.tv_usec)*1000) + + ((time_curr.tv_sec - webui->time_last.tv_sec)*1000000000); if (stream_delay < 0) stream_delay = 0; if (stream_delay > 1000000000 ) stream_delay = 1000000000; - if (webui->cnt->conf.stream_maxrate > 1){ + if (webui->cnt->conf.stream_maxrate >= 1){ stream_rate = ( (1000000000 / webui->cnt->conf.stream_maxrate) - stream_delay); if ((stream_rate > 0) && (stream_rate < 1000000000)){ SLEEP(0,stream_rate); } else if (stream_rate == 1000000000) { SLEEP(1,0); } - } else { - SLEEP(1,0); } gettimeofday(&webui->time_last, NULL); From d49630f4049e4cdde5e932e2896a1becb5133833 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Wed, 14 Nov 2018 21:31:10 -0700 Subject: [PATCH 05/16] Guide Update * Guide update --- motion_build.html | 110 +++--- motion_config.html | 815 +++++++++++++++++++++--------------------- motion_stylesheet.css | 583 +++++++++++++++++------------- 3 files changed, 809 insertions(+), 699 deletions(-) diff --git a/motion_build.html b/motion_build.html index 44ffd7a28..06eeb9fa0 100644 --- a/motion_build.html +++ b/motion_build.html @@ -6,36 +6,66 @@ Motion + - - + + - -
- -
+
+ menu⇓   +
@@ -561,6 +573,7 @@

Configure Script

The following options can be specified with the configure script to customize how Motion is built. +
@@ -784,6 +797,7 @@

Configure Script

+

diff --git a/motion_config.html b/motion_config.html index 1ecb9f9e2..a5abb17bc 100644 --- a/motion_config.html +++ b/motion_config.html @@ -6,26 +6,55 @@ Motion + - - + + + -
- -
+
+ -
+ menu⇓   + +

Basic Setup

-
  • Specify the camera in the configuration files.
  • -
  • Start Motion from a terminal via the command line
  • +
  • Specify the camera in the configuration files.
  • +
  • Start Motion from a terminal via the command line
  • Review the messages to ensure camera was found and press cntrl-c to exit
  • Enable the web stream in the configuration file
    • @@ -193,12 +202,12 @@

      Basic Setup

      Motion permits the use of video cards that have discreet input channels. Since USB cameras do not have input channels, - the option input must be set to the value -1 for USB cameras. + the option input must be set to the value -1 for USB cameras.

      Network cameras are set up via the - netcam_url parameter. + netcam_url parameter. The latest versions of Motion support rtsp format which many cameras now stream. Some users have requested a list of the network cameras that will work with Motion. Since Motion can now process RTSP streams, almost all cameras are supported. Simply review the specifications of the camera and validate that @@ -210,19 +219,19 @@

      Basic Setup

      The URL connection string to enter is specific to the camera and is usually provided by the manufacturer. The connection string is the same as what would be used by other video playing software such as VLC. If the camera does not stream via RTSP and instead uses a MJPEG, then Motion - can also view that format. See the option netcam_url - for additional options. + can also view that format. See the option netcam_url for + additional options.

      Raspberry Pi cameras can be set up two different ways. If Motion is installed by using the apt packages (e.g. apt-get install motion), then the camera must be set up using the bcm2835-v4l2 module which creates a v4l2 device for the camera. Users will need to install this module using the - command sudo modprobe bcm2835-v4l2. This + command sudo modprobe bcm2835-v4l2. This will set up the camera as a normal v4l2 device and it can be accessed via a standard /dev/videoX device. If Motion is built from source or installed via the deb packages on the project release page, then an additional option is to set - up the camera using the mmalcam_name parameter or using - the bcm2835-v4l2 module. When Motion is installed via apt, the mmalcam option is not available. + up the camera using the mmalcam_name parameter or using + the bcm2835-v4l2 module. When Motion is installed via apt, the mmalcam option is not available.

      @@ -230,7 +239,7 @@

      Basic Setup

      all use the Linux driver called 'bttv'.

      There are cards with more then one video input but still only one BT878 chip. They have a video multiplexer which - input is selected with the config option input. Input channel numbers start at 0 + input is selected with the config option input. Input channel numbers start at 0 (which is why the value -1 and not 0 disables input selection). There are video capture cards available with 4 or 8 inputs but only one chip. They present themselves as one single video device and you select input using the 'input' option. If you define e.g. 4 camera config files with the @@ -247,10 +256,10 @@

      Basic Setup

      is to experiment with a program such as VLC that can show the video stream.

      If you use the TV tuner input you also need to set the frequency of the TV channel using the - option frequency. Otherwise - set frequency to 0. + option frequency. Otherwise + set frequency to 0.

      - Finally you need to set the TV norm. + Finally you need to set the TV norm. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default is 0 (PAL). If your camera is a PAL black and white you may get a better result with norm=3 (PAL no colour).

      @@ -264,13 +273,13 @@

      Basic Setup

      The second option for processing a static file requires a bit of additional setup and uses a v4l2loopback device. To set this up, first install the loopback software as described in the - Output - Pipe Options + Output - Pipe Options section of this guide to create a /dev/videoX device and then use software such as ffmpeg to stream the static file into the v4l2 device. e.g. - ffmpeg -re -i mymovie.mp4 -f v4l2 /dev/video0 Then in a separate terminal, start Motion - with it set to use the /dev/video0 device as input. This method can can also be used to + ffmpeg -re -i mymovie.mp4 -f v4l2 /dev/video0 Then in a separate terminal, start Motion + with it set to use the /dev/video0 device as input. This method can can also be used to reformat the content to a different format. The following outputs the original movie into a gray pixel format. - ffmpeg -re -i mymovie.mp4 -f v4l2 -pix_fmt gray /dev/video0 + ffmpeg -re -i mymovie.mp4 -f v4l2 -pix_fmt gray /dev/video0 This can be helpful as a interim process where ffmpeg supports a particular input but that format is not yet supported by Motion. @@ -326,11 +335,11 @@

      Basic Setup

    -

    Command Line Options

    +

    Command Line Options

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

      • -c : Full path and filename of config file.
      • @@ -348,7 +357,7 @@

        Command Line Options

      -

      The Configuration Files

      +

      The Configuration Files

        If Motion was invoked with command line option -c pathname Motion will expect the config file to @@ -414,11 +423,11 @@

        The Configuration Files

        camera0.conf: -
        videodevice /dev/video0 +
        videodevice /dev/video0

        camera1.conf: -
        videodevice /dev/video1 +
        videodevice /dev/video1

        @@ -490,14 +499,15 @@

        Signals (sent with e.g. kill command)

        list which is the parent process for the threads. Motion responds to the following signals:

        +
        - - - + + + - - + + @@ -521,6 +531,7 @@

        Signals (sent with e.g. kill command)

        Signal Description Editors comment
        +

      @@ -535,19 +546,28 @@

      Configuration Options-Listed Alph Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL, SQLite, FFMPEG, etc).

      + +
      - - - - + + + + - + - + @@ -559,966 +579,967 @@

      Configuration Options-Listed Alph

      - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
      Version 3.2Version 3.2 Version 4.0 Version 4.1 Current Version
      area_detectarea_detect area_detect area_detect area_detectauto_brightness
      threadthread camera camera camera


      camera_dir camera_dir camera_dir


      camera_id camera_id camera_id


      camera_name camera_name camera_name
      daemondaemon daemon daemon daemon


      database_busy_timeout database_busy_timeout database_busy_timeout
      mysql_dbmysql_db database_dbname database_dbname database_dbname
      pgsql_dbpgsql_db database_dbname database_dbname database_dbname
      mysql_hostmysql_host database_host database_host database_host
      pgsql_hostpgsql_host database_host database_host database_host
      mysql_passwordmysql_password database_password database_password database_password
      pgsql_passwordpgsql_password database_password database_password database_password
      pgsql_portpgsql_port database_port database_port database_port


      database_type database_type database_type
      mysql_usermysql_user database_user database_user database_user
      pgsql_userpgsql_user database_user database_user database_user
      despeckledespeckle despeckle_filter despeckle_filter despeckle_filter
      output_alloutput_all emulate_motion emulate_motion emulate_motion
      gapgap event_gap event_gap event_gap
      flip_axis flip_axis
      framerateframerate framerate framerate framerate
      frequencyfrequency frequency frequency frequency
      heightheight height height height
      inputinput input input input
      lightswitch_frames
      lightswitchlightswitch lightswitch lightswitch lightswitch_percent
      locatelocate locate_motion_mode locate_motion_mode locate_motion_mode


      locate_motion_style locate_motion_style locate_motion_style


      logfile logfile log_file


      log_level log_level log_level


      log_type log_type log_type
      mask_filemask_file mask_file mask_file mask_file
      mask_privacy mask_privacy
      minimum_frame_timeminimum_frame_time minimum_frame_time minimum_frame_time minimum_frame_time
      minimum_motion_framesminimum_motion_frames minimum_motion_frames minimum_motion_frames minimum_motion_frames


      mmalcam_control_params mmalcam_control_params mmalcam_control_params


      mmalcam_name mmalcam_name mmalcam_name
      ffmpeg_bpsffmpeg_bps ffmpeg_bps ffmpeg_bps movie_bps
      ffmpeg_video_codecffmpeg_video_codec ffmpeg_video_codec ffmpeg_video_codec movie_codec


      ffmpeg_duplicate_frames ffmpeg_duplicate_frames movie_duplicate_frames


      extpipe extpipe movie_extpipe


      use_extpipe use_extpipe movie_extpipe_use
      movie_filenamemovie_filename movie_filename movie_filename movie_filename
      max_mpeg_timemax_mpeg_time max_movie_time max_movie_time movie_max_time
      ffmpeg_cap_newffmpeg_cap_new ffmpeg_output_movies ffmpeg_output_movies movie_output
      ffmpeg_cap_motionffmpeg_cap_motion ffmpeg_output_debug_movies ffmpeg_output_debug_movies movie_output_motion
      movie_passthrough
      ffmpeg_variable_bitrateffmpeg_variable_bitrate ffmpeg_variable_bitrate ffmpeg_variable_bitrate movie_quality
      native_language
      netcam_highres netcam_highres
      netcam_keepalivenetcam_keepalive netcam_keepalive netcam_keepalive netcam_keepalive
      netcam_proxynetcam_proxy netcam_proxy netcam_proxy netcam_proxy
      netcam_tolerant_checknetcam_tolerant_check netcam_tolerant_check netcam_tolerant_check netcam_tolerant_check
      netcam_urlnetcam_url netcam_url netcam_url netcam_url


      rtsp_uses_tcp rtsp_uses_tcp netcam_use_tcp
      netcam_userpassnetcam_userpass netcam_userpass netcam_userpass netcam_userpass
      noise_levelnoise_level noise_level noise_level noise_level
      noise_tunenoise_tune noise_tune noise_tune noise_tune
      normnorm norm norm norm
      on_area_detectedon_area_detected on_area_detected on_area_detected on_area_detected
      on_camera_found on_camera_found
      on_camera_loston_camera_lost on_camera_lost on_camera_lost on_camera_lost
      on_event_endon_event_end on_event_end on_event_end on_event_end
      on_event_starton_event_start on_event_start on_event_start on_event_start
      on_motion_detectedon_motion_detected on_motion_detected on_motion_detected on_motion_detected
      on_movie_endon_movie_end on_movie_end on_movie_end on_movie_end
      on_movie_starton_movie_start on_movie_start on_movie_start on_movie_start
      on_picture_saveon_picture_save on_picture_save on_picture_save on_picture_save


      exif_text exif_text picture_exif
      output_normaloutput_normal output_pictures output_pictures picture_output
      output_motionoutput_motion output_debug_pictures output_debug_pictures picture_output_motion
      jpeg_filenamejpeg_filename picture_filename picture_filename picture_filename
      ppmppm picture_type picture_type picture_type
      qualityquality quality quality picture_quality
      process_id_fileprocess_id_file process_id_file process_id_file pid_file
      post_capturepost_capture post_capture post_capture post_capture
      pre_capturepre_capture pre_capture pre_capture pre_capture
      quietquiet quiet quiet quiet
      rotaterotate rotate rotate rotate
      roundrobin_framesroundrobin_frames roundrobin_frames roundrobin_frames roundrobin_frames
      roundrobin_skiproundrobin_skip roundrobin_skip roundrobin_skip roundrobin_skip
      switchfilterswitchfilter switchfilter switchfilter roundrobin_switchfilter
      setup_modesetup_mode setup_mode setup_mode setup_mode
      smart_mask_speedsmart_mask_speed smart_mask_speed smart_mask_speed smart_mask_speed
      snapshot_filenamesnapshot_filename snapshot_filename snapshot_filename snapshot_filename
      snapshot_intervalsnapshot_interval snapshot_interval snapshot_interval snapshot_interval
      sql_log_mpegsql_log_mpeg sql_log_movie sql_log_movie sql_log_movie
      sql_log_imagesql_log_image sql_log_picture sql_log_picture sql_log_picture
      sql_log_snapshotsql_log_snapshot sql_log_snapshot sql_log_snapshot sql_log_snapshot
      sql_log_timelapsesql_log_timelapse sql_log_timelapse sql_log_timelapse sql_log_timelapse
      sql_querysql_query sql_query sql_query sql_query
      sql_query_start sql_query_start
      sql_query_stop


      stream_auth_method stream_auth_method stream_auth_method


      stream_authentication stream_authentication stream_authentication


      stream_cors_header


      stream_grey
      webcam_localhostwebcam_localhost stream_localhost stream_localhost stream_localhost
      webcam_maxratewebcam_maxrate stream_maxrate stream_maxrate stream_maxrate
      webcam_portwebcam_port stream_port stream_port stream_port


      stream_preview_method


      stream_preview_newline stream_preview_newline stream_preview_newline


      stream_preview_scale stream_preview_scale stream_preview_scale
      webcam_qualitywebcam_quality stream_quality stream_quality stream_quality


      stream_tls
      target_dirtarget_dir target_dir target_dir target_dir
      text_changestext_changes text_changes text_changes text_changes
      text_eventtext_event text_event text_event text_event
      text_lefttext_left text_left text_left text_left
      text_righttext_right text_right text_right text_right
      text_doubletext_double text_double text_double text_scale
      thresholdthreshold threshold threshold threshold
      threshold_maximum
      threshold_tunethreshold_tune threshold_tune threshold_tune threshold_tune
      ffmpeg_video_codecffmpeg_video_codec ffmpeg_video_codec timelapse_codec timelapse_codec
      timelapse_filenametimelapse_filename timelapse_filename timelapse_filename timelapse_filename
      timelapse_fps timelapse_fps
      ffmpeg_timelapseffmpeg_timelapse ffmpeg_timelapse timelapse_interval timelapse_interval
      ffmpeg_timelapse_modeffmpeg_timelapse_mode ffmpeg_timelapse_mode ffmpeg_timelapse_mode timelapse_mode
      track_autotrack_auto track_auto track_auto track_auto
      track_generic_move
      track_iomojo_idtrack_iomojo_id track_iomojo_id track_iomojo_id track_iomojo_id
      track_maxxtrack_maxx track_maxx track_maxx track_maxx
      track_maxytrack_maxy track_maxy track_maxy track_maxy
      track_motorxtrack_motorx track_motorx track_motorx track_motorx
      track_motorytrack_motory track_motory track_motory track_motory
      track_move_waittrack_move_wait track_move_wait track_move_wait track_move_wait
      track_porttrack_port track_port track_port track_port
      track_speedtrack_speed track_speed track_speed track_speed
      track_step_angle_xtrack_step_angle_x track_step_angle_x track_step_angle_x track_step_angle_x
      track_step_angle_ytrack_step_angle_y track_step_angle_y track_step_angle_y track_step_angle_y
      track_stepsizetrack_stepsize track_stepsize track_stepsize track_stepsize
      track_typetrack_type track_type track_type track_type
      tunerdevicetunerdevice tunerdevice tunerdevice tunerdevice
      v4l2_palettev4l2_palette v4l2_palette v4l2_palette v4l2_palette
      brightnessbrightness brightness brightness vid_control_params
      contrastcontrast contrast contrast vid_control_params
      huehue hue hue vid_control_params


      power_line_frequency power_line_frequency vid_control_params
      saturationsaturation saturation saturation vid_control_params
      video_pipevideo_pipe video_pipe video_pipe video_pipe
      motion_video_pipemotion_video_pipe motion_video_pipe motion_video_pipe video_pipe_motion
      videodevicevideodevice videodevice videodevice videodevice
      webcontrol_auth_method
      control_authenticationcontrol_authentication webcontrol_authentication webcontrol_authentication webcontrol_authentication
      webcontrol_cert
      webcontrol_cors_header
      control_html_outputcontrol_html_output webcontrol_html_output webcontrol_html_output webcontrol_interface


      ipv6_enabled ipv6_enabled webcontrol_ipv6
      webcontrol_key
      control_localhostcontrol_localhost webcontrol_localhost webcontrol_localhost webcontrol_localhost
      webcontrol_parms webcontrol_parms
      control_portcontrol_port webcontrol_port webcontrol_port webcontrol_port
      webcontrol_tls
      widthwidth width width width
      ffmpeg_deinterlaceffmpeg_deinterlace -Depreciated -Depreciated -Depreciated


      sdl_threadnr -Depreciated -Depreciated
      webcam_limitwebcam_limit stream_limit stream_limit -Depreciated
      webcam_motionwebcam_motion stream_motion stream_motion -Depreciated
      substream_port -Depreciated
      +

    Configuration Options-Listed by Topic

    @@ -1535,7 +1556,7 @@

    Configuration Options-Listed by T System Processing-General Info
      - +
      @@ -1574,7 +1595,7 @@

      Configuration Options-Listed by T Video4Linux Devices-General Info
        -

      +
      @@ -1609,7 +1630,7 @@

      Configuration Options-Listed by T Network Cameras-General Info
        -

      +
      @@ -1638,7 +1659,7 @@

      Configuration Options-Listed by T Raspberry Pi Camera-General Info
        -

      +
      @@ -1660,7 +1681,7 @@

      Configuration Options-Listed by T Image Processing-General Info
        -

      +
      @@ -1699,7 +1720,7 @@

      Configuration Options-Listed by T Motion Detection-General Info
        -

      +
      @@ -1745,7 +1766,7 @@

      Configuration Options-Listed by T Script Execution-General Info
        -

      +
      @@ -1778,7 +1799,7 @@

      Configuration Options-Listed by T Pictures-General Info
        -

      +
      @@ -1809,7 +1830,7 @@

      Configuration Options-Listed by T Movies-General Info
        -

      +
      @@ -1851,7 +1872,7 @@

      Configuration Options-Listed by T Pipes-General Info
        -

      +
      @@ -1873,7 +1894,7 @@

      Configuration Options-Listed by T Webcontrol-General Info
        -

      +
      @@ -1910,7 +1931,7 @@

      Configuration Options-Listed by T Live Stream-General Info
        -

      +
      @@ -1947,7 +1968,7 @@

      Configuration Options-Listed by T Database-General Info
        -

      +
      @@ -1988,7 +2009,7 @@

      Configuration Options-Listed by T Tracking-General Info
        -

      +
      @@ -2047,6 +2068,7 @@

      Configuration Options-Detail Des

      Conversion Specifiers

        +
      @@ -2135,6 +2157,7 @@

      Conversion Specifiers

      +

      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). @@ -2335,7 +2358,7 @@

      camera

      Motion allows for this line to be listed in the motion.conf file multiple times. These specifications should be the LAST lines in the motion.conf file. - See the Configuration Files section within + See the Configuration Files section within this guide for a complete discussion of what to put into the camera0.conf, camera1.conf, cameraX.conf files that would be specified in this option. @@ -2554,6 +2577,7 @@

      v4l2_palette

      The following are each of the palette options. For the Motion configuration, specify the numeric value as the Motion option.

      +
      @@ -2678,6 +2702,7 @@

      v4l2_palette

      +

      It is possible that after looping through all of the palette options for the camera, Motion will not find a palette that is acceptable for processing. In this situation, it is possible to use the @@ -2787,7 +2812,8 @@

      roundrobin_frames

      Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible. The Round Robin feature is automatically activated where multiple cameras are sharing the same video - device. Each camera can then set different input or frequency options to change camera. + device. Each camera can then set different input or + frequency options to change camera. If multiple cameras use the same video device, they each can capture roundrobin_frames number of frames before having to share the device with the other cameras.

      @@ -2803,11 +2829,12 @@

      roundrobin_frames

      per input. If you only need 2 or 3 cameras you can also simply put 2 or 3 cheap TV cards in the computer. Linux has no problem working with multiple TV cards. (or better yet, it multiple cheap network cameras) If multiple cameras use the same video device, they each can capture - roundrobin_frames number of frames + roundrobin_frames number of frames before having to share the device with the other cameras. When another camera wants to watch another input or frequency or size the first - roundrobin_skip number of frames are skipped to allow the - device to settle. The last option roundrobin_switchfilter is supposed + roundrobin_skip number of frames are skipped to allow the + device to settle. The last option + roundrobin_switchfilter is supposed to prevent the change of camera from being detected as Motion. Its function is not perfect and sometimes prevents detection of real motion. You should start with having the option disabled and then try with the option enabled to see if you can skip less frames @@ -3313,28 +3340,14 @@

      text_left

      This is how the overlaid text is located.

      - +
      + + + + - + +
      CHANGES
       
       
       
       
      - - - - - - - - - -
      -

        





       

      -
      -

       CHANGES





       

      -
      -



      TEXT_LEFT

      -
      -

      TEXT_RIGHT
      YYYY-MM-DD
      HH:MM:SS 

      -
      -

       
       
       
       TEXT_LEFT

       
       TEXT_RIGHT
      YYYY-MM-DD
      HH:MM:SS 

      @@ -3369,30 +3382,17 @@

      text_right

      This is how the overlaid text is located.

      - +
      - + + + + + +
      - - - - - - - - - -
      -

        





       

      -
      -

       CHANGES





       

      -
      -



      TEXT_LEFT

      -
      -

      TEXT_RIGHT
      YYYY-MM-DD
      HH:MM:SS 

      -
      -
      CHANGES
       
       
       
       

       
       
       
       TEXT_LEFT

       
       TEXT_RIGHT
      YYYY-MM-DD
      HH:MM:SS 
      +

      @@ -3409,28 +3409,14 @@

      text_changes

      reference frame is displayed in the upper right corner of the pictures. This is good for calibration and testing. This is how the overlaid text is located.

      - +
      + + + + - + +
      CHANGES
       
       
       
       
      - - - - - - - - - -
      -

        





       

      -
      -

       CHANGES





       

      -
      -



      TEXT_LEFT

      -
      -

      TEXT_RIGHT
      YYYY-MM-DD
      HH:MM:SS 

      -
      -

       
       
       
       TEXT_LEFT

       
       TEXT_RIGHT
      YYYY-MM-DD
      HH:MM:SS 

      @@ -3649,7 +3635,8 @@

      mask_file

      You can adjust sensitivity by using gray tones. If you do not have a mask file disable this option by not having it in the config file or comment it out. - If you are using the rotate or flip_axis options, note that the mask is + If you are using the rotate + or flip_axis options, note that the mask is applied after the rotation.

      Detailed Description @@ -3740,11 +3727,11 @@

      smart_mask_speed

      is constant over all available framerates. When smartmask is enabled and motion is also configured to either write motion-images or motion-mpegs, the current smartmask is copied as an overlay into the black/white motion-pictures/mpegs in red colour. - Same thing happens to the webcam stream when Motion runs in setup_mode. + Same thing happens to the webcam stream when Motion runs in setup_mode. That way you can easily adjust smart_mask_speed.

      - The mask_file option provides a static mask to turn off sensitivity in certain areas. + The mask_file option provides a static mask to turn off sensitivity in certain areas. This is very useful to mask a street with cars passing by all day long etc...

      But imagine a scenario with large bushes and big trees where all the leaves are moving @@ -4487,13 +4474,21 @@

      movie_extpipe

      Sample:

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

      @@ -4605,7 +4600,7 @@

      Output - Pipe Options

      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 + 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. @@ -4676,36 +4671,40 @@

      Web Control

      Example to pause motion detection

      -
      -        lwp-request http://localhost:8080/0/detection/pause
      + + lwp-request http://localhost:8080/0/detection/pause +

      Example to start motion detection

      -
      -        lwp-request http://localhost:8080/0/detection/start
      + + lwp-request http://localhost:8080/0/detection/start +

      Example script to update the text_left with cpu load (verbose for clarity) -
      -          #!/bin/bash
      -
      -          LOAD=`top -b -n2 | grep "Cpu(s)" | awk '{print $2+$4}' | tail -n1`
      -
      -          TEXTLEFT=""
      -          TEXTLEFT=$TEXTLEFT"System at %{host}"
      -          TEXTLEFT=$TEXTLEFT"\nCPU $LOAD "
      -          TEXTLEFT=$TEXTLEFT"\nfps: %{fps}"
      -          TEXTLEFT=$TEXTLEFT"\nDate: %Y-%m-%d"
      -          TEXTLEFT=$TEXTLEFT"\n%T-%q"
      -
      -          # Replace special chars with needed urlcodes
      -          TEXTLEFT="${TEXTLEFT//%/%25}"     #Replace % with %25
      -          TEXTLEFT="${TEXTLEFT// /%20}"     #Replace spaces with %20
      -          TEXTLEFT="${TEXTLEFT//\{/%7B}"    #Replace { with %7B
      -          TEXTLEFT="${TEXTLEFT//\}/%7D}"    #Replace } with %7D
      -
      -          curl http://localhost:8080/1/config/set?text_left=$TEXTLEFT
      -
      -          return 0
      +

      + + #!/bin/bash
      +
      + LOAD=`top -b -n2 | grep "Cpu(s)" | awk '{print $2+$4}' | tail -n1`
      +
      + TEXTLEFT=""
      + TEXTLEFT=$TEXTLEFT"System at %{host}"
      + TEXTLEFT=$TEXTLEFT"\nCPU $LOAD "
      + TEXTLEFT=$TEXTLEFT"\nfps: %{fps}"
      + TEXTLEFT=$TEXTLEFT"\nDate: %Y-%m-%d"
      + TEXTLEFT=$TEXTLEFT"\n%T-%q"
      +
      + # Replace special chars with needed urlcodes
      + TEXTLEFT="${TEXTLEFT//%/%25}" #Replace % with %25
      + TEXTLEFT="${TEXTLEFT// /%20}" #Replace spaces with %20
      + TEXTLEFT="${TEXTLEFT//\{/%7B}" #Replace { with %7B
      + TEXTLEFT="${TEXTLEFT//\}/%7D}" #Replace } with %7D
      +
      + curl http://localhost:8080/1/config/set?text_left=$TEXTLEFT
      +
      + return 0
      +
      Note that the replacement of characters with the urlcode values is required whenever updating via a script or outside the html/css webcontrol_interface

      @@ -5351,13 +5350,13 @@

      sql_query_start

      SQL query that executes against the event table which tracks the unique events of motion.

      Once the new record is added to this table, the mysql function mysql_insert_id is then - executed to provide the key back into the dbeventid specifier. + executed to provide the key back into the dbeventid specifier.

      - The dbeventid specifier can then be used in the sql_query as a parameter + The dbeventid specifier can then be used in the sql_query as a parameter to that query for inserting into the table.

      - Although this query is run for all the different database options, the dbeventid is - only set for mysql databases. For the other databases, the dbeventid is always set + Although this query is run for all the different database options, the dbeventid is + only set for mysql databases. For the other databases, the dbeventid is always set to zero.

      @@ -5706,43 +5705,45 @@

      track_generic_move

      variables. The 3/8 and 5/8 are illustrative only and set based upon testing with a VIVOTEK PZ81X1 camera. The values and methods applicable to any other camera would need to be established by the user.

      -
      #!/bin/bash
      -
      -LOCKFILE=/tmp/track_generic_move_netcam.lock
      -if [ -e "$LOCKFILE" ]; then  # Trick to avoid flooding
      -  exit 0                     # the netcam of multiple
      -fi                           # moving commands.
      -
      -function movecam() {
      -  touch $LOCKFILE
      -  curl "http://youripaddress/cgi-bin/camctrl/camctrl.cgi?move=$1"
      -  LOCKED=true
      -}
      -
      -case "$TRACK_ACTION" in
      -  "center")
      -    movecam home
      -    ;;
      -  "move")
      -    if [ "$TRACK_CENT_X" -lt "$((TRACK_IMGS_WIDTH*3/8))" ]; then
      -      movecam left
      -    fi
      -    if [ "$TRACK_CENT_X" -gt "$((TRACK_IMGS_WIDTH*5/8))" ]; then
      -      movecam right
      -    fi
      -    if [ "$TRACK_CENT_Y" -lt "$((TRACK_IMGS_HEIGHT*3/8))" ]; then
      -      movecam up
      -    fi
      -    if [ "$TRACK_CENT_Y" -gt "$((TRACK_IMGS_HEIGHT*5/8))" ]; then
      -      movecam down
      -    fi
      -    ;;
      -esac
      -
      -if [ "$LOCKED" = "true" ]; then
      -  sleep 2
      -  rm -f "$LOCKFILE"
      -fi
      + + #!/bin/bash
      +
      + LOCKFILE=/tmp/track_generic_move_netcam.lock
      + if [ -e "$LOCKFILE" ]; then # Trick to avoid flooding
      + exit 0 # the netcam of multiple
      + fi # moving commands.
      +
      + function movecam() {
      + touch $LOCKFILE
      + curl "http://youripaddress/cgi-bin/camctrl/camctrl.cgi?move=$1"
      + LOCKED=true
      + }
      +
      + case "$TRACK_ACTION" in
      + "center")
      + movecam home
      + ;;
      + "move")
      + if [ "$TRACK_CENT_X" -lt "$((TRACK_IMGS_WIDTH*3/8))" ]; then
      + movecam left
      + fi
      + if [ "$TRACK_CENT_X" -gt "$((TRACK_IMGS_WIDTH*5/8))" ]; then
      + movecam right
      + fi
      + if [ "$TRACK_CENT_Y" -lt "$((TRACK_IMGS_HEIGHT*3/8))" ]; then
      + movecam up
      + fi
      + if [ "$TRACK_CENT_Y" -gt "$((TRACK_IMGS_HEIGHT*5/8))" ]; then
      + movecam down
      + fi
      + ;;
      + esac
      +
      + if [ "$LOCKED" = "true" ]; then
      + sleep 2
      + rm -f "$LOCKFILE"
      + fi
      +

      diff --git a/motion_stylesheet.css b/motion_stylesheet.css index 964aff752..139f0a8df 100644 --- a/motion_stylesheet.css +++ b/motion_stylesheet.css @@ -1,21 +1,19 @@ * { - box-sizing: border-box; } + 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; - } - + color: #606c71; } a { color: #1e6bb8; - text-decoration: none; } - a:hover { + text-decoration: none;} +a:hover { text-decoration: underline; } - .btn { display: inline-block; margin-bottom: 1rem; @@ -26,145 +24,85 @@ a { border-width: 1px; border-radius: 0.3rem; transition: color 0.2s, background-color 0.2s, border-color 0.2s; } - .btn + .btn { +.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); } - -@media screen and (min-width: 64em) { - .btn { - padding: 0.75rem 1rem; } } - -@media screen and (min-width: 42em) and (max-width: 64em) { - .btn { - padding: 0.6rem 0.9rem; - font-size: 0.9rem; } } - -@media screen and (max-width: 42em) { - .btn { - display: block; - width: 100%; - padding: 0.75rem; - font-size: 0.9rem; } - .btn + .btn { - margin-top: 1rem; - margin-left: 0; } } - .page-header { color: #fff; text-align: center; background-color: #159957; background-image: linear-gradient(120deg, #155799, #159957); } - -@media screen and (min-width: 64em) { - .page-header { - padding: 1rem 2rem; } } - -@media screen and (min-width: 42em) and (max-width: 64em) { - .page-header { - padding: 1rem 2rem; } } - -@media screen and (max-width: 42em) { - .page-header { - padding: 1rem 1rem; } } - +.page-header h1 { + margin-bottom: 0.1em; + margin-top: 0.1em;} .project-name { margin-top: 0; margin-bottom: 0.1rem; } - -@media screen and (min-width: 64em) { - .project-name { - font-size: 3.25rem; } } - -@media screen and (min-width: 42em) and (max-width: 64em) { - .project-name { - font-size: 2.25rem; } } - -@media screen and (max-width: 42em) { - .project-name { - font-size: 1.75rem; } } - .project-tagline { margin-bottom: 2rem; font-weight: normal; opacity: 0.7; } - -@media screen and (min-width: 64em) { - .project-tagline { - font-size: 1.25rem; } } - -@media screen and (min-width: 42em) and (max-width: 64em) { - .project-tagline { - font-size: 1.15rem; } } - -@media screen and (max-width: 42em) { - .project-tagline { - font-size: 1rem; } } - .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: 2rem; - margin-bottom: 1rem; + margin-top: 0.5em; + margin-bottom: 0.5em; font-weight: normal; - color: #159957; } + color: #159957;} .main-content p { margin-bottom: 1em; } .main-content code { padding: 2px 4px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 0.9rem; color: #383e41; background-color: #f3f6fa; - border-radius: 0.3rem; } + 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; - word-wrap: normal; background-color: #f3f6fa; border: solid 1px #dce6f0; - border-radius: 0.3rem; } + 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; } + 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; } + 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; } + border-radius: 0.3rem;} .main-content pre code, .main-content pre tt { display: inline; - max-width: initial; padding: 0; margin: 0; - overflow: initial; + 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; } + content: normal; } .main-content ul, .main-content ol { margin-top: 0; } .main-content blockquote { @@ -173,218 +111,375 @@ a { color: #819198; border-left: 0.3rem solid #dce6f0; } .main-content blockquote > :first-child { - margin-top: 0; } + margin-top: 0; } .main-content blockquote > :last-child { - margin-bottom: 0; } + margin-bottom: 0; } +/* .main-content table { display: block; - width: 100%; overflow: auto; word-break: normal; - word-break: keep-all; } + } .main-content table th { - font-weight: bold; } - .main-content table th, .main-content table td { - padding: 0.5rem 1rem; - border: 1px solid #e9ebec; } + 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 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; } - -@media screen and (min-width: 64em) { - .main-content { - max-width: 64rem; - padding: 2rem 6rem; - margin: 0 auto; - font-size: 1.1rem; } } - -@media screen and (min-width: 42em) and (max-width: 64em) { - .main-content { - padding: 2rem 4rem; - font-size: 1.1rem; } } - -@media screen and (max-width: 42em) { - .main-content { - padding: 2rem 1rem; - font-size: 1rem; } } + border: 0;} .site-footer { padding-top: 2rem; margin-top: 2rem; - border-top: solid 1px #eff0f1; } - + border-top: solid 1px #eff0f1;} .site-footer-owner { display: block; font-weight: bold; } - .site-footer-credits { - color: #819198; } + color: #819198;} -@media screen and (min-width: 64em) { - .site-footer { - font-size: 1rem; } } +.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; + } -@media screen and (min-width: 42em) and (max-width: 64em) { - .site-footer { - font-size: 1rem; } } + .topnav .topnav-d { + float: right; + display: block; + } -@media screen and (max-width: 42em) { - .site-footer { - font-size: 0.9rem; } } + .topnav .topnav-m { + float: right; + display: none; + } + + .topnav .logoimg { + width:auto; + height:3.0em;} -.nav-button { - list-style-type: none; - margin: 0; - padding: 0; - overflow: hidden; - background-color: #333; } +@media screen and (max-width: 48em) { -.nav-button ul { - list-style-type: none; - margin: 0; - padding: 0; - overflow: scroll; - background-color: #333; + .topnav a:not(:first-child) { + display: none; + } + + .topnav .topnav-d{ + display: none; + } + + .topnav .topnav-m:not(:first-child) { + display: none; } -.nav-button li { + + .topnav a.icon { float: right; + display: block; + } + + .topnav.responsive {position: relative;} + .topnav.responsive a.icon { + position: absolute; + right: 0; + top: 0; } - .nav-button li a { + .topnav.responsive a { + float: none; display: block; - color: white; - text-align: center; - padding: 14px 16px; - text-decoration: none; + text-align: left; } -@media screen and (min-width: 64em) { - .nav-button { - font-size: 1rem; } } + .topnav.responsive .topnav-d { + float: none; + display: none; + text-align: left; + } -@media screen and (min-width: 42em) and (max-width: 64em) { - .nav-button { - font-size: 1rem; } } + .topnav.responsive .topnav-m { + float: none; + display: block; + text-align: left; + } -@media screen and (max-width: 42em) { - .nav-button { - font-size: 0.9rem; } } + .topnav.responsive .dropdown {float: none;} + .topnav.responsive .dropdown-content {position: relative;} + .topnav.responsive .dropdown .dropbtn { + display: block; + width: 100%; + text-align: left; + } -.nav-vertical { - list-style-type: none; - margin: 0; - padding: 0; - overflow: scroll; } -.nav-vertical body { - margin: 0; + + +.subnav { + overflow: hidden; + background-color: #159957; + background-image: linear-gradient(120deg, #155799, #159957); + border-top: 2px solid black; } -.nav-vertical ul { - list-style-type: none; +.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; - padding: 0; - width: 25%; +} +.dropdown-content { + display: none; + position: absolute; background-color: #f1f1f1; - height: 100%; - overflow: scroll; - } -.nav-vertical li { + 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; } - .nav-vertical li a { + .subnav a.icon { + float: right; display: block; - color: #000; - padding: 8px 16px; - text-decoration: none; } - -@media screen and (min-width: 64em) { - .nav-vertical { - font-size: 1rem; } } - -@media screen and (min-width: 42em) and (max-width: 64em) { - .nav-vertical { - font-size: 1rem; } } - -@media screen and (max-width: 42em) { - .nav-vertical { - font-size: 0.9rem; } } - -.vertical-menu { - height: 100%; - width: 15%; - position: fixed; - z-index: 1; + .subnav.responsive {position: relative;} + .subnav.responsive a.icon { + position: absolute; + right: 0; top: 0; - left: 0; - overflow-x: scroll; - padding-top: 60px; - transition: 0.5s; -} - .vertical-menu a { - padding: 5px 14px 4px 16px; - text-decoration: none; - font-size: 0.80em ; + } + .subnav.responsive a { + float: none; display: block; - transition: 0.3s + text-align: left; } - .vertical-menu a:hover { - background-color: #ccc; - } - .vertical-menu a.active { - background-color: #4CAF50; - color: white; - } - .vertical-menu button { - padding: 5px 14px 4px 16px; - text-decoration: none; + .subnav.responsive .dropdown {float: none;} + .subnav.responsive .dropdown-content {position: relative;} + .subnav.responsive .dropdown .dropbtn { display: block; - transition: 0.3s; - border: none; width: 100%; - overflow-x: scroll; text-align: left; - outline: none; - background-color: white; - color: #1e6bb8; + } +} +.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; } -.vertical-menu button:hover { - background-color: #cdc; + + +@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; + } + } -.panel { - padding: 5px 14px 4px 16px; - background-color: white; - max-height: 0; - overflow: scroll; - overflow-x: hidden; - transition: max-height 0.2s ease-out; +@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 (min-width: 64em) { - .vertical-menu { - font-size: 1rem; } } +@media screen and (max-width: 48em) { -@media screen and (min-width: 42em) and (max-width: 64em) { - .vertical-menu { - font-size: 1rem; } } -@media screen and (max-width: 42em) { - .vertical-menu { - font-size: 0.9rem; } } + .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; + } +} From 06b403fdad01ef1fc821f6af91a989bd51860111 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Sun, 18 Nov 2018 08:43:40 -0700 Subject: [PATCH 06/16] Passthrough locking revision Closes #843 --- netcam_rtsp.c | 59 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/netcam_rtsp.c b/netcam_rtsp.c index 6b0e9a59e..73d47e59d 100644 --- a/netcam_rtsp.c +++ b/netcam_rtsp.c @@ -72,7 +72,6 @@ static void netcam_rtsp_null_context(struct rtsp_context *rtsp_data){ rtsp_data->frame = NULL; rtsp_data->codec_context = NULL; rtsp_data->format_context = NULL; - rtsp_data->pktarray = NULL; rtsp_data->transfer_format = NULL; } @@ -87,7 +86,6 @@ static void netcam_rtsp_close_context(struct rtsp_context *rtsp_data){ if (rtsp_data->format_context != NULL) avformat_close_input(&rtsp_data->format_context); if (rtsp_data->pktarray != NULL) netcam_rtsp_pktarray_free(rtsp_data); if (rtsp_data->transfer_format != NULL) avformat_close_input(&rtsp_data->transfer_format); - netcam_rtsp_null_context(rtsp_data); } @@ -112,13 +110,10 @@ static void netcam_rtsp_pktarray_resize(struct context *cnt, int is_highres){ int64_t idnbr_last, idnbr_first; int indx; - int resize_pktarray; struct rtsp_context *rtsp_data; struct packet_item *tmp; int newsize; - - resize_pktarray = TRUE; if (is_highres){ idnbr_last = cnt->imgs.image_ring[cnt->imgs.image_ring_out].idnbr_high; idnbr_first = cnt->imgs.image_ring[cnt->imgs.image_ring_in].idnbr_high; @@ -133,32 +128,32 @@ static void netcam_rtsp_pktarray_resize(struct context *cnt, int is_highres){ /* The 30 is arbitrary */ /* Double the size plus double last diff so we don't catch our tail */ - newsize =((idnbr_first - idnbr_last) * 2 ); - newsize = newsize + ((rtsp_data->idnbr - idnbr_last ) * 2); + newsize =((idnbr_first - idnbr_last) * 2 ) + ((rtsp_data->idnbr - idnbr_last ) * 2); if (newsize < 30) newsize = 30; - if (rtsp_data->pktarray_size >= newsize) resize_pktarray = FALSE; - if ((resize_pktarray) || (rtsp_data->pktarray_size < 30)){ - tmp = mymalloc(newsize * sizeof(struct packet_item)); - if (rtsp_data->pktarray_size > 0 ){ - memcpy(tmp, rtsp_data->pktarray, sizeof(struct packet_item) * rtsp_data->pktarray_size); - } - for(indx = rtsp_data->pktarray_size; indx < newsize; indx++) { - av_init_packet(&tmp[indx].packet); - tmp[indx].packet.data=NULL; - tmp[indx].packet.size=0; - tmp[indx].idnbr = 0; - tmp[indx].iskey = FALSE; - tmp[indx].iswritten = FALSE; - } - pthread_mutex_lock(&rtsp_data->mutex_pktarray); + pthread_mutex_lock(&rtsp_data->mutex_pktarray); + if ((rtsp_data->pktarray_size < newsize) || (rtsp_data->pktarray_size < 30)){ + tmp = mymalloc(newsize * sizeof(struct packet_item)); + if (rtsp_data->pktarray_size > 0 ){ + memcpy(tmp, rtsp_data->pktarray, sizeof(struct packet_item) * rtsp_data->pktarray_size); + } + for(indx = rtsp_data->pktarray_size; indx < newsize; indx++) { + av_init_packet(&tmp[indx].packet); + tmp[indx].packet.data=NULL; + tmp[indx].packet.size=0; + tmp[indx].idnbr = 0; + tmp[indx].iskey = FALSE; + tmp[indx].iswritten = FALSE; + } + if (rtsp_data->pktarray != NULL) free(rtsp_data->pktarray); rtsp_data->pktarray = tmp; rtsp_data->pktarray_size = newsize; - pthread_mutex_unlock(&rtsp_data->mutex_pktarray); - MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO - ,_("%s: Resized packet array to %d"), rtsp_data->cameratype,newsize); - } + + MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO + ,_("%s: Resized packet array to %d"), rtsp_data->cameratype,newsize); + } + pthread_mutex_unlock(&rtsp_data->mutex_pktarray); } @@ -168,10 +163,13 @@ static void netcam_rtsp_pktarray_add(struct rtsp_context *rtsp_data){ int retcd; char errstr[128]; - if (rtsp_data->pktarray_size == 0) return; - pthread_mutex_lock(&rtsp_data->mutex_pktarray); + if (rtsp_data->pktarray_size == 0){ + pthread_mutex_unlock(&rtsp_data->mutex_pktarray); + return; + } + /* Recall pktarray_size is one based but pktarray is zero based */ if (rtsp_data->pktarray_index == (rtsp_data->pktarray_size-1) ){ indx_next = 0; @@ -702,7 +700,7 @@ static int netcam_rtsp_ntc(struct rtsp_context *rtsp_data){ ,rtsp_data->codec_context->width,rtsp_data->codec_context->height ,rtsp_data->imgsize.width,rtsp_data->imgsize.height); } else { - MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("format than YUV420P. The image sent is being ")); + MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("The image sent is being ")); MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("trancoded to YUV420P. If possible change netcam ")); MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("picture format to YUV420P to possibly lower CPU usage.")); } @@ -972,6 +970,7 @@ static void netcam_rtsp_set_parms (struct context *cnt, struct rtsp_context *rts rtsp_data->img_latest->ptr = mymalloc(NETCAM_BUFFSIZE); rtsp_data->pktarray_size = 0; rtsp_data->pktarray_index = -1; + rtsp_data->pktarray = NULL; rtsp_data->handler_finished = TRUE; rtsp_data->first_image = TRUE; @@ -1341,7 +1340,7 @@ static void netcam_rtsp_handler_wait(struct rtsp_context *rtsp_data){ ((rtsp_data->frame_curr_tm.tv_sec - rtsp_data->frame_prev_tm.tv_sec) * 1000000L) - (rtsp_data->frame_curr_tm.tv_usec - rtsp_data->frame_prev_tm.tv_usec); if ((usec_delay > 0) && (usec_delay < 1000000L)){ - SLEEP(0, usec_delay * 1000) + SLEEP(0, usec_delay * 1000); } } From ccea9a3690e69410f14823c411e3d88f036ebaaf Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Tue, 20 Nov 2018 18:19:03 -0700 Subject: [PATCH 07/16] Remove privacy mask areas from motion detection --- alg.c | 4 ++-- motion.c | 14 ++++++++++---- motion.h | 1 + video_v4l2.c | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/alg.c b/alg.c index c289cdc68..20c83c53a 100644 --- a/alg.c +++ b/alg.c @@ -1327,7 +1327,7 @@ void alg_update_reference_frame(struct context *cnt, int action) int accept_timer = cnt->lastrate * ACCEPT_STATIC_OBJECT_TIME; int i, threshold_ref; int *ref_dyn = cnt->imgs.ref_dyn; - unsigned char *image_virgin = cnt->imgs.image_virgin.image_norm; + unsigned char *image_virgin = cnt->imgs.image_vprvcy.image_norm; unsigned char *ref = cnt->imgs.ref; unsigned char *smartmask = cnt->imgs.smartmask_final; unsigned char *out = cnt->imgs.img_motion.image_norm; @@ -1367,7 +1367,7 @@ void alg_update_reference_frame(struct context *cnt, int action) } else { /* action == RESET_REF_FRAME - also used to initialize the frame at startup. */ /* Copy fresh image */ - memcpy(cnt->imgs.ref, cnt->imgs.image_virgin.image_norm, cnt->imgs.size_norm); + memcpy(cnt->imgs.ref, cnt->imgs.image_vprvcy.image_norm, cnt->imgs.size_norm); /* Reset static objects */ memset(cnt->imgs.ref_dyn, 0, cnt->imgs.motionsize * sizeof(*cnt->imgs.ref_dyn)); } diff --git a/motion.c b/motion.c index 4367046f3..fa9a7f49d 100644 --- a/motion.c +++ b/motion.c @@ -1327,6 +1327,7 @@ static int motion_init(struct context *cnt) /* contains the moving objects of ref. frame */ cnt->imgs.ref_dyn = mymalloc(cnt->imgs.motionsize * sizeof(*cnt->imgs.ref_dyn)); cnt->imgs.image_virgin.image_norm = mymalloc(cnt->imgs.size_norm); + cnt->imgs.image_vprvcy.image_norm = mymalloc(cnt->imgs.size_norm); cnt->imgs.smartmask = mymalloc(cnt->imgs.motionsize); cnt->imgs.smartmask_final = mymalloc(cnt->imgs.motionsize); cnt->imgs.smartmask_buffer = mymalloc(cnt->imgs.motionsize * sizeof(*cnt->imgs.smartmask_buffer)); @@ -1625,6 +1626,9 @@ static void motion_cleanup(struct context *cnt) { free(cnt->imgs.image_virgin.image_norm); cnt->imgs.image_virgin.image_norm = NULL; + free(cnt->imgs.image_vprvcy.image_norm); + cnt->imgs.image_vprvcy.image_norm = NULL; + free(cnt->imgs.labels); cnt->imgs.labels = NULL; @@ -2048,6 +2052,8 @@ static int mlp_capture(struct context *cnt){ mlp_mask_privacy(cnt); + memcpy(cnt->imgs.image_vprvcy.image_norm, cnt->current_image->image_norm, cnt->imgs.size_norm); + /* * If the camera is a netcam we let the camera decide the pace. * Otherwise we will keep on adding duplicate frames. @@ -2121,7 +2127,7 @@ static int mlp_capture(struct context *cnt){ if (cnt->video_dev >= 0 && cnt->missing_frame_counter < (MISSING_FRAMES_TIMEOUT * cnt->conf.framerate)) { - memcpy(cnt->current_image->image_norm, cnt->imgs.image_virgin.image_norm, cnt->imgs.size_norm); + memcpy(cnt->current_image->image_norm, cnt->imgs.image_vprvcy.image_norm, cnt->imgs.size_norm); } else { cnt->lost_connection = 1; @@ -2185,9 +2191,9 @@ static void mlp_detection(struct context *cnt){ * anyway */ if (cnt->detecting_motion || cnt->conf.setup_mode) - cnt->current_image->diffs = alg_diff_standard(cnt, cnt->imgs.image_virgin.image_norm); + cnt->current_image->diffs = alg_diff_standard(cnt, cnt->imgs.image_vprvcy.image_norm); else - cnt->current_image->diffs = alg_diff(cnt, cnt->imgs.image_virgin.image_norm); + cnt->current_image->diffs = alg_diff(cnt, cnt->imgs.image_vprvcy.image_norm); /* Lightswitch feature - has light intensity changed? * This can happen due to change of light conditions or due to a sudden change of the camera @@ -2290,7 +2296,7 @@ static void mlp_tuning(struct context *cnt){ */ if ((cnt->conf.noise_tune && cnt->shots == 0) && (!cnt->detecting_motion && (cnt->current_image->diffs <= cnt->threshold))) - alg_noise_tune(cnt, cnt->imgs.image_virgin.image_norm); + alg_noise_tune(cnt, cnt->imgs.image_vprvcy.image_norm); /* diff --git a/motion.h b/motion.h index a1ee75ab3..1686b06c1 100644 --- a/motion.h +++ b/motion.h @@ -301,6 +301,7 @@ struct images { struct image_data img_motion; /* Picture buffer for motion images */ int *ref_dyn; /* Dynamic objects to be excluded from reference frame */ struct image_data image_virgin; /* Last picture frame with no text or locate overlay */ + struct image_data image_vprvcy; /* Virgin image with the privacy mask applied */ struct image_data preview_image; /* Picture buffer for best image when enables */ unsigned char *mask; /* Buffer for the mask file */ unsigned char *smartmask; diff --git a/video_v4l2.c b/video_v4l2.c index 8b3412793..57258448d 100644 --- a/video_v4l2.c +++ b/video_v4l2.c @@ -461,7 +461,7 @@ static int v4l2_autobright(struct context *cnt, struct video_dev *curdev, int me avg = 0; pixel_count = 0; - image = cnt->imgs.image_virgin.image_norm; + image = cnt->imgs.image_vprvcy.image_norm; for (indx = 0; indx < cnt->imgs.motionsize; indx += 10) { avg += image[indx]; pixel_count++; From f7f0fb9ab165df071ae005955377ebc20ca15ed9 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Tue, 20 Nov 2018 18:19:44 -0700 Subject: [PATCH 08/16] Eliminate Log Message --- event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/event.c b/event.c index a90627c09..15eb20bd8 100644 --- a/event.c +++ b/event.c @@ -672,7 +672,7 @@ static void event_image_preview(struct context *cnt, * Save best preview-shot also when no movies are recorded or imagepath * is used. Filename has to be generated - nothing available to reuse! */ - MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "different filename or picture only!"); + /* * conf.picture_filename would normally be defined but if someone deleted it by * control interface it is better to revert to the default than fail. From 37c088a933f1a9e4836146072fe5e949e537fde5 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Tue, 20 Nov 2018 18:20:36 -0700 Subject: [PATCH 09/16] Prevent movie_passthrough updates via webcontrol Closes #836 --- motion.c | 9 +++++---- motion.h | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/motion.c b/motion.c index fa9a7f49d..7e543da26 100644 --- a/motion.c +++ b/motion.c @@ -1234,6 +1234,7 @@ static int motion_init(struct context *cnt) cnt->imgs.width_high = 0; cnt->imgs.height_high = 0; cnt->imgs.size_high = 0; + cnt->movie_passthrough = cnt->conf.movie_passthrough; MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO ,_("Camera %d started: motion detection %s"), @@ -1245,9 +1246,9 @@ static int motion_init(struct context *cnt) if (init_camera_type(cnt) != 0 ) return -3; if ((cnt->camera_type != CAMERA_TYPE_RTSP) && - (cnt->conf.movie_passthrough)) { + (cnt->movie_passthrough)) { MOTION_LOG(WRN, TYPE_ALL, NO_ERRNO,_("Pass-through processing disabled.")); - cnt->conf.movie_passthrough = 0; + cnt->movie_passthrough = FALSE; } if ((cnt->conf.height == 0) || (cnt->conf.width == 0)) { @@ -4045,12 +4046,12 @@ void util_threadname_get(char *threadname){ } int util_check_passthrough(struct context *cnt){ #if (HAVE_FFMPEG && LIBAVFORMAT_VERSION_MAJOR < 55) - if (cnt->conf.movie_passthrough) + if (cnt->movie_passthrough) MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO ,_("FFMPEG version too old. Disabling pass-through processing.")); return 0; #else - if (cnt->conf.movie_passthrough){ + if (cnt->movie_passthrough){ MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO ,_("pass-through is enabled but is still experimental.")); return 1; diff --git a/motion.h b/motion.h index 1686b06c1..585ea5194 100644 --- a/motion.h +++ b/motion.h @@ -473,9 +473,10 @@ struct context { char extpipefilename[PATH_MAX]; int movie_last_shot; - struct ffmpeg *ffmpeg_output; - struct ffmpeg *ffmpeg_output_motion; - struct ffmpeg *ffmpeg_timelapse; + struct ffmpeg *ffmpeg_output; + struct ffmpeg *ffmpeg_output_motion; + struct ffmpeg *ffmpeg_timelapse; + int movie_passthrough; char timelapsefilename[PATH_MAX]; char motionfilename[PATH_MAX]; From f76cbf3743b98b68909016d37e8e85d65bd86411 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Wed, 21 Nov 2018 11:28:30 -0700 Subject: [PATCH 10/16] Additional message for initial setup --- motion_config.html | 1 + 1 file changed, 1 insertion(+) diff --git a/motion_config.html b/motion_config.html index a5abb17bc..2af3b1c69 100644 --- a/motion_config.html +++ b/motion_config.html @@ -130,6 +130,7 @@

      Basic Setup

    • Specify the camera in the configuration files.
    • Start Motion from a terminal via the command line
    • Review the messages to ensure camera was found and press cntrl-c to exit
    • +
    • Specify a target_dir in the configuration file.
    • Enable the web stream in the configuration file
      • Specify a stream_port
      • From f001f5aec614a42432a76ba43c6ee55e0a45a493 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Fri, 23 Nov 2018 00:46:01 +0100 Subject: [PATCH 11/16] fix static linking with webp (#850) Static build with webp fails because webp is put before webpmux. Fixes: - http://autobuild.buildroot.org/results/4d4e72808300ba1ff79ca794930112b554eb2533 Signed-off-by: Fabrice Fontaine --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 89179e52b..60147fb30 100644 --- a/configure.ac +++ b/configure.ac @@ -276,7 +276,7 @@ if test "${WEBP}" = "yes"; then AC_MSG_RESULT(found) AC_DEFINE([HAVE_WEBP], 1, [Define to 1 if WEBP is around]) HAVE_WEBP="yes" - TEMP_LIBS="$TEMP_LIBS -lwebp -lwebpmux" + TEMP_LIBS="$TEMP_LIBS -lwebpmux -lwebp" else AC_MSG_RESULT(not found) fi From 7573d9e1e1f3c1ff4e5aeac1579cf5dc3d6ddcef Mon Sep 17 00:00:00 2001 From: tosiara Date: Sun, 25 Nov 2018 19:59:49 +0200 Subject: [PATCH 12/16] Force null terminator when writing description string into EXIF Fixes #833 --- picture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picture.c b/picture.c index a715491d7..4b82913a0 100644 --- a/picture.c +++ b/picture.c @@ -344,7 +344,7 @@ static unsigned prepare_exif(unsigned char **exif, writing.buf += 2; if (description) - put_stringentry(&writing, TIFF_TAG_IMAGE_DESCRIPTION, description, 0); + put_stringentry(&writing, TIFF_TAG_IMAGE_DESCRIPTION, description, 1); if (datetime) put_stringentry(&writing, TIFF_TAG_DATETIME, datetime, 1); From d8377cb5bca9a67d68e04c109fc9ad7b8342d71f Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Tue, 27 Nov 2018 18:34:55 -0700 Subject: [PATCH 13/16] v4l2 via netcam revisions Closes #853 Closes #854 Closes #855 Closes #857 --- motion_build.html | 2 +- motion_config.html | 14 ++++++++++++-- netcam_rtsp.c | 6 ++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/motion_build.html b/motion_build.html index 06eeb9fa0..834079b30 100644 --- a/motion_build.html +++ b/motion_build.html @@ -442,7 +442,7 @@

        CentOS 7

        sudo yum groupinstall 'Development Tools'

        - sudo yum install libjpeg-turbo libjpeg-turbo-devel gettext libmicrohttpd-dev + sudo yum install libjpeg-turbo libjpeg-turbo-devel gettext libmicrohttpd-devel

        sudo yum install libzip-devel

        diff --git a/motion_config.html b/motion_config.html index 2af3b1c69..615a7592b 100644 --- a/motion_config.html +++ b/motion_config.html @@ -4401,9 +4401,19 @@

        movie_passthrough

      • Default: off

      - When using a RTSP, RTMP or mjpeg camera, create movie files of the motion with the packets obtained directly - from the camera. For mjpeg cameras, the url must be specified using the mjpeg prefix rather than + When using a RTSP, RTMP, mjpeg and some V4l2 cameras, create movie files of the motion with the packets + obtained directly from the camera. +

      + For mjpeg cameras, the url must be specified using the mjpeg prefix rather than as http +

      + For v4l2 cameras to use the movie_passthrough, they must be specified using the + netcam_url parameter and the v4l2 prefix. + Only webcams that provide mjpeg (v4l2_palette option 8) + or H264 (v4l2_palette option 21) will work with the + movie_passthrough. +

      +

      When using only the single netcam_url this option will reduce the processing required when encoding the images to the resulting movie file. Decoding of the image will still occur on the diff --git a/netcam_rtsp.c b/netcam_rtsp.c index 73d47e59d..8f0f4a0ee 100644 --- a/netcam_rtsp.c +++ b/netcam_rtsp.c @@ -82,9 +82,9 @@ static void netcam_rtsp_close_context(struct rtsp_context *rtsp_data){ if (rtsp_data->swsframe_in != NULL) my_frame_free(rtsp_data->swsframe_in); if (rtsp_data->swsframe_out != NULL) my_frame_free(rtsp_data->swsframe_out); if (rtsp_data->frame != NULL) my_frame_free(rtsp_data->frame); + if (rtsp_data->pktarray != NULL) netcam_rtsp_pktarray_free(rtsp_data); if (rtsp_data->codec_context != NULL) my_avcodec_close(rtsp_data->codec_context); if (rtsp_data->format_context != NULL) avformat_close_input(&rtsp_data->format_context); - if (rtsp_data->pktarray != NULL) netcam_rtsp_pktarray_free(rtsp_data); if (rtsp_data->transfer_format != NULL) avformat_close_input(&rtsp_data->transfer_format); netcam_rtsp_null_context(rtsp_data); @@ -855,9 +855,11 @@ static void netcam_rtsp_set_v4l2(struct rtsp_context *rtsp_data){ sprintf(optfps, "%s","default"); sprintf(optsize, "%s","default"); } + } else { + sprintf(optfps, "%s","default"); + sprintf(optsize, "%s","default"); } - if (rtsp_data->status == RTSP_NOTCONNECTED){ MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO ,_("%s: Requested v4l2_palette option: %d") From 3955c75c851407cf487a775b908993c75fa23a5c Mon Sep 17 00:00:00 2001 From: tosiara Date: Sat, 1 Dec 2018 03:26:47 +0200 Subject: [PATCH 14/16] Added SQL logging Closes #858 --- event.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/event.c b/event.c index 15eb20bd8..bcf2a3e2e 100644 --- a/event.c +++ b/event.c @@ -159,11 +159,13 @@ static void do_sql_query(char *sqlquery, struct context *cnt, int save_id) if (strlen(sqlquery) <= 0) { /* don't try to execute empty queries */ + MOTION_LOG(WRN, TYPE_DB, NO_ERRNO, "Ignoring empty sql query"); return; } #ifdef HAVE_MYSQL if (!strcmp(cnt->conf.database_type, "mysql")) { + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO, "Executing mysql query"); if (mysql_query(cnt->database, sqlquery) != 0) { int error_code = mysql_errno(cnt->database); @@ -209,6 +211,7 @@ static void do_sql_query(char *sqlquery, struct context *cnt, int save_id) #ifdef HAVE_PGSQL if (!strcmp(cnt->conf.database_type, "postgresql")) { + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO, "Executing postgresql query"); PGresult *res; res = PQexec(cnt->database_pg, sqlquery); @@ -250,6 +253,7 @@ static void do_sql_query(char *sqlquery, struct context *cnt, int save_id) if ((!strcmp(cnt->conf.database_type, "sqlite3")) && (cnt->conf.database_dbname)) { int res; char *errmsg = 0; + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO, "Executing sqlite query"); res = sqlite3_exec(cnt->database_sqlite3, sqlquery, NULL, 0, &errmsg); if (res != SQLITE_OK ) { MOTION_LOG(ERR, TYPE_DB, NO_ERRNO, _("SQLite error was %s"), errmsg); From 3c249fbcfae540c9f7259b6286f3cccd750b61bd Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Sun, 2 Dec 2018 12:06:26 -0700 Subject: [PATCH 15/16] Logging messages Closes #861 --- motion.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++-- webu.c | 46 +++++++++++++++++++++++++++++++++---- webu_stream.c | 4 ++-- 3 files changed, 104 insertions(+), 9 deletions(-) diff --git a/motion.c b/motion.c index 7e543da26..b5e3bfcf9 100644 --- a/motion.c +++ b/motion.c @@ -3132,6 +3132,65 @@ static void motion_camera_ids(void){ } } +static void motion_ntc(void){ + + #ifdef HAVE_V4L2 + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("v4l2 : available")); + #else + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("v4l2 : not available")); + #endif + + #ifdef HAVE_BKTR + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("bktr : available")); + #else + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("bktr : not available")); + #endif + + #ifdef HAVE_WEBP + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("webp : available")); + #else + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("webp : not available")); + #endif + + #ifdef HAVE_MMAL + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("mmal : available")); + #else + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("mmal : not available")); + #endif + + #ifdef HAVE_FFMPEG + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("ffmpeg : available")); + #else + MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("ffmpeg : not available")); + #endif + + #ifdef HAVE_MYSQL + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("mysql : available")); + #else + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("mysql : not available")); + #endif + + #ifdef HAVE_SQLITE3 + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("sqlite3: available")); + #else + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("sqlite3: not available")); + #endif + + #ifdef HAVE_PGSQL + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("pgsql : available")); + #else + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("pgsql : not available")); + #endif + + #ifdef HAVE_INTL + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("nls : available")); + #else + MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("nls : not available")); + #endif + + +} + /** * motion_startup @@ -3224,6 +3283,8 @@ static void motion_startup(int daemonize, int argc, char *argv[]) conf_output_parms(cnt_list); + motion_ntc(); + motion_camera_ids(); initialize_chars(); @@ -3261,8 +3322,6 @@ static void motion_start_thread(struct context *cnt){ snprintf(service,6,"%s",cnt->conf.netcam_url); MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Camera ID: %d Camera Name: %s Service: %s") ,cnt->camera_id, cnt->conf.camera_name,service); - MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Stream port %d"), - cnt->conf.stream_port); } else { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Camera ID: %d Camera Name: %s Device: %s") ,cnt->camera_id, cnt->conf.camera_name,cnt->conf.video_device); diff --git a/webu.c b/webu.c index 162a90ba0..1d9a55ffc 100644 --- a/webu.c +++ b/webu.c @@ -1147,6 +1147,10 @@ static void webu_answer_strm_type(struct webui_ctx *webui) { (strcmp(webui->uri_camid,"current") == 0)){ webui->cnct_type = WEBUI_CNCT_STATIC; + } else if ((strlen(webui->uri_camid) > 0) && + (strlen(webui->uri_cmd1) == 0)){ + webui->cnct_type = WEBUI_CNCT_FULL; + } else { webui->cnct_type = WEBUI_CNCT_UNKNOWN; } @@ -1434,7 +1438,7 @@ static void webu_mhd_features_basic(struct mhdstart_ctx *mhdst){ int retcd; retcd = MHD_is_feature_supported (MHD_FEATURE_BASIC_AUTH); if (retcd == MHD_YES){ - MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("Basic authentication: available")); + MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("Basic authentication: available")); } else { if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_auth_method == 1)){ MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Basic authentication: disabled")); @@ -1457,7 +1461,7 @@ static void webu_mhd_features_digest(struct mhdstart_ctx *mhdst){ int retcd; retcd = MHD_is_feature_supported (MHD_FEATURE_DIGEST_AUTH); if (retcd == MHD_YES){ - MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("Digest authentication: available")); + MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("Digest authentication: available")); } else { if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_auth_method == 2)){ MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Digest authentication: disabled")); @@ -1486,9 +1490,9 @@ static void webu_mhd_features_ipv6(struct mhdstart_ctx *mhdst){ int retcd; retcd = MHD_is_feature_supported (MHD_FEATURE_IPv6); if (retcd == MHD_YES){ - MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("IPV6: available")); + MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("IPV6: available")); } else { - MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("IPV6: disabled")); + MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("IPV6: disabled")); if (mhdst->ipv6) mhdst->ipv6 = 0; } #endif @@ -1511,7 +1515,7 @@ static void webu_mhd_features_tls(struct mhdstart_ctx *mhdst){ int retcd; retcd = MHD_is_feature_supported (MHD_FEATURE_SSL); if (retcd == MHD_YES){ - MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("SSL/TLS: available")); + MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("SSL/TLS: available")); } else { if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_tls)){ MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("SSL/TLS: disabled")); @@ -1836,6 +1840,10 @@ static void webu_start_ctrl(struct context **cnt){ free(mhdst.mhd_ops); if (cnt[0]->webcontrol_daemon == NULL){ MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Unable to start MHD")); + } else { + MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO + ,_("Started webcontrol on port %d") + ,cnt[0]->conf.webcontrol_port); } } @@ -1845,6 +1853,32 @@ static void webu_start_ctrl(struct context **cnt){ return; } +static void webu_strm_ntc(struct context **cnt, int indxthrd){ + int indx; + + if (indxthrd == 0 ){ + if (cnt[1] != NULL) { + indx = 1; + while (cnt[indx] != NULL){ + MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO + ,_("Started camera %d stream on port/camera_id %d/%d") + ,cnt[indx]->camera_id + ,cnt[indxthrd]->conf.stream_port + ,cnt[indx]->camera_id); + indx++; + } + } else { + MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO + ,_("Started camera %d stream on port %d") + ,cnt[indxthrd]->camera_id,cnt[indxthrd]->conf.stream_port); + } + } else { + MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO + ,_("Started camera %d stream on port %d") + ,cnt[indxthrd]->camera_id,cnt[indxthrd]->conf.stream_port); + } +} + static void webu_start_strm(struct context **cnt){ /* This function starts up the daemon for the streams. It loops through * all of the camera context's provided and starts streams as requested. If @@ -1905,6 +1939,8 @@ static void webu_start_strm(struct context **cnt){ MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Unable to start stream for camera %d") ,cnt[mhdst.indxthrd]->camera_id); + } else { + webu_strm_ntc(cnt,mhdst.indxthrd); } } mhdst.indxthrd++; diff --git a/webu_stream.c b/webu_stream.c index e2adf25ca..21e9af4e7 100644 --- a/webu_stream.c +++ b/webu_stream.c @@ -275,9 +275,9 @@ int webu_stream_mjpeg(struct webui_ctx *webui) { return MHD_NO; } - if (webui->cnt->conf.webcontrol_cors_header != NULL){ + if (webui->cnt->conf.stream_cors_header != NULL){ MHD_add_response_header (response, MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN - , webui->cnt->conf.webcontrol_cors_header); + , webui->cnt->conf.stream_cors_header); } MHD_add_response_header (response, MHD_HTTP_HEADER_CONTENT_TYPE From b7f8b2dcdd96921ad82b6c3de181ee97abcd7884 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Sun, 9 Dec 2018 10:15:16 -0700 Subject: [PATCH 16/16] Version 4.2.1 --- CHANGELOG | 17 +++++++++++++++++ version.sh | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1045a89d5..18c590e1e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,20 @@ +Summary of changes for version 4.2.1 are below + * Update version number to 4.2.1 / Changelog + * Report to log options included in build + * Add log messages on database actions(tosiara) + * Revise log messages of port used for stream + * Revise log messages when using v4l2 via netcam + * Fix null terminator on EXIF of jpgs(tosiara) + * Fix build with static libs for webp(Fabrice) + * Guide update for initial setup. + * Prevent webcontrol update of movie_passthrough + * Remove confusing log message + * Fix motion detection when using privacy mask + * Correct thread locking for movie_passthrough + * Revise guide for better mobile viewing + * Revise additional stream timing + * Fix stream timing(adameat) + * Remove obsolete function reference * Change version number to 4.2+git Summary of Changes for version 4.2 are below * html fixes for legacy interface diff --git a/version.sh b/version.sh index c6b1aa188..6a4b855c3 100755 --- a/version.sh +++ b/version.sh @@ -1,5 +1,5 @@ #!/bin/sh -BASE_VERSION="4.2" +BASE_VERSION="4.2.1" if [ -d .git ]; then if test "`git diff --name-only`" = "" ; then GIT_COMMIT="git" @@ -13,5 +13,5 @@ if [ -d .git ]; then else GIT_COMMIT="gitUNKNOWN" fi -#printf "$BASE_VERSION" -printf "$BASE_VERSION+$GIT_COMMIT" +printf "$BASE_VERSION" +#printf "$BASE_VERSION+$GIT_COMMIT"