v2.1.t3
-adjusted config defaults Attempting to slow down motion detection again. This time it should properly match the camera's fps.
This commit is contained in:
parent
b4ca30b0e1
commit
3f3cbcc75b
|
@ -175,9 +175,9 @@ string genDstFile(const string &dirOut, const char *fmt, const string &ext)
|
|||
return cleanDir(dirOut) + string("/") + genTimeStr(fmt) + ext;
|
||||
}
|
||||
|
||||
string genEventName()
|
||||
string genEventName(int score)
|
||||
{
|
||||
return genTimeStr("%Y-%j-%H-%M");
|
||||
return genTimeStr(string("%Y-%j-%H-%M-%S--" + to_string(score)).c_str());
|
||||
}
|
||||
|
||||
void rdLine(const string ¶m, const string &line, string *value)
|
||||
|
@ -252,7 +252,7 @@ bool rdConf(shared_t *share)
|
|||
share->skipCmd = false;
|
||||
share->postSecs = 60;
|
||||
share->evMaxSecs = 10;
|
||||
share->frameGap = 5;
|
||||
share->frameGap = 10;
|
||||
share->webRoot = "/var/www/html";
|
||||
share->webBg = "#485564";
|
||||
share->webTxt = "#dee5ee";
|
||||
|
|
|
@ -34,7 +34,7 @@ using namespace std;
|
|||
using namespace std::filesystem;
|
||||
using namespace std::chrono;
|
||||
|
||||
#define APP_VER "2.1.t2"
|
||||
#define APP_VER "2.1.t3"
|
||||
#define APP_NAME "Motion Watch"
|
||||
#define REC_LOG_NAME "rec_log_lines.html"
|
||||
#define DET_LOG_NAME "det_log_lines.html"
|
||||
|
@ -81,7 +81,7 @@ struct shared_t
|
|||
|
||||
string genVidNameFromLive(const string &tsPath);
|
||||
string genEventPath(const string &tsPath);
|
||||
string genEventName();
|
||||
string genEventName(int score);
|
||||
string genDstFile(const string &dirOut, const char *fmt, const string &ext);
|
||||
string genTimeStr(const char *fmt);
|
||||
string cleanDir(const string &path);
|
||||
|
|
|
@ -42,7 +42,7 @@ void detectMoInStream(const string &streamFile, shared_t *share)
|
|||
|
||||
if (!share->curEvent.srcPaths.empty())
|
||||
{
|
||||
share->curEvent.evName = genEventName();
|
||||
share->curEvent.evName = genEventName(share->maxScore);
|
||||
share->recList.push_back(share->curEvent);
|
||||
|
||||
detLog("motion detected in " + to_string(share->curEvent.srcPaths.size()) + " file(s) in " + to_string(share->evMaxSecs) + " secs", share);
|
||||
|
@ -124,8 +124,12 @@ bool moDetect(const string &buffFile, shared_t *share)
|
|||
Mat prev;
|
||||
Mat next;
|
||||
|
||||
for (auto gap = 0; capture.grab(); ++gap)
|
||||
int fps = capture.get(cv::CAP_PROP_FPS);
|
||||
|
||||
for (auto gap = 0, frm = fps; capture.grab(); ++gap, ++frm)
|
||||
{
|
||||
if (frm == fps) sleep(1); frm = 1;
|
||||
|
||||
if (prev.empty())
|
||||
{
|
||||
capture.retrieve(prev);
|
||||
|
|
Loading…
Reference in New Issue
Block a user