Skip to content

A live bird collage card for your Home Assistant dashboard.

avoid using ffmpeg: check existence of file in staid of checking for no length

frederikba33976b28b5
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh
index 1fa8b989..d456a0e7 100755
--- a/scripts/birdnet_analysis.sh
+++ b/scripts/birdnet_analysis.sh
@@ -91,10 +91,9 @@ run_analysis() {
fi
for i in "${files[@]}";do
+ [ ! -f ${1}/${i} ] && continue
echo "${1}/${i}" > $HOME/BirdNET-Pi/analyzing_now.txt
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=15
- FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)"
- [ -z $FILE_LENGTH ] && sleep 1 && continue
echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}"
if [ "${RECORDING_LENGTH}" == 60 ];then
RECORDING_LENGTH_MATCH="01:00"