- EventLoop will now pick an image within 2 mins of live footage
  and copy it to the root directory of the buff dir. This can be
  used by user interfaces as a live stream thumbnail.
- Gray option is no longer enabled by default.
- The default compare command will now use the Gray image format
  internally instead of relying on the external Gray option.
This commit is contained in:
Zii 2026-04-03 08:21:10 -04:00
parent 76b9d743b7
commit a9dd4ee264
3 changed files with 22 additions and 4 deletions

View File

@ -140,7 +140,7 @@ bool rdConf(const QString &filePath, shared_t *share)
share->evtMax = 120; share->evtMax = 120;
share->conf = filePath; share->conf = filePath;
share->outputType = "stderr"; 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->vidCodec = "copy";
share->audCodec = "copy"; share->audCodec = "copy";
share->streamExt = ".ts"; share->streamExt = ".ts";
@ -150,7 +150,7 @@ bool rdConf(const QString &filePath, shared_t *share)
share->liveMins = 60; share->liveMins = 60;
share->liveClipSecs = 5; share->liveClipSecs = 5;
share->secPerImg = 4; share->secPerImg = 4;
share->grayImg = true; share->grayImg = false;
share->recScale = "1280:720"; share->recScale = "1280:720";
QString line; QString line;

View File

@ -32,7 +32,7 @@
using namespace std; using namespace std;
#define APP_VERSION "1.3" #define APP_VERSION "1.4"
#define APP_NAME "JustMotion" #define APP_NAME "JustMotion"
#define APP_TARGET "jmotion" #define APP_TARGET "jmotion"
#define DATETIME_FMT "yyyyMMddhhmm" #define DATETIME_FMT "yyyyMMddhhmm"

View File

@ -152,7 +152,7 @@ void EventItem::wroutThenDie()
EventLoop::EventLoop(shared_t *sharedRes, QThread *thr, QObject *parent) : QObject(parent) EventLoop::EventLoop(shared_t *sharedRes, QThread *thr, QObject *parent) : QObject(parent)
{ {
shared = sharedRes; shared = sharedRes;
heartBeat = 3; heartBeat = 10;
loopTimer = 0; loopTimer = 0;
connect(thr, &QThread::finished, this, &EventLoop::deleteLater); connect(thr, &QThread::finished, this, &EventLoop::deleteLater);
@ -219,4 +219,22 @@ void EventLoop::exec()
names.removeFirst(); 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());
}
}
} }