Discovered that the "ffmpeg stall" is still an issue so I put the
timeout call back into the ffmpeg command.

Changed the default pix_thresh to 10000.
This commit is contained in:
Maurice ONeal 2022-12-22 20:15:14 -05:00
parent 736b8c5ec4
commit 4e44111ea8
4 changed files with 7 additions and 4 deletions

View File

@ -62,7 +62,7 @@ frame_gap = 10
# check the pixel diffs for motion. the lower the value, the more frames # check the pixel diffs for motion. the lower the value, the more frames
# will be checked, however with that comes higher cpu usage. # will be checked, however with that comes higher cpu usage.
# #
img_thresh = 1024 img_thresh = 10000
# this indicates how many pixels need to be different in between frame_gap # this indicates how many pixels need to be different in between frame_gap
# before it is considered motion. any video clips found with frames # before it is considered motion. any video clips found with frames
# exceeding this value will be moved from buff_dir to web_root. # exceeding this value will be moved from buff_dir to web_root.

View File

@ -192,7 +192,7 @@ bool rdConf(shared_t *share)
share->retCode = 0; share->retCode = 0;
share->frameGap = 10; share->frameGap = 10;
share->pixThresh = 150; share->pixThresh = 150;
share->imgThresh = 1024; share->imgThresh = 10000;
share->secs = 60; share->secs = 60;
share->maxDays = 15; share->maxDays = 15;
share->maxClips = 90; share->maxClips = 90;

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.t17" #define APP_VER "1.5.t18"
#define APP_NAME "Motion Watch" #define APP_NAME "Motion Watch"
struct shared_t struct shared_t

View File

@ -69,7 +69,10 @@ void recLoop(shared_t *share)
for (auto i = 0; i < share->secs; i += 10) for (auto i = 0; i < share->secs; i += 10)
{ {
auto bufPath = cleanDir(share->buffDir) + "/" + to_string(i) + "." + share->vidExt; auto bufPath = cleanDir(share->buffDir) + "/" + to_string(i) + "." + share->vidExt;
auto cmd = "ffmpeg -hide_banner -i " + share->recordUrl + " -y -vcodec " + share->vidCodec + " -movflags faststart -t 10 " + bufPath; auto limSecs = to_string(share->secs + 2);
auto cmd = "timeout -k 1 " + limSecs + " ";
cmd += "ffmpeg -hide_banner -i " + share->recordUrl + " -y -vcodec " + share->vidCodec + " -movflags faststart -t 10 " + bufPath;
recLog("ffmpeg_run: " + cmd, share); recLog("ffmpeg_run: " + cmd, share);