diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index 474a757..aadf6f8 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -189,7 +189,7 @@ TODAY="$RECS_DIR/$(date "+%B-%Y/%d-%A")" if [ $(find ${YESTERDAY} -name '*wav' 2>/dev/null | wc -l) -gt 0 ];then find $YESTERDAY -name '*wav' -type f -size 0 -delete run_birdnet "${YESTERDAY}" -elif [ $(find ${TODAY} -name '*wav' | wc -l) -gt 0 ];then +elif [ $(find ${TODAY} -name '*wav' 2>/dev/null | wc -l) -gt 0 ];then find $TODAY -name '*wav' -type f -size 0 -delete run_birdnet "${TODAY}" fi diff --git a/scripts/birdnet_recording.sh b/scripts/birdnet_recording.sh index dfdcefc..c8c8d78 100755 --- a/scripts/birdnet_recording.sh +++ b/scripts/birdnet_recording.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash -# Performs the recording from the specified RSTP stream or soundcard -set -x +# Performs the recording from the specified RTSP stream or soundcard +#set -x source /etc/birdnet/birdnet.conf +# S +LOGGING_LEVEL='error' + [ -z $RECORDING_LENGTH ] && RECORDING_LENGTH=15 if [ ! -z $RTSP_STREAM ];then @@ -33,7 +36,7 @@ if [ ! -z $RTSP_STREAM ];then # Make sure were passing something valid to ffmpeg, ffmpeg will run interactive and control our look by waiting ${RECORDING_LENGTH} between loops if [ -n "$FFMPEG_PARAMS" ];then - ffmpeg -nostdin $FFMPEG_PARAMS + ffmpeg -hide_banner -loglevel $LOGGING_LEVEL -nostdin $FFMPEG_PARAMS fi done diff --git a/scripts/livestream.sh b/scripts/livestream.sh index 6b0ba7e..cfde718 100755 --- a/scripts/livestream.sh +++ b/scripts/livestream.sh @@ -2,6 +2,9 @@ # Live Audio Stream Service Script source /etc/birdnet/birdnet.conf +# Set logging level +LOGGING_LEVEL='error' + if [ -z ${REC_CARD} ];then echo "Stream not supported" elif [[ ! -z ${RTSP_STREAM} ]];then @@ -22,11 +25,11 @@ elif [[ ! -z ${RTSP_STREAM} ]];then SELECTED_RSTP_STREAM=${RSTP_STREAMS_EXPLODED_ARRAY[0]} fi - ffmpeg -nostdin -loglevel 32 -ac ${CHANNELS} -i ${SELECTED_RSTP_STREAM} -acodec libmp3lame \ + ffmpeg -nostdin -loglevel $LOGGING_LEVEL -ac ${CHANNELS} -i ${SELECTED_RSTP_STREAM} -acodec libmp3lame \ -b:a 320k -ac ${CHANNELS} -content_type 'audio/mpeg' \ -f mp3 icecast://source:${ICE_PWD}@localhost:8000/stream -re else - ffmpeg -nostdin -loglevel 32 -ac ${CHANNELS} -f alsa -i ${REC_CARD} -acodec libmp3lame \ + ffmpeg -nostdin -loglevel $LOGGING_LEVEL -ac ${CHANNELS} -f alsa -i ${REC_CARD} -acodec libmp3lame \ -b:a 320k -ac ${CHANNELS} -content_type 'audio/mpeg' \ -f mp3 icecast://source:${ICE_PWD}@localhost:8000/stream -re fi