Commit Graph

119 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
tosiara
3955c75c85 Added SQL logging
Closes #858
2018-11-30 18:26:47 -07:00
Mr-DaveDev
f7f0fb9ab1 Eliminate Log Message 2018-11-20 18:19:44 -07:00
Mr-DaveDev
ecfb537359 Remove legacy substream 2018-10-11 18:13:46 -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
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
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
tosiara
a47e929049 Add O_CLOEXEC flag to the open of V4L2, socket and extpipe
* Add O_CLOEXEC flag to the open of V4L2, socket and extpipe
Fixes https://github.com/Motion-Project/motion/issues/705

* Add CLOEXEC
2018-06-09 14:16:19 -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
sander1234567890
a0816e72f0 Event timestamp and SQL improvements (#668)
Use the same timestamp for FILECREATE and FILECLOSE events

Propagate timestamp to the FILECREATE and FILECLOSE events, so the
timestamp available for the "Conversion Specifiers" for SQL queries
matches the timestamp used in filenames.

Move FILE_CREATE event call from picture.c:put_picture() to its calling functions in event.c.

Add new option to execute a SQL query on the FILECLOSE event

Don't try to execute empty sqlquery strings

Always clear result with PQclear

Improve Postgresql error handling

Don't regard PGRES_TUPLES_OK status as error.

Print Postgresql error status and error message on error.
2018-03-25 15:01:57 -06: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
631200a928 Pass Through
Implement pass through using concept from @iskunk fork.  

Closes #124
2017-12-30 07:54:55 -07:00
Mr-DaveDev
64c159e020 Fix filename for debug movies (#562) 2017-12-07 17:25:22 -07: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
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
tosiara
7d8ba03cfc Motion substream (#454)
Add option to output a sub-stream from Motion
2017-10-15 10:29:43 -06:00
tosiara
544ae4489c Made the fix permanent as it is valid 2017-08-18 14:10:55 +00:00
tosiara
434359bae8 Whitespace fix 2017-08-08 17:43:34 +03:00
tosiara
bc2f9644e6 Temporary solution for file names that contain "/" and non existing subdirs
See https://github.com/Motion-Project/motion/issues/360#issuecomment-320937660
2017-08-08 15:33:20 +03:00
Joo Aun Saw
d11c9006ec fix close all fds off by one error 2017-08-01 13:12:49 +10:00
tosiara
e9e0a2d292 Extpipe path write access check refactor (#417)
* Change how the path access is verified. Instead of creating a dummy file use access() function

* Extpipe path check improvement

* Minor extpipe event path check code optimization
2017-07-30 18:43:29 -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
MrDave
1c481df116 Additional PTS Changes
1.  Revise the PTS to allow for the capture of the first image by revising the initialization of last_pts
2.  Elminate the incrementing by 1 when we have timing issues since this puts all subsequent
    frames out of sync with timing/pts problems
3.  Unref the packets when encode and PTS functions return errors to prevent leaks.
4.  Revise logging to report more values when in test mode.
2017-07-29 21:09:02 -06:00
Joo Aun Saw
1aec859b62 Fix movie gap elimination setting incorrect PTS
We eliminate gaps in movie by resetting movie start time. By doing so,
we unintentionally reset the PTS value that has to be monotonically
increasing. This fixes it by offsetting the PTS value by a base PTS
value.

Signed-off-by: Joo Aun Saw <jasaw81@gmail.com>
2017-07-26 10:45:27 +10:00
MrDave
1c7996bdd4 SQL Event ID
Additional revisions for the change related to the sql event id
including variable names to conform with norm as well as documentation
updates.
2017-03-04 20:36:27 -07:00
Mike Wilson
1cd4cccb96 SQL Event ID 2017-03-04 16:33:48 -07:00
Mr-DaveDev
b5c3a73cc6 ffmpeg 3.1 Revisions (#324)
* ffmpeg 3.1 Revisions

The ffmpeg versions after 3.1 eliminated the stream codec which was used
in many different ways in the previous code.  This commit revises the ffmpeg
module to use smaller functions and eliminates the greyscale image handling
since all images are yuv.

* ffmpeg gop and pts

Gop:  Revise the gop based upon the fps of the requested video
to make sure we get enough I frames for low fps videos.
PTS:  Revise the PTS for the timelapse videos as well as permit
debug messages of the PTS when in test mode.

* Libav Problem
 
Closes #144
2017-03-04 11:23:13 -07:00
tosiara
81ea81aa6a Bugfix: wrong variable logged when extpipe is already closed
This caused memory access violation and process crash
Fixes https://github.com/Motion-Project/motion/issues/329
2017-02-26 17:03:54 +02:00
MrDave
1a41fe8ab7 v4l2 Revisions
This commit includes:
1.  Consolidate functions into appropriate modules
2.  Rename modules to reflect contents (v4l2, bktr, common)
3.  Combines v4l2 and bktr so they can be used together
4.  Implements functional prefixes
5.  Uses HAVE_V4L2, HAVE_BKTR instead of WITHOUT_
6.  Include pthread_np.h for FreeBSD
2017-02-12 16:20:27 -07:00
Radek Hvizdos
31364dc841 Add initial webp image compression support.
Only basic webp compression is supported (the only tunable is 0-100%
compression adjustment), without EXIF metadata.
Motion build scripts are configured to build in the support by default
and will emit an error if the needed library is missing. Suport can be
manualy disabled at configuration stage adding --without-libwebp.

Documentation update will follow in a separate commit.

Tested on x86-64 Linux only.
2017-01-26 19:06:11 +01:00
genius3000
2d262e5f49 Added on_camera_found event: for when a lost camera is found. 2017-01-08 19:47:12 -07:00
MrDave
74b4223f6e v4l update
This update removes the components for v4l and implements only
the v4l2 and BSD option.  This commit also consolidates some
of the pre-processor directives and only uses the WITHOUT_V4L2
instead of the multiple.  The checks for the HAVE_LINUX_VIDEODEV2_H
were removed from the code because the WITHOUT_V4L2 is actually
set based upon the existance of the HAVE_LINUX_VIDEODEV2_H.
Finally, this renames some files to be more consistent.
2016-12-15 21:44:41 -07:00
MrDave
a838d0527e Movie pts fix when using pre-capture
The previous method for calculating the PTS was to extract the time when
the particular function was being executed.  e.g. The time when the open
ffmpeg function was executed, the time that the image was encoded into the
movie.  This commit revises that behaviour to use instead the timevalues
that are attached to each image.  This is done to handle the precapture
situation in which all the precapture images were sent in at once at the
start of the event.  For the open function, the timevalue is obtained
from the oldest image in the ring buffer.
2016-12-10 17:26:31 -07:00
MrDave
0fe81b6bdc Revise time on images
This commit revises the time variable that is attached to the images
this revises from the tm structure to a timevalue structure so that we
can get to a precision level of greater than one second.
2016-12-10 14:48:35 -07:00
MrDave
1b33f958f2 HAVE_FFMPEG consolidation
1.  Consolidate the HAVE_FFMPEG pre-processor directives that are scattered
through the code into the ffmpeg.c module.  This makes it so that a single
pre-processor check can be used rather than surrounding every call scattered
through the code.

2.  Always compile/include the ffmpeg.c module
2016-11-24 20:59:17 -07:00
Sebastiaan Lokhorst
8ba53b683b Remove SDL support 2016-11-13 20:28:15 +01:00
Joseph Heenan
0f881050e9 Mac OS: Replace BSD with FreeBSD
BSD is currently used to trigger the use of the FreeBSD video interface,
which doesn't exist in MacOS. Change the BSD define to be FreeBSD
specific.
2016-10-23 12:34:26 +01:00
Ximin Luo
8ea65f7a1f Fix spelling/grammar mistakes 2016-09-28 16:40:10 +02:00
Mr-Dave
793080eb6d Merge pull request #152 from Mr-DaveDev/ffmpeg-fixes
Timelapse fps and regression fixes
2016-09-04 07:59:48 -06:00
MrDave
e4b5627a70 Revert to standard os file buffering 2016-09-03 11:44:36 -06:00
MrDave
e953b5d14b Timelapse fps and regression fixes 2016-09-03 08:48:38 -06:00
MrDave
5697db1195 Change old containers to defaults 2016-09-01 21:08:15 -06:00
MrDave
22b2461cb2 Better implementation of the test codec 2016-09-01 20:35:44 -06:00
MrDave
145374680f PTS refinements, add test and remove ogg options 2016-08-31 18:25:35 -06:00
MrDave
9e4245a3df PTS fixes 2016-08-27 21:08:51 -06:00
MrDave
fbba7b8f7d Timelapse revision of swf to mpg 2016-08-25 19:29:09 -06:00
MrDave
e10985581b FPS Fix. Issue 132 2016-08-20 19:13:48 -06:00
Joseph Heenan
ad5013bbba Fix stack corruption in event_ffmpeg_timelapse
The current definitions (char codec_swf[3] = "swf" etc) are declared
one character too short resulting in stack corruption or crashes in
some cases.

To avoid the possibility of an error at all, we change ffmpeg_open to
take a const char * as it doesn't need to alter the string.

Closes https://github.com/Mr-Dave/motion/issues/109
2016-08-09 07:38:24 +01:00