Skip to content

A live bird collage card for your Home Assistant dashboard.

RTSP streams are a subdirectory of $RECS_DIR now

mcguirepr890b2448169377
diff --git a/scripts/birdnet_recording.sh b/scripts/birdnet_recording.sh
index 8a3063b7..5b4a1ae0 100755
--- a/scripts/birdnet_recording.sh
+++ b/scripts/birdnet_recording.sh
@@ -5,9 +5,10 @@ source /etc/birdnet/birdnet.conf
[ -z $RECORDING_LENGTH ] && RECORDING_LENGTH=15
if [ ! -z $RTSP_STREAM ];then
+ [ -d $RECS_DIR/StreamData ] || mkdir -p $RECS_DIR/StreamData
while true;do
for i in ${RTSP_STREAM//,/ };do
- ffmpeg -i ${i} -t ${RECORDING_LENGTH} -vn -acodec pcm_s16le -ac 2 -ar 48000 file:${RECS_DIR}/$(date "+%F")-birdnet-$(date "+%H:%M:%S").wav
+ ffmpeg -i ${i} -t ${RECORDING_LENGTH} -vn -acodec pcm_s16le -ac 2 -ar 48000 file:${RECS_DIR}/StreamData/$(date "+%F")-birdnet-$(date "+%H:%M:%S").wav
done
done
else
diff --git a/scripts/disk_check.sh b/scripts/disk_check.sh
index e7a60a85..743233e1 100755
--- a/scripts/disk_check.sh
+++ b/scripts/disk_check.sh
@@ -8,7 +8,7 @@ if [ "${used//%}" -ge 95 ]; then
case $FULL_DISK in
purge) echo "Removing oldest data"
cd ${EXTRACTED}/By_Date/
- curl localhost/views.php?view=Species%20Stats &>/dev/null
+ curl localhost/views.php?view=Species%20Stats &>/dev/null
filestodelete=$(($(find ${EXTRACTED}/By_Date/* -type f | wc -l) / $(find ${EXTRACTED}/By_Date/* -maxdepth 0 -type d | wc -l)))
iter=0
for i in */*/*; do