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
|
# before it is considered motion. any video clips found with frames
|
||||||
# exceeding this value will be copied from live footage to event footage.
|
# 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
|
max_events = 40
|
||||||
# this indicates the maximum amount of motion event video clips to keep
|
# this indicates the maximum amount of motion event video clips to keep
|
||||||
# before deleting the oldest clip.
|
# before deleting the oldest clip.
|
||||||
#
|
#
|
||||||
sch_sec = 60
|
max_event_secs = 10
|
||||||
# this is the amount of seconds to wait in between running post_cmd.
|
# 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
|
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.
|
# 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.
|
# 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::filesystem;
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
#define APP_VER "2.1.t3"
|
#define APP_VER "2.2"
|
||||||
#define APP_NAME "Motion Watch"
|
#define APP_NAME "Motion Watch"
|
||||||
#define REC_LOG_NAME "rec_log_lines.html"
|
#define REC_LOG_NAME "rec_log_lines.html"
|
||||||
#define DET_LOG_NAME "det_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))
|
if (wrOutVod(event, share))
|
||||||
{
|
{
|
||||||
genHTMLvod(event.evName);
|
genHTMLvod(event.evName);
|
||||||
|
|
||||||
if (exists("events"))
|
|
||||||
{
|
|
||||||
imwrite(string("events/" + event.evName + ".jpg").c_str(), event.thumbnail);
|
imwrite(string("events/" + event.evName + ".jpg").c_str(), event.thumbnail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (filesystem_error &ex)
|
catch (filesystem_error &ex)
|
||||||
{
|
{
|
||||||
recLog(string("err: ") + ex.what(), share);
|
recLog(string("err: ") + ex.what(), share);
|
||||||
|
@ -116,15 +112,18 @@ void upkeep(shared_t *share)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void recLoop(shared_t *share)
|
void rmLive()
|
||||||
{
|
{
|
||||||
while (share->retCode == 0)
|
|
||||||
{
|
|
||||||
if (exists("live"))
|
if (exists("live"))
|
||||||
{
|
{
|
||||||
remove_all("live");
|
remove_all("live");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void recLoop(shared_t *share)
|
||||||
|
{
|
||||||
|
while (share->retCode == 0)
|
||||||
|
{
|
||||||
auto cmd = "ffmpeg -hide_banner -rtsp_transport tcp -timeout 3000000 -i " +
|
auto cmd = "ffmpeg -hide_banner -rtsp_transport tcp -timeout 3000000 -i " +
|
||||||
share->recordUrl +
|
share->recordUrl +
|
||||||
" -strftime 1" +
|
" -strftime 1" +
|
||||||
|
@ -136,6 +135,7 @@ void recLoop(shared_t *share)
|
||||||
" stream.m3u8";
|
" stream.m3u8";
|
||||||
|
|
||||||
recLog("ffmpeg_run: " + cmd, share);
|
recLog("ffmpeg_run: " + cmd, share);
|
||||||
|
rmLive();
|
||||||
|
|
||||||
auto retCode = system(cmd.c_str());
|
auto retCode = system(cmd.c_str());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user