From ad4a6357b4e78eae2eec77502e73f589b62291fc Mon Sep 17 00:00:00 2001 From: Maurice ONeal Date: Tue, 20 Dec 2022 20:25:54 -0500 Subject: [PATCH] v1.5.t15 Thanks the debug messages, in found a potential issue with the video clips being pulled from the in house test cameras. Sometimes the video clips are being pulled with incomplete meta information causing opencv to fail to open the clips. Added "-movflags faststart" to the ffmpeg command that should hopefully fix this and should help the app to handle unreliable camera streams more gracefully. max_clips now defaults to 90 instead of 30. --- src/common.cpp | 2 +- src/common.h | 2 +- src/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common.cpp b/src/common.cpp index 8548f04..a555219 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -195,7 +195,7 @@ bool rdConf(shared_t *share) share->imgThresh = 1024; share->secs = 60; share->maxDays = 15; - share->maxClips = 30; + share->maxClips = 90; share->maxLogSize = 50000; share->camName = path(share->conf.c_str()).filename(); share->webRoot = "/var/www/html"; diff --git a/src/common.h b/src/common.h index b73f96e..b347b3a 100644 --- a/src/common.h +++ b/src/common.h @@ -35,7 +35,7 @@ using namespace cv; using namespace std; using namespace std::filesystem; -#define APP_VER "1.5.t14" +#define APP_VER "1.5.t15" #define APP_NAME "Motion Watch" struct shared_t diff --git a/src/main.cpp b/src/main.cpp index 5f9fa65..ea53f73 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -102,7 +102,7 @@ void recLoop(shared_t *share) auto bufPath = cleanDir(share->buffDir) + "/%03d." + share->vidExt; auto secs = to_string(share->secs); auto limSecs = to_string(share->secs + 3); - auto cmd = "timeout -k 1 " + limSecs + " ffmpeg -hide_banner -i " + share->recordUrl + " -y -vcodec " + share->vidCodec + " -map 0 -segment_time 00:00:10 -f segment -t " + secs + " " + bufPath; + auto cmd = "timeout -k 1 " + limSecs + " ffmpeg -hide_banner -i " + share->recordUrl + " -y -vcodec " + share->vidCodec + " -movflags faststart -map 0 -segment_time 00:00:10 -f segment -t " + secs + " " + bufPath; thread th2(detectLoop, share);