-the live stream is now a part of the camera's main page.
-fixed symm links for the main page not being created on install.
-removed deprecated ffmpeg timeout option.
-copied hls.js as a local file so live streams will still work
without being connected to the internet.
-fixed the -i option that was using /etc instaead of /etc/mow
-the externalized image comparison executable is now configurable
in the config file.
-moved the main index.html and theme.css files to the buffer dir,
moving even more io to the buffer dir.
-the -d option will no longer directly run camera instances. it
will instead utilize systemd to install camera services.
-added -i, -l and -r options to manage camera services.
-the app will now default work and output directories in the
/var/opt directory instead of /var/www/html and /tmp, making
it a better neighbour in the fact that it won't overwrite
existing websites or tmp files.
-install.sh will now create an unprivileged mow user that will
be used to run camera services. all in effort to make the app
a good neighour and follow good security practice.
added a buffer directory so the actual work of image frame capture
and live video recording can be moved off of main storage.
also removed installation of the apache2 http server from
install.sh to make this app more agnostic and leave it up to the
end user to install what ever web server they want.
-added event age to evt_t as a way to track the age of the event
in EventLoop so now only events approching and exceeding
evMaxSecs will have the video range added for writing.
-the ffmpeg auto refresh logic is working, just need to shorten
the frequency by setting recloop's heartbeat to default.
-added hls flag "omit_endlist" so the auto refresh doesn't cut off
the stream at the web browser end.
-ffmpeg still stalls even with tcp timeout parameters in place.
added self end -t option to match the heart beat of RecLoop.
doing this auto re-fresh ffmpeg every 30mins and should prevent
stall. for some reason ffmpeg just can't run long term without
stalling.
-finally fixed the crashing issue. it turns out EventLoop::exec()
was calling vidList.removeLast() on an empty list every now and
then, causing qt to fatal assert. I removed the line since it is
not even needed.
-the debug code from the previous commit help narrow down what
function is causing the crash but that's it, I need more. decided
add the debug build type to cmake and will use gdb to help with
debugging.
-decided to remove the debug code since I'll use gdb as the long
term solution going forward.
-added mutex thread protection. getting sigmentation faults on the
test machine. added thread protection on various shared
parameters in hope that it fix the random crashing issue.
-didn't properly remove use of evhist from the last commit. it is
truely removed now.
-added delay cycles to detectLoop is motion was detected to
prevent some event overlap.
-removed use of evtHist. will instead allow eventLoop to que up
duplicate live video clips and then remove later using
QStringList::removeDuplicates().
-changed up the ffmpeg commands to utilize tcp and re-added a tcp
timeout argument, removing the need for command stall checking.
-added logic to pick the snapshot with the highest diff score as
the event thumbnail.
-added a termination slot to RecLoop that will kill the long term
ffmpeg commands and connected it to 'aboutToQuit' signal. this is
expected to kill the ffmpeg commands properly when quiting the
main process.
-max_event_secs is not being honered correctly. EventLoop was not
calculating the amount the hls clips to grab from live correctly.
chanaged it to properly calculate file count based on hls segment
size.
-updated the documentation as the current version nears stable
release.
-turns out the previous statment on the previous commit is
incorrect. it is every possible to overlap events. to
mitigate this, evtHist was added to shared_t to track
recently copied source vids and remove them from the
event queued to be written.
-removed the delay after motion was detected. it was not having
the desired effect and after more thought event overlap would
be impossible anyway.
-the test cameras are still picking up motion during the post
command. adjusted the after command delay to see if that
helps.
-reduced the DetectLoop heartbeat from 3 to 2 to better match
the record loop's cadence.
-the test cameras are picking up motion as post command is running.
added a delay increment to DetectLoop in hope to fix this.
-removed the upkeep log since it doesn't really provide any useful
information.
-adjusted the default motion score again.
-reduced the amount of image files DetectLoop needs from 3 to 2.
-added a dely to DetectLoop after a positive motion detection to
prevent motion event overlap.
-moved the 2 image diff pair compair to proper "end of array" in
DetectLoop.
-increased the size of the image stream so queded up events will
be able generate thumbnails properly.
-cleaned off a bunch of unused parameters in the code.
-adjusted the default motion sensitivity after real world
testing.
-added libfuse-dev to setup.sh since imagemagic needs that to
operate.
The Qt approach to grabbing frames from the live stream was also
a failure.
- decided to switch to a combination ffmpeg and imagemagic was
external commands to do motion detection. this approach
elimates the need for opencv altogeather so it was removed
from the project. system resource usage appears to be decent
and perhaps better than opencv.
I'm going to test a move away from opencv's videoio module.
Videoio simply refuses to open any video file even with
FFMPEG builtin. I tested old v2.2 code and even that failed
on a fresh install of ubuntu sever so this tells me an
update on opencv's side broke something.
This issue is not new and frankly I'm tired of chasing it.
I'm giving QT's QMediaPlayer a try to see how it works out.
Will still need opencv for the absdiff and threshold
functions, otherwise I would have dropped the API
altogeather.
Now that the app has QT::Multimedia, QT6 is now the minimum
version it will support. CMakeList.txt and the setup script
updated accordingly.
Got the app up to "not failing immediately" state.
However, for some reason DetectLoop is failing hard via opencv
being unable to open the stream clips.
I'll continue deep diving this. For now everything else works.
Added the much need code in Camera object to actual start all of
the threads.
Added multi instance support via the -d option.
Made the Loop object loop structure slot-signal compatible so
all objects using it can interupt the main loop to run other
slots.
Completely re-written the project to use the QT API. By using Qt,
I've open up use of useful tools like QCryptographicHash, QString,
QByteArray, QFile, etc.. In the future I could even make use of
slots/signals. The code is also in general much more readable and
thread management is by far much easier.
General operation of the app should be the same, this commit just
serves as a base for the migration over to QT.
the delay on the motion detection loop slowed it down too much to
the point that it falls too far behind live. I removed the delay
and re-introduced the frame gap so all frames in the video files
need to be decoded.
post command and event timers are now seperate but still tied to
a single thread so they can still be synced.
fixed an issued that cuased several thmubnails to not generate.
added more log lines the aid with debugging.
- reduced the hls size to 2 seconds.
- motion clips are not being combined. fixed it by making event
loop track the size of shared_t::recList instead of system time.
- maxScore is now global inside of shared_t instead of locally
inside detectMoInStream().
Fixed the crashing issue by adding tcp timeout args to ffmpeg and
having the app handle empty frames from a disconnected camera
better.
Reformed the directory structure by having live, logs and events in
seperate directories.
schLoop() no longer exists, postCmd is now handled by
detectMoInStream() to ensure motion detection is not done while the
command is running.
Event files are still not concatenating. I suspect the issue was in
eventLoop() caching old event objects. Changed up the loop to so it will
grab latest event object on each iteration.
Adjusted the event loop and motion detection to make better stand alone
m3u8 files. Hopefully doing this will make browsers treat the recorded
events as VODs instead of streams.
Apparently native html5 or modern browsers do not support running .m3u8
playlist directly or I was missing something in the original code. Even
adding the correct mime types in apache2 didn't work so I decided to
embed hls.js into the video html files to support hls playlist.
Logs are not rotating correctly. Changed up the code to append the logs
in memory and then dump them to permanent storage on every loop of
upkeep(). Hopefully this fixes the issue.