summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-06-12 15:13:10 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-06-12 15:13:10 +0300
commitfd4fa7d217f64723b41eca777960437bb666dd55 (patch)
tree5db1f60f07835a9555b1aae4429a7715df09c496 /tools
parenta71ed996e23498059d0a3a482e8e344efccdf297 (diff)
ipcam_motion_worker: measure do_motion execution time instead of do_dvr_scan
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ipcam_motion_worker.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/ipcam_motion_worker.sh b/tools/ipcam_motion_worker.sh
index 47f7aae..f7d968c 100755
--- a/tools/ipcam_motion_worker.sh
+++ b/tools/ipcam_motion_worker.sh
@@ -157,6 +157,8 @@ do_motion() {
local tc
local timecodes=()
+
+ time_start
if [ -z "$roi_file" ]; then
timecodes+=($(do_dvr_scan "$input"))
else
@@ -171,6 +173,8 @@ do_motion() {
done < <(cat "$roi_file")
fi
+ debug "do_motion: finished in $(time_elapsed)"
+
timecodes="$(echo "${timecodes[@]}" | sed 's/ */ /g' | xargs)"
timecodes="${timecodes// /,}"
@@ -184,19 +188,19 @@ dvr_scan() {
do_dvr_scan() {
local input="$1"
local args=
+
if [ ! -z "$2" ]; then
args="-roi $2"
echoinfo "dvr_scan(${BOLD}${input}${RST}${CYAN}): roi=($2), mt=${config[threshold]}"
else
echoinfo "dvr_scan(${BOLD}${input}${RST}${CYAN}): no roi, mt=${config[threshold]}"
fi
- time_start
+
dvr_scan -q -i "$input" -so \
--min-event-length ${config[min_event_length]} \
-df ${config[downscale_factor]} \
--frame-skip ${config[frame_skip]} \
-t ${config[threshold]} $args | tail -1
- debug "dvr_scan: finished in $(time_elapsed)s"
}
[[ $# -lt 1 ]] && usage