master
parent
40fb31e6f6
commit
fc6dfaeb0a
|
|
@ -42,8 +42,8 @@ main() {
|
|||
echo uuid=$uuid stream=$stream recording=$recording ts=$ts
|
||||
api "/api/cameras/$uuid/$stream/view.mp4?s=$recording&ts=true" > /tmp/movement_detection_via_api_ffmpeg.sh.mp4
|
||||
|
||||
local fps=$(ffprobe -i /tmp/movement_detection_via_api_ffmpeg.sh.mp4 2>&1 | grep -o '[0-9]*\.*[0-9]* fps' | head -n 1 | awk '{print $1}')
|
||||
local inspection="$(ffmpeg -i /tmp/movement_detection_via_api_ffmpeg.sh.mp4 -vf 'select=not(mod(n\,'${fps%.*}')),select=gte(scene\,0),metadata=print:file=-' -an -f null - 2> /dev/null | paste - -)"
|
||||
local fps=$(_ffprobe -i /tmp/movement_detection_via_api_ffmpeg.sh.mp4 2>&1 | grep -o '[0-9]*\.*[0-9]* fps' | head -n 1 | awk '{print $1}')
|
||||
local inspection="$(_ffmpeg -i /tmp/movement_detection_via_api_ffmpeg.sh.mp4 -vf 'select=not(mod(n\,'${fps%.*}')),select=gte(scene\,0),metadata=print:file=-' -an -f null - 2> /dev/null | paste - -)"
|
||||
local scores=($(echo "$inspection" | awk '{print $NF}' | sed 's/.*=//'))
|
||||
|
||||
local flattened_scores=()
|
||||
|
|
@ -107,4 +107,20 @@ _perl() {
|
|||
fi
|
||||
}
|
||||
|
||||
_ffprobe() {
|
||||
if which ffprobe &> /dev/null; then
|
||||
ffprobe "$@"
|
||||
else
|
||||
/volume1/homes/squeaky2x3/ffmpeg-local/ffprobe "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
_ffmpeg() {
|
||||
if which ffmpeg &> /dev/null; then
|
||||
ffmpeg "$@"
|
||||
else
|
||||
/volume1/homes/squeaky2x3/ffmpeg-local/ffmpeg "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
Loading…
Reference in New Issue