Commit Graph

991 Commits

Author SHA1 Message Date
Fabrice Fontaine
ea598bf07c Fix cross-compilation
Currently if "x${DISTRO}" isn't set to "Linux", unsafe header/library
path for cross-compilation such as '-I/usr/local/include' are used.
As a result, motion can't be cross-compiled, so change "x${DISTRO}" to
"${DISTRO}" as it seems that this was the intended use.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2017-05-03 21:55:30 +02:00
Joseph Heenan
936b114e5a Merge pull request #377 from iskunk/rtsp-fixes-2
Various fixes to Motion's interaction with FFmpeg vis-a-vis RTSP
2017-05-02 02:02:55 +01:00
Daniel Richard G
3c0a22ad1e Various fixes to Motion's interaction with FFmpeg vis-a-vis RTSP
* Added <assert.h> to motion.h, so we can do assertions

* Changed the return-code semantics of rtsp_decode_video() and
  rtsp_decode_packet() to a tristate: negative on error, zero if no
  output is currently available, positive if output was successfully
  obtained

* Assert that avcodec_send_packet() never returns AVERROR(EAGAIN)
  (i.e. we never overfill the codec with packets)

* Treat AVERROR(EAGAIN) from avcodec_receive_frame() as a no-output,
  non-error condition (it means we need to send more packets before we
  can get a frame)

* Changed netcam_read_rtsp_image() to handle the case where the codec
  has a frame ready for output without needing any new packets

* Simplified the logic in the netcam_read_rtsp_image() packet-read loop

* Improved wording of some log messages

* Removed needless variable initializations
2017-04-23 16:31:31 -04:00
Joseph Heenan
4241d21b7b Merge pull request #376 from olivierschonken/master
Fix CMake building of MMAL driver for RaspberryPi
2017-04-23 20:59:39 +01:00
Joseph Heenan
50fcec0eef Merge pull request #368 from iskunk/rtsp-fixes
Various fixes for RTSP crashes and/or Valgrind errors
2017-04-23 20:52:15 +01:00
Olivier Schonken
8886118518 Fix CMake building of MMAL driver for RaspberryPi
Added libraries, include directories and extra source files to
enable a succesfull cross-compile with CMake.

Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
2017-04-23 20:58:21 +02:00
Joseph Heenan
d4a35c6fa5 Merge pull request #367 from genius3000/master+conf_guide_fixes
Two small config and guide fixes
2017-04-19 21:09:46 +01:00
Joseph Heenan
96d7023c29 Merge pull request #369 from iskunk/logging-fixes
Logging fixes
2017-04-19 20:57:11 +01:00
Joseph Heenan
d8a2b03090 Merge pull request #370 from isage/osx-build-fix
Fix cmake build on osx
2017-04-19 20:36:00 +01:00
Epifanov Ivan
e2304449b8 Fix cmake build
Add libavdevice dependency, in consistency with autotools
This fixes #342
2017-04-11 22:54:24 +03:00
Daniel Richard G
84671006ff Minor logging fixes (whitespace, timestamp format) 2017-04-10 17:23:49 -04:00
Daniel Richard G
3b75bec4fa Don't put RTSP URL passwords into the log
When logging, use cnt->conf.netcam_url instead of rtsp->path, as the
latter may contain a security-sensitive "user:password@" string. We add
a new rtsp->netcam_url field that is a read-only pointer to the former.

Also, don't try to LOG("%s", NULL).
2017-04-10 17:12:02 -04:00
Daniel Richard G
0374f7458d Various fixes for RTSP crashes and/or Valgrind errors
* Use a dedicated "active" flag to tell if a netcam->rtsp context is
  connected and running, rather than checking
  (netcam->rtsp->format_context != NULL), because the latter may be true
  without a working connection

* netcam_open_codec() and netcam_rtsp_open_context() should not return 0
  if something is wrong

* Pass a netcam context into netcam_interrupt_rtsp() instead of
  netcam->rtsp so that the callback can check netcam->finish and react
  appropriately to the shutdown signal
2017-04-10 17:02:15 -04:00
Daniel Richard G
1b6022f595 Various logging-system fixes
* Use openlog() and closelog() so that we don't leak a file descriptor
  (hello Valgrind) when the program exits in syslog mode

* Update comments to reflect actual log text being generated

* Moved va_end() closer to its corresponding va_start()

* Define new LOGMODE_NONE mode so that we can close out logging
  completely at program end
2017-04-10 17:01:36 -04:00
genius3000
4ec8e557a2 Update the ffmpeg_variable_bitrate comment in config_params for the webui config writing 2017-04-07 21:01:47 -06:00
genius3000
54c52f4416 Replace missed netcam_http with netcam_keepalive 2017-04-07 20:55:01 -06:00
Joseph Heenan
8a1b9a982e Merge pull request #359 from Mr-DaveDev/hyper
SQL Event ID
2017-03-19 09:57:34 +00:00
Mr-Dave
4a1aa6e950 Merge pull request #343 from pascal-fb-martin/master
Improved privacy mask performances
closes #340
2017-03-12 14:05:04 -06:00
Joseph Heenan
caf9c5230a Merge pull request #352 from Mr-DaveDev/misc
ffmpeg 3.1 / v4l2 via Netcam
2017-03-12 18:33:45 +00:00
MrDave
fb2b34112d Guide update 2017-03-12 12:25:31 -06:00
MrDave
845b39b914 ffmpeg 3.1 fix, v4l2 via netcam
Resolve crash when decode returned invalid results
Catch interupts on opening netcam
Eliminate option to use h264 with videodevice
Revise configure for pthread
Revise config file to point to guide
2017-03-11 11:39:16 -07:00
MrDave
d121a93019 v4l2 Netcam
This commit resolves some of the netcam v4l2 items and a few other
small issues

1.  Use the correct return codes for the new function rtsp_decode_video
2.  Silence the notices on reconnecting
3.  Revise the v4l2 to video4linux2 for old libav versions
4.  Add additional options for the input_format
5.  Do not permit users to specify zero for camera height or width
6.  Eliminates pthread detection
7.  Revise the ffmpeg messages to INF
8.  Adds H264 palette option
2017-03-09 21:47:13 -07:00
tosiara
be20533355 Bugfix: wrong width and height order in v4l2 netcam av_dict_set 2017-03-08 11:57:21 +02:00
Pascal Martin
b6c1d94845 Forgot the case when no privacy mask is defined 2017-03-06 22:15:14 -08:00
Pascal Martin
34cceefd43 Improved privacy mask performances 2017-03-06 21:51:38 -08:00
Mr-Dave
eb137c5f5d Merge pull request #337 from Mr-DaveDev/netcam-v4l2
V4l2 via netcam
2017-03-05 11:08:48 -07:00
MrDave
ce64cf9601 ffmpeg buffered packet 2017-03-05 10:22:21 -07: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
MrDave
6ae6fd763d Add libavdevice to travis.yml 2017-03-04 12:54:27 -07:00
MrDave
58baeb4d65 V4l2 via netcam
This commit adds functionality to use a v4l2 device via the netcam_url
option.  This will allow for more v4l2 devices since the netcam_url
uses the ffmpeg libraries which should be able to to decode and transform
the unusual pixel formats and sizes.
2017-03-04 12:37:04 -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
Mr-Dave
042fd16d6c Merge pull request #335 from Mr-DaveDev/MacThread
FreeBSD instead of BSD for pthread_np.h
2017-03-04 10:25:45 -07:00
tosiara
54f416e685 Merge pull request #334 from Mr-DaveDev/camera_type
Camera Type
2017-03-04 09:20:21 +02:00
MrDave
4cecdd5f03 FreeBSD instead of BSD for pthread_np.h 2017-03-02 20:07:59 -07:00
MrDave
669e531881 Camera Type
Loosen the names permitted for videodevice
2017-03-02 18:44:36 -07:00
Joseph Heenan
ede7a0bccf Merge pull request #330 from tosiara/extpipe-crash-fix
Bugfix: wrong variable logged when extpipe is already closed
2017-02-26 15:29:15 +00: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
Mr-Dave
b33c672e84 Merge pull request #322 from Mr-DaveDev/autotools
Autotool Rewrite
Closes #234
2017-02-18 09:55:38 -07:00
MrDave
329eade94a Autotool Rewrite
Update the autotools to use packaged applications/locations and
remove the obsolete options.
2017-02-12 22:08:08 -07:00
Mr-Dave
efb4c877be Merge pull request #321 from Mr-DaveDev/whitespace
Whitespace and Tab cleanup
2017-02-12 21:29:21 -07:00
MrDave
f196a2c5af Whitespace and Tab cleanup
Remove trailing whitespace and convert tabs to four spaces.
No code changes.
2017-02-12 18:25:43 -07:00
Mr-Dave
bde92a4186 Merge pull request #320 from Mr-DaveDev/v4l2-base
v4l2 Revisions
Closes #290 
Closes #272
2017-02-12 16:30:48 -07: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
Mr-Dave
ce93905d6a Merge pull request #319 from Mr-DaveDev/webp
Webp Default to Off
2017-02-12 15:30:45 -07:00
MrDave
b5e71f7ac3 Webp Default to Off
The webp image format option is not available on older distributions
This commit revises the default for the webp to OFF.  Once the older
distributions reach EOL, the default can be changed back to ON.
2017-02-12 15:17:42 -07:00
Mr-Dave
9276f04bb0 Merge pull request #311 from jayslovak/master
Add webp image compression support.  Closes #310  Thanks @jayslovak.
2017-02-09 18:47:24 -07:00
Radek Hvizdos
c19ee468e8 Change webp->jpeg fallback message log level to ERR 2017-02-09 13:07:11 +01:00
Radek Hvizdos
670fcef4e2 Replace further references to libwebp with webp and move from CFLAGS to AC_DEFINE 2017-02-09 12:56:20 +01:00
Radek Hvizdos
6163d76384 Fallback to jpeg if webp was selected in the config file, but the support for it was not compiled in 2017-02-09 12:43:20 +01:00