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.shindex 1fa8b989..d456a0e7 100755--- a/scripts/birdnet_analysis.sh+++ b/scripts/birdnet_analysis.sh@@ -91,10 +91,9 @@ run_analysis() {fifor i in "${files[@]}";do+ [ ! -f ${1}/${i} ] && continueecho "${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 && continueecho "RECORDING_LENGTH set to ${RECORDING_LENGTH}"if [ "${RECORDING_LENGTH}" == 60 ];thenRECORDING_LENGTH_MATCH="01:00"