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.
This commit is contained in:
Maurice ONeal 2022-12-20 20:25:54 -05:00
parent 4667cf2e96
commit ad4a6357b4
3 changed files with 3 additions and 3 deletions

View File

@ -195,7 +195,7 @@ bool rdConf(shared_t *share)
share->imgThresh = 1024; share->imgThresh = 1024;
share->secs = 60; share->secs = 60;
share->maxDays = 15; share->maxDays = 15;
share->maxClips = 30; share->maxClips = 90;
share->maxLogSize = 50000; share->maxLogSize = 50000;
share->camName = path(share->conf.c_str()).filename(); share->camName = path(share->conf.c_str()).filename();
share->webRoot = "/var/www/html"; share->webRoot = "/var/www/html";

View File

@ -35,7 +35,7 @@ using namespace cv;
using namespace std; using namespace std;
using namespace std::filesystem; using namespace std::filesystem;
#define APP_VER "1.5.t14" #define APP_VER "1.5.t15"
#define APP_NAME "Motion Watch" #define APP_NAME "Motion Watch"
struct shared_t struct shared_t

View File

@ -102,7 +102,7 @@ void recLoop(shared_t *share)
auto bufPath = cleanDir(share->buffDir) + "/%03d." + share->vidExt; auto bufPath = cleanDir(share->buffDir) + "/%03d." + share->vidExt;
auto secs = to_string(share->secs); auto secs = to_string(share->secs);
auto limSecs = to_string(share->secs + 3); 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); thread th2(detectLoop, share);