v3.0.t15
-changed up the logic in EventLoop to better honer maxEventSecs and pick the highest scoring event as the event name and thumbnail.
This commit is contained in:
parent
baf0b86610
commit
51218198b5
|
@ -267,54 +267,63 @@ bool Upkeep::exec()
|
|||
EventLoop::EventLoop(shared_t *sharedRes, QThread *thr, QObject *parent) : Loop(sharedRes, thr, parent)
|
||||
{
|
||||
heartBeat = 2;
|
||||
highScore = 0;
|
||||
cycles = 0;
|
||||
}
|
||||
|
||||
bool EventLoop::exec()
|
||||
{
|
||||
QStringList vidList;
|
||||
QString imgPath;
|
||||
QString name;
|
||||
float highScore = 0;
|
||||
|
||||
while (!shared->recList.isEmpty())
|
||||
if (cycles * 2 >= shared->evMaxSecs)
|
||||
{
|
||||
auto event = shared->recList[0];
|
||||
auto maxFiles = shared->evMaxSecs / 2;
|
||||
// there's 2 secs in each hls segment
|
||||
vidList.removeDuplicates();
|
||||
|
||||
if (highScore < event.score)
|
||||
if (!vidList.size() > 1)
|
||||
{
|
||||
name = event.timeStamp.toString(DATETIME_FMT);
|
||||
imgPath = event.imgPath;
|
||||
highScore = event.score;
|
||||
recLog("attempting write out of event: " + name, shared);
|
||||
|
||||
if (wrOutVod(name, vidList))
|
||||
{
|
||||
genHTMLvod(name);
|
||||
|
||||
QProcess proc;
|
||||
QStringList args;
|
||||
|
||||
args << "convert";
|
||||
args << imgPath;
|
||||
args << "events/" + name + ".jpg";
|
||||
|
||||
proc.start("magick", args);
|
||||
proc.waitForFinished();
|
||||
}
|
||||
}
|
||||
|
||||
vidList.append(backwardFacingFiles("live", ".ts", event.timeStamp, maxFiles / 2));
|
||||
vidList.removeLast();
|
||||
vidList.append(forwardFacingFiles("live", ".ts", event.timeStamp, maxFiles / 2));
|
||||
cycles = 0;
|
||||
highScore = 0;
|
||||
|
||||
shared->recList.removeFirst();
|
||||
vidList.clear();
|
||||
}
|
||||
|
||||
vidList.removeDuplicates();
|
||||
|
||||
if (!vidList.size() > 1)
|
||||
else
|
||||
{
|
||||
recLog("attempting write out of event: " + name, shared);
|
||||
cycles += 1;
|
||||
|
||||
if (wrOutVod(name, vidList))
|
||||
while (!shared->recList.isEmpty())
|
||||
{
|
||||
genHTMLvod(name);
|
||||
auto event = shared->recList[0];
|
||||
auto maxFiles = shared->evMaxSecs / 2;
|
||||
// there's 2 secs in each hls segment
|
||||
|
||||
QProcess proc;
|
||||
QStringList args;
|
||||
if (highScore < event.score)
|
||||
{
|
||||
name = event.timeStamp.toString(DATETIME_FMT);
|
||||
imgPath = event.imgPath;
|
||||
highScore = event.score;
|
||||
}
|
||||
|
||||
args << "convert";
|
||||
args << imgPath;
|
||||
args << "events/" + name + ".jpg";
|
||||
vidList.append(backwardFacingFiles("live", ".ts", event.timeStamp, maxFiles / 2));
|
||||
vidList.removeLast();
|
||||
vidList.append(forwardFacingFiles("live", ".ts", event.timeStamp, maxFiles / 2));
|
||||
|
||||
proc.start("magick", args);
|
||||
proc.waitForFinished();
|
||||
shared->recList.removeFirst();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -485,8 +494,6 @@ bool DetectLoop::exec()
|
|||
event.score = score;
|
||||
event.imgPath = images[pos];
|
||||
|
||||
delayCycles = (shared->evMaxSecs / 2) - 1;
|
||||
|
||||
shared->recList.append(event); mod = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,12 @@ class EventLoop : public Loop
|
|||
|
||||
private:
|
||||
|
||||
QStringList vidList;
|
||||
QString imgPath;
|
||||
QString name;
|
||||
float highScore;
|
||||
uint cycles;
|
||||
|
||||
bool wrOutVod(const QString &name, const QStringList &vids);
|
||||
|
||||
public:
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
#define APP_VER "3.0.t14"
|
||||
#define APP_VER "3.0.t15"
|
||||
#define APP_NAME "Motion Watch"
|
||||
#define APP_BIN "mow"
|
||||
#define REC_LOG_NAME "rec_log_lines.html"
|
||||
|
|
Loading…
Reference in New Issue
Block a user