Commit Graph

274 Commits

Author SHA1 Message Date
Mr-DaveDev
cf1582967c Webcontrol Actions (#900)
* Update Webcontrol Actions and Resolve Compiler Warnings
2019-02-03 10:16:59 -07:00
Mr-DaveDev
b550370585 Save preview on emulate
Closes #876
2019-01-19 20:36:22 -07:00
Mr-DaveDev
5508eb0c5a Initialize for track type 4
Closes #877
2019-01-19 20:35:10 -07:00
Mr-DaveDev
3c249fbcfa Logging messages
Closes #861
2018-12-02 12:06:26 -07:00
Mr-DaveDev
37c088a933 Prevent movie_passthrough updates via webcontrol
Closes #836
2018-11-20 18:20:36 -07:00
Mr-DaveDev
ccea9a3690 Remove privacy mask areas from motion detection 2018-11-20 18:19:03 -07:00
Mr-DaveDev
0353dca523 Add threshold_maximum 2018-10-11 18:15:55 -06:00
Mr-DaveDev
ecfb537359 Remove legacy substream 2018-10-11 18:13:46 -06:00
Mr-DaveDev
5c95ed8fe2 Add eventstart and eventend for webcontrol
1.  Add eventstart/eventend as options for webcontrol api.
2.  Revise action names on webcontrol html.
3.  Revise variable name in code from makemovie to event_stop.
4.  Revise some code indentation for code-folding in IDE

Closes #796
2018-09-08 19:28:02 -06:00
Mr-DaveDev
b02691bc63 Eliminate message on failed retry
Closes #779
2018-09-08 15:10:23 -06:00
Mr-DaveDev
219a36e568 Generic Tracking
1.  Maintain a aggregate count of moves
2.  Send aggregate counts as negative when invoking center.

closes #690
2018-08-24 19:40:49 -06:00
Mr-DaveDev
cfde202388 Database Functions
1.  Resolve Sqlite3 equal NULL after watchdog
2.  Consolidate database routines in motion.c into dbse_ functions.

closes #521
2018-08-24 19:39:26 -06:00
Mr-DaveDev
029fc161cd Additional Stream Options
1.  Add separate stream for motion images.
2.  Add separate stream for source images from camera.
3.  Add additional preview option(3) for showing live stream next to motion stream.
4.  Add additional preview option(4) for showing source images from camera.
5.  Refactor webu_stream to improve efficiency
6.  Improved shutdown process for webu_streams.
7.  Revised variable name in webu_html to correlate with what it contains.(camid instead of thrd)
2018-08-22 18:24:56 -06:00
Mr-DaveDev
90763ba943 Add static file processing via netcam_url
1.  Add static movie processing via netcam_url
2.  Remove file netcam_url which only processed single image
3.  Remove experimental protocol of mjpg
2018-08-19 20:03:17 -06:00
Mr-DaveDev
5d863a19dc Revisions to configuration options
Revisions to configuration options.

1.  Revise config options to be `movie_` and `picture_`
2.  Revise config options to align with topic and code.
    *  motion_video_pipe, ipv6_enabled, rtsp_uses_tcp
    *  switchfilter, logfile, process_id_file
3.  Revise depreciated options to still be valid for webcontrol and config files.
4.  Revise distributed config files to only include most common options
5.  Revise sequence of config options to be arranged by topic.
6.  Revise code to use names consistent with config parms.
7.  Revise manual, guide and code to specify same default values.
8.  Update guide and manual to reflect revised option names.
2018-08-17 21:00:45 -06:00
Mr-DaveDev
0572a64ba9 Edits on configuration dimensions 2018-08-05 19:26:31 -06:00
Mr-DaveDev
3cd68cab49 Implement libmicrohttpd
Implement micro-httpd for providing webcontrol and streams

1.  Add tls support for webcontrol and streams.  aka ssl/tls, https
2.  Add functionality to provide streams on single port
3.  Add functionality for additional authentication methods of webcontrol.
4.  Add functionality for providing static images
5.  Update documentation for new functionality.
6.  Resolve issue with stream_preview_newline
7.  Add functionality for specifying camera in webcontrol and streams via camera_id
8.  Depreciated functionality to specify substream via port 
9.  Add functionality to specify substream via a URL
10.  Revise `quit` to only be available via text (programmatic) interface
11.  Added functionality for CORS header on webcontrol interface

Closes #526 
Closes #661 
Closes #709 
Closes #737 
Closes #750
2018-08-01 20:20:15 -06:00
Mr-DaveDev
c1db494aaf Revisions to main
* Decompose the `main` function into calls to smaller functions
2018-06-11 19:01:26 -06:00
genius3000
182c8a34d5 Fix memory leak from read_camera_dir() (#694)
In commit da556d7 (store the value of 'camera_dir'), a memory leak
was introduced due to not freeing this memory in context_destroy().
I followed the advice in PR #639 to correct this.
Valgrind was used to find this leak and test for successful fixing.
Config included a 'camera_dir' with two camera config files.
Command ran: valgrind --leak-check=full ./bin/motion -n

Before:
HEAP SUMMARY:
    in use at exit: 91,538 bytes in 13 blocks
  total heap usage: 4,227 allocs, 4,214 frees, 20,448,321 bytes allocated

126 bytes in 3 blocks are definitely lost in loss record 8 of 11
   at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x406A6D: mymalloc (motion.c:3401)
   by 0x40D0CF: mystrdup (conf.c:2687)
   by 0x40D30C: mystrcpy (conf.c:2664)
   by 0x40D30C: copy_string (conf.c:2470)
   by 0x40D565: read_camera_dir (conf.c:2883)
   by 0x40CA10: conf_process (conf.c:2034)
   by 0x40D850: conf_load (conf.c:2236)
   by 0x407063: cntlist_create (motion.c:2876)
   by 0x407063: motion_startup (motion.c:2930)
   by 0x4052B7: main (motion.c:3128)

LEAK SUMMARY:
   definitely lost: 126 bytes in 3 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 91,412 bytes in 10 blocks
        suppressed: 0 bytes in 0 blocks

After:
HEAP SUMMARY:
    in use at exit: 91,412 bytes in 10 blocks
  total heap usage: 4,201 allocs, 4,191 frees, 20,447,579 bytes allocated

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 91,412 bytes in 10 blocks
        suppressed: 0 bytes in 0 blocks
2018-04-05 20:32:56 -06:00
genius3000
d5c18031c2 Enhance 'lightswitch' with a config option of ignored frames (#689)
* Rename 'lightswitch' to 'lightswitch_percent' and properly deprecate the old option

* Add 'lightswitch_frames' for how many frames to ignore  Defaulting to the original '5' and set a hard range of '1-1000'

* Updated config guide and supplied example config

Also updated the 'lightswitch_percent' comments in the config to match those in conf.c

Closes #686
2018-04-03 18:24:08 -06:00
Mr-DaveDev
f3d5dc8985 Initiate translations (#682) 2018-03-25 17:12:01 -06:00
Mr-DaveDev
4ff191be82 Implement Translations via Gettext
Implement translations of Motion log messages and web control using the gettext function.
2018-03-25 16:39:57 -06:00
Mr-DaveDev
d73418102c Move function preview_save into event module (#681) 2018-03-25 15:24:49 -06:00
Mr-DaveDev
1e86c7a109 Watchdog and RTSP time
1.    Revert to just capturing time directly rather than in a routine.
2.    Check for null format context pointer before writing trailer.
3.    Terminate movie when lost connection.
4.    Clean up context when failed resize.
5.    Unlock mutex on failed first image.
6.    Fix memory leak when recovering from watchdog timeout.
2018-03-13 19:53:38 -06:00
Mr-DaveDev
9b6297387b Replace webhttpd (#658)
Replace the webhttpd module with new webu and translation modules
2018-03-01 18:07:06 -07:00
Mr-DaveDev
7dad4b1e25 Remove redundant checks for image type 2018-02-25 13:12:18 -07:00
Mr-DaveDev
93e2718341 Saving highres image when using 'best' configuration option. 2018-02-23 10:25:05 -07:00
Mr-DaveDev
b856ac66ac Validate text_scale parameter
* Validate text_scale
2018-02-21 17:32:27 -07:00
jackxbritton
11e6339f44 Cross origin resource sharing (CORS) config parameter
* Add configuration parameter for a cross origin resource sharing on the Motion stream
2018-02-11 11:30:24 -07:00
jackxbritton
113ff690b5 Add text_scale config parameter. (#640)
Replace configuration parameter of `text_double` with `text_scale`

Closes #395
2018-02-10 17:40:27 -07:00
Mr-DaveDev
82c84fbb27 RTSP High resolution
Resolve segfault during startup when using the netcam_highres options
2018-02-02 18:21:03 -07:00
Mr-DaveDev
46b5f88140 Add vid_control_params and refactor video_v4l2.c
1.  Revise v4l2 for new control option of vid_control_params
2.  Refactor most of the video_v4l2.c code
3.  Revisions required for video_bktr.c
4.  Revise sequence for configuration parms on webui to ensure similar parameters are together.

Closes #363 
Closes #551 
Closes #552 
Closes #582 
Closes #608 
Closes #613
2018-01-31 18:50:08 -07:00
tosiara
4be1638499 Revise %{host} option and add %{ver}
Set the hostname when loading the configuration options and add a new conversion specifier for Motion version number.
2018-01-11 20:47:13 -07:00
Mr-DaveDev
4d3e8b06cf Capture first images for non-v4l2 devices
Closes #541
2018-01-01 13:07:42 -07:00
Mr-DaveDev
3c7cbd6850 Initialize the thread at start of main
Closes #589
2018-01-01 13:07:08 -07:00
Mr-DaveDev
631200a928 Pass Through
Implement pass through using concept from @iskunk fork.  

Closes #124
2017-12-30 07:54:55 -07:00
Mr-DaveDev
eef702b3d7 Fix builds on musl based systems
* Fix pthread_setname_np detection

Commit 6617c6f2c8 replaced
AC_LINK_IFELSE with AC_COMPILE_IFELSE. This has broken the
pthread_setname_np detection as compilation will always succeed even if
pthread_setname_np is not available (if the function is not found, a
simple warning will be displayed in config.log).

The correct fix is to put back AC_LINK_IFELSE with -pthread in LIBS
otherwise compilation will fail on toolchain without pthread_setname_np.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

* Check for pthread_getname_np

On some toolchains (like musl), pthread_setname_np is available but not
pthread_getname_np so add this check in configure.ac

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

* Revision for detection of XSI vs GNU variants of strerror
2017-12-09 15:42:16 -07:00
Mr-DaveDev
336734e44e Compiler Warnings (#535)
* 17.10 Compiler Revisions
* Config Changes
2017-11-06 18:55:39 -07:00
Mr-DaveDev
fbb3c2e022 Limit parameters available on webcontrol (#530)
Implement a new configuration option which allows users to specify the
type of parameters which can be accessed via the webcontrol page.  The
new option permits levels 0(none) to 3(restricted) with a default of
none.  This option is to enhance the security associated with the
application for users that may expose the webcontrol port publicly.

Close #515
2017-11-01 18:13:05 -06:00
Mr-DaveDev
ec9a5f993d Separate Timelapse Options (#528)
* Timelapse Options

1.  Revise the configuration options to have some of the timelapse options use distinct configuration values.

Closes #43

* Whitespace
2017-10-29 16:04:07 -06:00
MrDave
3f75f380c1 Add RTMP format specifier
1.  Add RTMP as a valid network camera protocol

Closes #401
2017-10-28 19:32:24 -06:00
MrDave
2e95ed01c7 Configuration Parameters to log
Revise the dump of configuration parameters to automatically send them to the
log at the INF level for use in issue reporting.

Closes #509
2017-10-28 19:16:10 -06:00
MrDave
d00220b5c4 Validate v4l2 parameters in netcam
Add functionality to validate that the palette parameters passed into
v4l2 via netcam are appropriate.

Closes #494
Closes #493
Closes #456
2017-10-28 19:04:13 -06:00
Mr-DaveDev
69ad4fb350 High Resolution (#522)
* High Resolution

Refactor the netcam_rtsp module and associated image variables to allow for processing a dual stream from rtsp cameras.

Continue the process of segregating the functionality of the netcams into distinct modules based upon their function.
2017-10-28 17:29:16 -06:00
genius3000
c03a4f98cb Add a runtime argument to dump config options (#513)
* Add a runtime argument to dump config options

In order to simplify support requests, we can now dump all enabled
config options to the log(file), with argument 'o' for 'options'.
Any likely sensitive information will be redacted.

* Documentation update for dump config argument
2017-10-15 10:30:46 -06:00
tosiara
7d8ba03cfc Motion substream (#454)
Add option to output a sub-stream from Motion
2017-10-15 10:29:43 -06:00
Mr-DaveDev
eeecf611f7 Resolve Developer Warnings (#497)
1.  Revise the developer warnings to treat all warnings as errors
2.  Revise a few of the comparisons of signed to unsigned.
3.  Isolate the setjmp to separate function since it is warning on 14.04
4.  Remove redundant clang OSX test since gcc is really clang according to travis logs
2017-09-08 18:18:20 -06:00
MrDave
29a88f31e9 Reset stream port when unable to open 2017-08-28 19:11:56 -06:00
tosiara
910412f175 Changed MOTION_LOG macro (#428)
* Changed MOTION_LOG macro and remover "%s:" from the format string
Function name will be now auto added

* Re-applied log-update after conflict resolution

* Some old style logging still remaining, updated
2017-07-30 17:07:40 -06:00
Joo Aun Saw
b8a2a2db16 Change last_pts back to packet timebase 2017-07-27 17:02:12 +10:00