Skip to content

A live bird collage card for your Home Assistant dashboard.

fixed 60-second checker

Patrick McGuire256063fea891
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh
index 74cf39d4..3ce6763b 100755
--- a/scripts/birdnet_analysis.sh
+++ b/scripts/birdnet_analysis.sh
@@ -43,15 +43,19 @@ run_analysis() {
cd ${HOME}/BirdNET-Lite || exit 1
for i in "${files[@]}";do
+ set -x
FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 \
| awk -F. '/Duration/ {print $1}' \
| cut -d':' -f3-4)"
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12
[ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00
- [ "${FILE_LENGTH}" == "00:${RECORDING_LENGTH}" ] || continue
+ if [ ${RECORDING_LENGTH} == "01:00" ];then
+ [ "${FILE_LENGTH}" == "${RECORDING_LENGTH}" ] || continue
+ else
+ [ "${FILE_LENGTH}" == "00:${RECORDING_LENGTH}" ] || continue
+ fi
if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];then
- set -x
python3 analyze.py \
--i "${1}/${i}" \
--o "${1}/${i}.csv" \