more deletion
parent
4d14a5073e
commit
beb369623f
|
|
@ -5,6 +5,9 @@ set -eo pipefail
|
||||||
if test -f /volume1/homes/squeaky2x3/services/moonfire-nvr.d/moonfire-nvr.sh; then
|
if test -f /volume1/homes/squeaky2x3/services/moonfire-nvr.d/moonfire-nvr.sh; then
|
||||||
bash /volume1/homes/squeaky2x3/services/moonfire-nvr.d/moonfire-nvr.sh
|
bash /volume1/homes/squeaky2x3/services/moonfire-nvr.d/moonfire-nvr.sh
|
||||||
fi
|
fi
|
||||||
|
if test -d /var/lib/moonfire-nvr; then
|
||||||
|
export MOONFIRE_DIR=/var/lib/moonfire-nvr
|
||||||
|
fi
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local nonrecent_unix="$(($(_date +%s) - 4 * 60 * 60))" # 4h ago
|
local nonrecent_unix="$(($(_date +%s) - 4 * 60 * 60))" # 4h ago
|
||||||
|
|
@ -22,7 +25,7 @@ main() {
|
||||||
| sort -n #-r
|
| sort -n #-r
|
||||||
))
|
))
|
||||||
for recording in "${recordings[@]}"; do
|
for recording in "${recordings[@]}"; do
|
||||||
if grep "^$uuid.$recording$" /tmp/movement_detection_via_api_ffmpeg.sh.txt; then
|
if grep "^$uuid.$recording$" ${MOONFIRE_DIR:-/tmp}/movement_detection_via_api_ffmpeg.sh.txt; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -60,7 +63,7 @@ main() {
|
||||||
threshold="$max_of_last_n"
|
threshold="$max_of_last_n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
threshold="$(_perl -e "print $threshold + 0.005")"
|
threshold="$(_perl -e "print $threshold + 0.01")"
|
||||||
|
|
||||||
local has_change=false
|
local has_change=false
|
||||||
if [ "${#flattened_scores[@]}" -lt 10 ]; then
|
if [ "${#flattened_scores[@]}" -lt 10 ]; then
|
||||||
|
|
@ -73,7 +76,7 @@ main() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $has_change; then
|
if $has_change; then
|
||||||
echo "$uuid.$recording" >> /tmp/movement_detection_via_api_ffmpeg.sh.txt
|
echo "$uuid.$recording" >> ${MOONFIRE_DIR:-/tmp}/movement_detection_via_api_ffmpeg.sh.txt
|
||||||
else
|
else
|
||||||
echo no movement in "$recording"
|
echo no movement in "$recording"
|
||||||
api "/api/cameras/$uuid/$stream/view.mp4" \
|
api "/api/cameras/$uuid/$stream/view.mp4" \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue