Commit Graph

48 Commits

Author SHA1 Message Date
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
631200a928 Pass Through
Implement pass through using concept from @iskunk fork.  

Closes #124
2017-12-30 07:54:55 -07: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
Joo Aun Saw
b8a2a2db16 Change last_pts back to packet timebase 2017-07-27 17:02:12 +10: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
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
MrDave
28f1abf75b Regression without ffmpeg fix
This commit resolves a regression error when selecting the without-ffmpeg option.

1.  The ffmpeg configuration options are now valid whether or not the user has
    included ffmpeg.  Instead the user is notified when ffmpeg options are
    requested.

2.  The initial consolidation of the HAVE_FFMPEG duplicated the public functions
    in the #else (no ffmpeg) section.  This commit changes this so that the #IF
    are inside of the public functions so we don't have to worry about keeping
    the parameters the same between them.

3.  The timevalue was added to the ffmpeg header for the situation when
    ffmpeg is not included.
2016-12-26 11:32:03 -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
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
Joseph Heenan
8372f591e1 Cleanup avformat_network_init/deinit calls
avformat_network_init only needs to be called once on startup and once
on shutdown.

The functions aren't thread safe, and we can't fix that by protecting
them with the 'global_lock' as other functions in ffmpeg that we call
and that access the same data are not protected by the global_lock
(and can't be protected by that lock).

Fixes #194 - the particular issue we're seeing there is something like:

thread 1: lock mutex
thread 1: deinit network
thread 1: init network
thread 1: unlock mutex

thread 2: lock mutex
thread 2: deinit network

thread 1: call into an ffmpeg operation
thread 1: ffmpeg complains "init network" not called
2016-10-12 08:20:50 +01:00
MrDave
e2d3e14180 pts change for libav
The presentation time stamp(pts) indicates the time which the movie
player should display a particular frame.  In the previous changes
to the pts, we set the time basis to be in microseconds by specifying
the denomintor to be equal to 1000.  This allows for additional precision
when we assign the pts when writing the frame.  For the libav variant
the time basis assignment is ignored and instead the framerate is
used.  The use of the framerate causes problems when it is small.
At 2fps, time intervals of 1 to 499 microseconds round to a pts
of zero, 500 to 1499 microseconds round to pts 1, etc.  This
commit adds a variable to keep track of the last pts used in writing
the frame.  If the newly calculated pts is not greater than the previous
pts, we just increment the pts by 1 which would be the full 1/framerate
increment.  This could result visually twitchy videos at low framerates.
It could also have a compounding affect of eliminating the handling of
variable framerates and just fallback to a constant framerate video.
2016-10-09 14:23:58 -06:00
Sebastiaan Lokhorst
72eccf1b58 Fix FreeBSD build
Update FreeBSD instructions.
2016-09-29 20:00:37 +02:00
MrDave
b9f4ca8578 Revise the condition for the MYPixelFormat to use the AVFORMAT version number 2016-09-11 21:43:13 -06:00
Mr-Dave
d59ea1345b Merge pull request #157 from jogu/compile-warnings-fix
Make some internal functions "static"
2016-09-10 14:38:11 -06:00
Joseph Heenan
068a799d29 Fix build for libavutil prior to 51.42.0 2016-09-10 18:46:17 +01:00
Joseph Heenan
71a16f9213 Make some internal functions "static"
(and remove the places they were added to .h files)

I don't believe these functions were intended to be exposed outside
the .c file they're defined in, so make them internal functions.
2016-09-10 18:30:32 +01:00
MrDave
9e4245a3df PTS fixes 2016-08-27 21:08:51 -06:00
MrDave
4042a40081 Eliminate developer-flags warnings 2016-08-20 19:53:16 -06:00
MrDave
1ffcbe296c ffmpeg 3.0 fixes 2016-08-20 19:36:18 -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
Mr Dave
21994e4b40 PIX change for older ffmpeg 2015-09-21 10:30:40 -06:00
Mr Dave
392f826f81 Fix PIX format 2015-09-21 09:04:31 -06:00
Rex Feany
74fbda2bf0 compile against ffmpeg from github@58fe57d5a05ad8d15c320b2bd163debbc412bdd3
fix minor compilation issues
use pkg-config
2015-09-18 00:33:04 -07:00
Mr Dave
90a97c05eb Ffmpeg container fixes 2015-09-04 16:49:38 -06:00
Mr Dave
f3d36d4fce Fix compile without ffmpeg and older versions 2014-10-18 12:47:02 -07:00
Mr Dave
b6f73ffccb Timelapse fixes and bump version 2014-10-05 05:31:47 -07:00
Mr Dave
f880807aea Clean up ffmpeg.c and plug memory leak 2014-09-25 19:18:45 -07:00
Xubuntu 12.04
546727ba90 Implement init of AV libraries from bcl fork and clean up 2014-07-05 15:35:45 -07:00
tos
68cb3fee6d Restored 0644 permissions for some files
CHANGELOG INSTALL ffmpeg.c ffmpeg.h netcam.c netcam_rtsp.c
2014-06-24 21:38:28 +03:00
Dave
ca413db53c Added support for libav V53 2014-06-19 20:17:20 -06:00
AngelCarpintero
6d35a01104 Make cosmetic changes in comments, description of functions and fix some code to be compliant with CODE STANDARD 2010-03-29 19:24:57 +00:00
AngelCarpintero
623085d49c Apply new code standard ( chuck 1 ) 2008-07-16 20:15:27 +00:00
AngelCarpintero
9f743c80e2 More changes in option names from http://www.lavrsen.dk/twiki/bin/view/Motion/IntuitiveOptionNamesDiscussion 2008-06-15 16:32:13 +00:00
AngelCarpintero
99e9ebbed3 Patch watchdow according to http://www.lavrsen.dk/twiki/bin/view/Motion/WatchdogAndThreadPatch and thread-quit-ffmpeg-error-on-no-space-left.diff 2008-05-06 12:26:28 +00:00
AngelCarpintero
a109cdbe9f Define AVERROR for ffmpeg 0.4.8 & 0.4.9-pre1 and add a missing motion_log() 2008-01-18 03:23:33 +00:00
AngelCarpintero
1e5918bb28 Comment out includes, previously commented that breaks compilation 2008-01-16 12:28:44 +00:00
AngelCarpintero
f007525762 Fix problem to create new ffmpeg file for new versions of ffmpeg including errno.h to allow define propely AVERROR macro from avcodec.h 2008-01-15 02:30:26 +00:00
AngelCarpintero
b6c1a012df Fix logging level in track.c , added some more unsigned short int and comment some duplicated includes 2008-01-13 08:43:05 +00:00
KennethLavrsen
3c8476d692 Fix in ffmpeg_avcodec_log received by email from Alain Guidez
I have not tested it but Alain seems to know the ffmpeg code well
2007-03-25 07:54:02 +00:00
KennethLavrsen
fd1259175f Fixing more problems with ffmpeg logging (Peter Smith) 2006-06-01 01:23:15 +00:00
KennethLavrsen
952790e955 ffmpeg logging improvement (Peter Smith)
Logging now only happens in debug mode.
Fixed prototype definition of logging funtion
http://www.lavrsen.dk/twiki/bin/view/Motion/FfmpegAvicodecLogging
2006-05-31 23:03:08 +00:00
KennethLavrsen
9c9fd3e2fd Redoing the SVN74 with fixes.
Ffmpeg code mutex locking fix (Peter Smith)
http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2006x04x07x164654
Ffmpeg avicodec logging improved (Peter Smith and improved by Kenneth Lavrsen)
http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2006x04x07x164654
2006-05-22 23:57:01 +00:00
KennethLavrsen
6b5936cfdb Reverting SVN 74. There were severe error in the ffmpeg logging code. 2006-05-22 22:42:22 +00:00
KennethLavrsen
70806c12c2 Ffmpeg code mutex locking fix (Peter Smith)
http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2006x04x07x164654
Ffmpeg avicodec logging improved (Peter Smith)
http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2006x04x07x164654
2006-05-22 22:07:48 +00:00
AngelCarpintero
09c436b68a * fix many typos in comments ( i ran aspell against the code ).
http://www.lavrsen.dk/twiki/bin/view/Motion/FixTypoInComments
2006-01-21 03:14:32 +00:00
KennethLavrsen
f498fc18f8 Integrated the ffmpeg_interlace feature (Alexey Belyaev/Andrew Hamilton)
http://www.lavrsen.dk/twiki/bin/view/Motion/MotionffmpegDeinterlace

Enhanced the help text in motion.conf that heads the ffmpeg section
Renamed the option ffmpeg_filename to movie_filename to prepare for
future plugin architecture (Kenneth Lavrsen)
2005-12-29 23:32:52 +00:00
root
5221670f09 Initial import 2005-12-27 08:54:39 +00:00