diff --git a/scripts/advanced.php b/scripts/advanced.php index 4a60f71..204dd0a 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -65,7 +65,7 @@ if(isset($_GET['submit'])) { } if(isset($_GET["rtsp_stream"])) { - $rtsp_stream = $_GET["rtsp_stream"]; + $rtsp_stream = str_replace("\r\n", ",", $_GET["rtsp_stream"]); if(strcmp($rtsp_stream,$config['RTSP_STREAM']) !== 0) { $contents = preg_replace("/RTSP_STREAM=.*/", "RTSP_STREAM=$rtsp_stream", $contents); $contents2 = preg_replace("/RTSP_STREAM=.*/", "RTSP_STREAM=$rtsp_stream", $contents2); @@ -76,7 +76,7 @@ if(isset($_GET['submit'])) { exec('sudo systemctl restart birdnet_recording.service'); } } - + if(isset($_GET["overlap"])) { $overlap = $_GET["overlap"]; if(strcmp($overlap,$config['OVERLAP']) !== 0) { @@ -121,14 +121,14 @@ if(isset($_GET['submit'])) { $contents2 = preg_replace("/PRIVACY_MODE=.*/", "PRIVACY_MODE=$privacy_mode", $contents2); if(strcmp($privacy_mode,"on") == 0) { exec('sudo sed -i \'s/\/usr\/local\/bin\/server.py/\/usr\/local\/bin\/privacy_server.py/g\' ../../BirdNET-Pi/templates/birdnet_server.service'); - exec('sudo systemctl daemon-reload'); - exec('restart_services.sh'); - header('Location: /log'); + exec('sudo systemctl daemon-reload'); + exec('restart_services.sh'); + header('Location: /log'); } elseif(strcmp($privacy_mode,"off") == 0) { exec('sudo sed -i \'s/\/usr\/local\/bin\/privacy_server.py/\/usr\/local\/bin\/server.py/g\' ../../BirdNET-Pi/templates/birdnet_server.service'); - exec('sudo systemctl daemon-reload'); - exec('restart_services.sh'); - header('Location: /log'); + exec('sudo systemctl daemon-reload'); + exec('restart_services.sh'); + header('Location: /log'); } } } @@ -215,7 +215,7 @@ if (file_exists('./scripts/thisrun.txt')) {

Set Channels to the number of channels supported by your sound card. 32 max.

-
+

If you place an RTSP stream URL here, BirdNET-Pi will use that as its audio source.


diff --git a/scripts/birdnet_recording.sh b/scripts/birdnet_recording.sh index 1f1cd8d..ccd1024 100755 --- a/scripts/birdnet_recording.sh +++ b/scripts/birdnet_recording.sh @@ -6,7 +6,9 @@ source /etc/birdnet/birdnet.conf if [ ! -z $RTSP_STREAM ];then while true;do - ffmpeg -i $RTSP_STREAM -t 15 -vn -acodec pcm_s16le -ac 2 -ar 48000 file:${RECS_DIR}/$(date "+%F")-birdnet-$(date "+%H:%M:%S").wav + for i in ${RTSP_STREAM//,/ };do + ffmpeg -i ${i} -t 15 -vn -acodec pcm_s16le -ac 2 -ar 48000 file:${RECS_DIR}/$(date "+%F")-birdnet-$(date "+%H:%M:%S").wav /dev/null 2>&1 & sleep 1; + done done else if ! pulseaudio --check;then pulseaudio --start;fi