From dae0ba992f2d576cc0029c8b038f10cb6370bb96 Mon Sep 17 00:00:00 2001 From: frederik Date: Wed, 4 Dec 2024 18:49:27 +0100 Subject: [PATCH] stimeout changed to timeout between ffmpeg 4 and 5 --- scripts/birdnet_recording.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/birdnet_recording.sh b/scripts/birdnet_recording.sh index 05d610b..18fd6a2 100755 --- a/scripts/birdnet_recording.sh +++ b/scripts/birdnet_recording.sh @@ -18,6 +18,7 @@ fi if [ ! -z $RTSP_STREAM ];then # Explode the RSPT steam setting into an array so we can count the number we have RTSP_STREAMS_EXPLODED_ARRAY=(${RTSP_STREAM//,/ }) + FFMPEG_VERSION=$(ffmpeg -version | head -n 1 | cut -d ' ' -f 3 | cut -d '.' -f 1) while true;do # Original loop @@ -33,7 +34,8 @@ if [ ! -z $RTSP_STREAM ];then for i in "${RTSP_STREAMS_EXPLODED_ARRAY[@]}" do if [[ "$i" == "rtsp://"* ]]; then - TIMEOUT_PARAM="-stimeout 10000000" + [ $FFMPEG_VERSION -lt 5 ] && PARAM=-stimeout || PARAM=-timeout + TIMEOUT_PARAM="$PARAM 10000000" elif [[ "$i" =~ ^[a-z]+:// ]]; then TIMEOUT_PARAM="-rw_timeout 10000000" else