Commit Graph

17 Commits

Author SHA1 Message Date
Maurice ONeal
c153fdcd21 v1.5.t10
Somewhere in the code is causing an infinite loop, root cause still
undermined. added more logging statements to help me find misbehavior.
imgDiff() will now handle empty frames on the parameters more
gracefully.

enforceMaxClips() will no longer assume all video clips are accompanied
by html and jpg files but will now instead "delete if exists."
2022-12-16 18:30:27 -05:00
Maurice ONeal
a5ee164b4e v1.5.t9
The app is hard crashing now but I was able to determine the cause this
time. Must functions in filesystem tend to abort if the filesystem
object doesn't exists. Added protection where needed to prevent crashing
2022-12-13 21:13:10 -05:00
Maurice ONeal
954fdfba0b v1.5.t8
Logs are still being cutoff, I'm assuming the app is crashing but can't
locate the problem without any logs. Reformed logging to never overwrite
the logs and will instead append only. Size control will be in the form
of the byte size of the log files.
2022-12-13 20:27:32 -05:00
Maurice ONeal
2bd600bd51 v1.5.t5
Fixed a bug that caused the buffDir to get deleted before the app did
any work. Apparently the filesystem lib crashes the app if the directory
doesn't exists. Might need to add protection against that in the future.

Directory pages with now explicitly link to index.html since implicit
does not work for apache2.
2022-12-11 15:06:09 -05:00
Maurice ONeal
5ab50433cf v1.5.t4
The error checking with ffmpeg is not working. Learned that it doesn't
always return 0 on success. Decided to remove the error checking
altogether. Instead ffmpeg failures should be checked manually using
stderr.

Dirent includes .. and . so I decided to switch to the filesystem entry
listing that should hopefully exclude those special directories.

The camera webroot was not generating .index files. those files would
only get generated if motion was detected. Copied the code that does
that onto recLoop() to execute regardless of motion.
2022-12-11 12:33:56 -05:00
Maurice ONeal
baeaabbd55 v1.5.t3
Fixed the default webroot directory to apache's correct webroot. Also
renamed separated outDir from webRoot and made webRoot changeable on the
config file.

Added logging the recorder and detection loops to help with debugging
and troubleshooting. Just like the video clips, max log lines were added
to control the size of the data being saved to storage.
2022-12-11 10:25:22 -05:00
Maurice ONeal
ce4a326b24 v1.5.t2
The camera folder will now be auto created and eventually will cause the
app to auto create the webroot regardless if motion was detected or not.
2022-12-04 20:07:20 -05:00
Maurice ONeal
9816ba339f v1.5.t1
Decided to switch using opencv's builtin pixel diff motion detection via
absdiff and thresh. Doing this should increase efficiency instead of
using the home brewed pixel loops and threads.

Added a web interface of sorts by having html files output along with
the video clips. These files are designed to link together with the
assumption that the output directory is a web root like /var/www/html
that apache2 uses. The interface is crude at best but at least allow
playback of recorded footage.

Added max_clips config variable that can limit the amount of motion
events that can recorded to storage on a single day.
2022-12-04 15:13:39 -05:00
Maurice ONeal
a0ee8e35f7 v1.4.t11
completely removed object detection code because I don't foresee going
back to that model anytime soon. diffs will not reset to 0 instead
decrement and the consecutive pixel diffs are now adjustable via
consec_threshold.

updated README.md for the changes to pixel diff detection.
2022-10-14 14:31:12 -04:00
Maurice ONeal
4bf3672a39 v1.4.t8
AI object detection via yolov5 didn't work out too well, in fact it was
crashing the detection threads for whatever reason. I could deep dive
why it was crashing but I think the better solution is to bring back
optical flow detection at the block level. the advantage of this over
object detection is the fact that a block doesn't need to have a whole
object in it.
2022-10-04 18:12:32 -04:00
Maurice ONeal
42814ab8ca v1.4.t7
the fifo file for stat output doesn't work. switched back regular file
for stats.
2022-10-02 09:29:29 -04:00
Maurice ONeal
1e72107ff0 v1.4.t6
switched over the stat text from a regular file to a fifo file.
2022-10-02 09:01:38 -04:00
Maurice ONeal
cd4a2d0f98 v1.4.t4
potentially fixed what was apparently a long standing bug that caused
motion detection to look at just the first block. this bug was found
thanks to the stats output.
2022-09-30 16:18:39 -04:00
Maurice ONeal
4f33c280ce v1.4.t3
Fixed a few bugs in the stat output strings so they should output to the
stat file as expected.
2022-09-29 14:52:42 -04:00
Maurice ONeal
7ab51226b2 v1.4.t2
re-formed the stats output and moved it out of the motion detect
function.

block pixel diff counts will now no longer stop at the threshold at each
block. it will now count the entire block and output the results in the
stats. the code now also pick the block with the highest pixDiff instead
of stopping at the first block with a high pixDiff.
2022-09-29 11:37:10 -04:00
Maurice ONeal
5d12855fad v1.4.t1
added object detection code base on yolov5 machine vision model. also
added a stat file so motion and object detection values can be monitored
in real time if used with the 'watch' command.
2022-09-27 18:10:04 -04:00
Maurice ONeal
bf3de932d1 v1.3 Update
Broken down the code into multiple files instead having it all in
main.cpp.

Also detached recording from detection by having them now run in
separate threads instead of having motion detection inline with
recording. this will hopefully make it so there is less missed motion
events due to processing overhead.

The recording loop now take advantage of FFMPEG's "-f segment" option
instead of generating the clips implicitly in separated FFMPEG calls.
again, all in hope to reduce missed motion events.

This application have the tendency to detect motion of small insects.
to prevent this it was determined with there will need to be some means
of identifying objects via machine vision. there is an object detection
function but it doesn't currently do anything at this time. this is
something that I will be working on in the near future.

created a test branch in the repository. all early, testing code will
now go in this branch going forward. only fully tested, stable code will
be committed to master going forward.
2022-09-22 20:57:46 -04:00