v2.2
Updated the documentation, current iteration of the code is deemed stable. Releasing to main.
This commit is contained in:
parent
3f3cbcc75b
commit
f4ea944f97
17
README.md
17
README.md
|
@ -60,15 +60,26 @@ img_thresh = 80000
|
|||
# before it is considered motion. any video clips found with frames
|
||||
# exceeding this value will be copied from live footage to event footage.
|
||||
#
|
||||
frame_gap = 10
|
||||
# this is the amount of frames in between the comparison frames to check
|
||||
# for pixel differences. the higher the value, the lower the cpu over
|
||||
# head, however it does lower motion detection accuracy.
|
||||
#
|
||||
max_events = 40
|
||||
# this indicates the maximum amount of motion event video clips to keep
|
||||
# before deleting the oldest clip.
|
||||
#
|
||||
sch_sec = 60
|
||||
# this is the amount of seconds to wait in between running post_cmd.
|
||||
max_event_secs = 10
|
||||
# this is the maximum amount of secs of video footage that can be
|
||||
# recorded in a motion event.
|
||||
#
|
||||
post_secs = 60
|
||||
# this is the amount of seconds to wait before running the command
|
||||
# defined in post_cmd. the command will not run if motion was detected
|
||||
# in the space before post_secs elapsed.
|
||||
#
|
||||
post_cmd = move_the_ptz_camera.py
|
||||
# this an optional command to run with sch_sec. one great use for this
|
||||
# this an optional command to run with post_secs. one great use for this
|
||||
# is to move a ptz camera to the next position of it's patrol pattern.
|
||||
# note: the call to this command will be delayed if motion was detected.
|
||||
#
|
||||
|
|
|
@ -34,7 +34,7 @@ using namespace std;
|
|||
using namespace std::filesystem;
|
||||
using namespace std::chrono;
|
||||
|
||||
#define APP_VER "2.1.t3"
|
||||
#define APP_VER "2.2"
|
||||
#define APP_NAME "Motion Watch"
|
||||
#define REC_LOG_NAME "rec_log_lines.html"
|
||||
#define DET_LOG_NAME "det_log_lines.html"
|
||||
|
|
14
src/main.cpp
14
src/main.cpp
|
@ -51,13 +51,9 @@ void eventLoop(shared_t *share)
|
|||
if (wrOutVod(event, share))
|
||||
{
|
||||
genHTMLvod(event.evName);
|
||||
|
||||
if (exists("events"))
|
||||
{
|
||||
imwrite(string("events/" + event.evName + ".jpg").c_str(), event.thumbnail);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (filesystem_error &ex)
|
||||
{
|
||||
recLog(string("err: ") + ex.what(), share);
|
||||
|
@ -116,15 +112,18 @@ void upkeep(shared_t *share)
|
|||
}
|
||||
}
|
||||
|
||||
void recLoop(shared_t *share)
|
||||
{
|
||||
while (share->retCode == 0)
|
||||
void rmLive()
|
||||
{
|
||||
if (exists("live"))
|
||||
{
|
||||
remove_all("live");
|
||||
}
|
||||
}
|
||||
|
||||
void recLoop(shared_t *share)
|
||||
{
|
||||
while (share->retCode == 0)
|
||||
{
|
||||
auto cmd = "ffmpeg -hide_banner -rtsp_transport tcp -timeout 3000000 -i " +
|
||||
share->recordUrl +
|
||||
" -strftime 1" +
|
||||
|
@ -136,6 +135,7 @@ void recLoop(shared_t *share)
|
|||
" stream.m3u8";
|
||||
|
||||
recLog("ffmpeg_run: " + cmd, share);
|
||||
rmLive();
|
||||
|
||||
auto retCode = system(cmd.c_str());
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user