From 4667cf2e964d67fe919ffd937cccb75566632b4d Mon Sep 17 00:00:00 2001 From: Maurice ONeal Date: Tue, 20 Dec 2022 19:29:36 -0500 Subject: [PATCH] v1.5.t14 Added another debug clause for opencv videoio so it will provide even more debug information. Going back to implicitly defining FFMPEG as the videoio for opencv, turns out FFMPEG is the only real stable option to use when it comes to reading video files with opencv. Any other option would just severely limit codec and container support. --- install.sh | 1 + src/common.h | 2 +- src/mo_detect.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 05e066a..ac8de0e 100644 --- a/install.sh +++ b/install.sh @@ -4,6 +4,7 @@ if [ ! -d "/opt/mow" ]; then fi cp ./.build-mow/mow /opt/mow/bin printf "#!/bin/sh\n" > /opt/mow/run +printf "export OPENCV_LOG_LEVEL=DEBUG\n" >> /opt/mow/run printf "export OPENCV_VIDEOIO_DEBUG=1\n" >> /opt/mow/run printf "/opt/mow/bin \$1 \$2 \$3\n" >> /opt/mow/run chmod +x /opt/mow/run diff --git a/src/common.h b/src/common.h index 37ecc12..b73f96e 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.t13" +#define APP_VER "1.5.t14" #define APP_NAME "Motion Watch" struct shared_t diff --git a/src/mo_detect.cpp b/src/mo_detect.cpp index 26efcdc..86b0b83 100644 --- a/src/mo_detect.cpp +++ b/src/mo_detect.cpp @@ -102,7 +102,7 @@ bool moDetect(const string &buffFile, Mat &vidThumb, shared_t *share) auto mod = false; - VideoCapture capture(buffFile.c_str()); + VideoCapture capture(buffFile.c_str(), CAP_FFMPEG); if (capture.isOpened()) {