-detect loop will now use the previous video clip as a base for the
 next 3 video clips. doing this prevents the same clips from being
 processed multiple times.
This commit is contained in:
Zii 2023-11-23 09:22:06 -05:00
parent 5b444fd754
commit da941d8d18
3 changed files with 11 additions and 8 deletions

View File

@ -167,9 +167,6 @@ void DetectLoop::init()
void DetectLoop::reset()
{
vidAPath.clear();
vidBPath.clear();
eventQue.inQue = false;
eventQue.score = 0;
eventQue.queAge = 0;
@ -182,15 +179,19 @@ void DetectLoop::reset()
void DetectLoop::updated(const QString &path)
{
auto clips = lsFilesInDir(path, shared->streamExt);
auto index = clips.indexOf(vidBName);
if (clips.size() < 3)
if (clips.size() - (index + 1) < 3)
{
thread()->sleep(5); reset();
thread()->sleep(1);
}
else
{
vidAPath = shared->buffPath + "/live/" + clips[clips.size() - 3];
vidBPath = shared->buffPath + "/live/" + clips[clips.size() - 2];
vidAName = clips[clips.size() - 3];
vidBName = clips[clips.size() - 2];
vidAPath = shared->buffPath + "/live/" + vidAName;
vidBPath = shared->buffPath + "/live/" + vidBName;
exec(); thread()->sleep(1);
}

View File

@ -62,6 +62,8 @@ private:
QString vidAPath;
QString vidBPath;
QString vidAName;
QString vidBName;
QStringList prevClips;
QTimer *pcTimer;
evt_t eventQue;

View File

@ -30,7 +30,7 @@
using namespace std;
#define APP_VER "3.3.t6"
#define APP_VER "3.3.t7"
#define APP_NAME "Motion Watch"
#define APP_BIN "mow"
#define DATETIME_FMT "yyyyMMddhhmmss"