diff --git a/src/common.cpp b/src/common.cpp index 2931ab1..cfd1be4 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -140,7 +140,7 @@ bool rdConf(const QString &filePath, shared_t *share) share->evtMax = 120; share->conf = filePath; share->outputType = "stderr"; - share->compCmd = "compare -metric FUZZ " + QString(PREV_IMG) + " " + QString(NEXT_IMG) + " /dev/null"; + share->compCmd = "compare -colorspace Gray -metric FUZZ " + QString(PREV_IMG) + " " + QString(NEXT_IMG) + " /dev/null"; share->vidCodec = "copy"; share->audCodec = "copy"; share->streamExt = ".ts"; @@ -150,7 +150,7 @@ bool rdConf(const QString &filePath, shared_t *share) share->liveMins = 60; share->liveClipSecs = 5; share->secPerImg = 4; - share->grayImg = true; + share->grayImg = false; share->recScale = "1280:720"; QString line; diff --git a/src/common.h b/src/common.h index 06da10d..a0f4438 100644 --- a/src/common.h +++ b/src/common.h @@ -32,7 +32,7 @@ using namespace std; -#define APP_VERSION "1.3" +#define APP_VERSION "1.4" #define APP_NAME "JustMotion" #define APP_TARGET "jmotion" #define DATETIME_FMT "yyyyMMddhhmm" diff --git a/src/event_loop.cpp b/src/event_loop.cpp index ce2d6a7..702bdaf 100644 --- a/src/event_loop.cpp +++ b/src/event_loop.cpp @@ -152,7 +152,7 @@ void EventItem::wroutThenDie() EventLoop::EventLoop(shared_t *sharedRes, QThread *thr, QObject *parent) : QObject(parent) { shared = sharedRes; - heartBeat = 3; + heartBeat = 10; loopTimer = 0; connect(thr, &QThread::finished, this, &EventLoop::deleteLater); @@ -219,4 +219,22 @@ void EventLoop::exec() names.removeFirst(); } + + // pick the latest image from the live stream and copy that to the live root directory + // as a thumbnail. + + names = lsDirsInDir(shared->buffPath + "/img"); + + if (names.size() >= 3) + { + auto lastImgDir = shared->buffPath + "/img/" + names[names.size() - 3]; + auto imgList = lsFilesInDir(lastImgDir); + + if (!imgList.isEmpty()) + { + auto thumbnail = lastImgDir + "/" + imgList.last(); + + QFile::copy(thumbnail, shared->buffPath + "/thumb." + QFileInfo(thumbnail).suffix()); + } + } }