From 1b3a31c3ee77f4aaba7d48fa936e566c869ced36 Mon Sep 17 00:00:00 2001
From: jaredb7
Date: Wed, 12 Apr 2023 21:32:44 +1000
Subject: [PATCH 1/3] Allow user configurable log level option for some
services
After some services were recently quieted down by adjusting the log level for e.g ffmpeg. It would be nice if the user can easily adjust the log level again so that that they can investigate or debug a issue since output is not generated by default, so now the Livestream, Spectrogream and Birdnet Recording have a adjustable log levels to help with this.
---
scripts/advanced.php | 129 ++++++++++++++++++++++++++++++++++-
scripts/birdnet_recording.sh | 21 ++++--
scripts/livestream.sh | 11 ++-
scripts/spectrogram.sh | 11 ++-
4 files changed, 161 insertions(+), 11 deletions(-)
diff --git a/scripts/advanced.php b/scripts/advanced.php
index 03e60e9..e4a88e2 100644
--- a/scripts/advanced.php
+++ b/scripts/advanced.php
@@ -245,6 +245,55 @@ if(isset($_GET['submit'])) {
}
}
+ if (isset($_GET["LogLevel_BirdnetRecordingService"])) {
+ $birdnet_recording_service_log_level = trim($_GET["LogLevel_BirdnetRecordingService"]);
+
+ //Setting exists already, see if the value changed
+ if (strcmp($birdnet_recording_service_log_level, $config['LogLevel_BirdnetRecordingService']) !== 0) {
+ $contents = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents);
+ $contents2 = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents2);
+ $fh = fopen("/etc/birdnet/birdnet.conf", "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
+ sleep(1);
+ exec("sudo systemctl restart birdnet_recording.service");
+ }
+ }
+
+ if (isset($_GET["LogLevel_SpectrogramViewerService"])) {
+ $spectrogram_viewer_service_log_level = trim($_GET["LogLevel_SpectrogramViewerService"]);
+
+ //Setting exists already, see if the value changed
+ if (strcmp($spectrogram_viewer_service_log_level, $config['LogLevel_SpectrogramViewerService']) !== 0) {
+ $contents = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents);
+ $contents2 = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents2);
+ $fh = fopen("/etc/birdnet/birdnet.conf", "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
+ sleep(1);
+ exec("sudo systemctl restart spectrogram_viewer.service");
+ }
+ }
+
+ if (isset($_GET["LogLevel_LiveAudioStreamService"])) {
+ $livestream_audio_service_log_level = trim($_GET["LogLevel_LiveAudioStreamService"]);
+
+ //Setting exists already, see if the value changed
+ if (strcmp($livestream_audio_service_log_level, $config['LogLevel_LiveAudioStreamService']) !== 0) {
+ $contents = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents);
+ $contents2 = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents2);
+ $fh = fopen("/etc/birdnet/birdnet.conf", "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
+ sleep(1);
+ exec("sudo systemctl restart livestream.service && sudo systemctl restart icecast2.service");
+ }
+ }
+
+
$fh = fopen('/etc/birdnet/birdnet.conf', "w");
$fh2 = fopen("./scripts/thisrun.txt", "w");
fwrite($fh, $contents);
@@ -505,7 +554,85 @@ foreach($formats as $format){
-
+
+
+
+
+ Logging
+
+
Note:
+ It is recommended that the Log Level be set to Error on production systems to keep output
+ manageable by only reporting errors.
+
+ Not all components support the log level option at this time.
+
+
+
+
+ Birdnet Recording:
+
+ >
+ Errors Only
+
+ >
+ Warning
+
+ >
+ Info
+
+ >
+ Debug
+
+
+
+
+
+ Live Audio Stream:
+
+ >
+ Errors Only
+
+ >
+ Warning
+
+ >
+ Info
+
+ >
+ Debug
+
+
+
+
+
+ Spectrogram Service:
+
+ >
+ Errors Only
+
+ >
+ Warning
+
+ >
+ Info
+
+ >
+ Debug
+
+
+
+
+
+
+
+ 'error' - Show all errors, including ones which can be recovered from. This is the default value.
+ 'warning' - Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
+ 'info' - Show informative messages and output during processing. This is in addition to warnings and errors.
+ 'debug' - Show everything, including debugging information.
+
+
+
+
diff --git a/scripts/birdnet_recording.sh b/scripts/birdnet_recording.sh
index 9f98379..bda6303 100755
--- a/scripts/birdnet_recording.sh
+++ b/scripts/birdnet_recording.sh
@@ -1,10 +1,16 @@
#!/usr/bin/env bash
# Performs the recording from the specified RTSP stream or soundcard
-#set -x
source /etc/birdnet/birdnet.conf
-# Set the logging level
-LOGGING_LEVEL='error'
+# Read the logging level from the configuration option
+LOGGING_LEVEL="${LogLevel_BirdnetRecordingService}"
+# If empty for some reason default to log level of error
+[ -z $LOGGING_LEVEL ] && LOGGING_LEVEL='error'
+# Additionally if we're at debug or info level then allow printing of script commands and variables
+if [ "$LOGGING_LEVEL" == "info" ] || [ "$LOGGING_LEVEL" == "debug" ];then
+ # Enable printing of commands/variables etc to terminal for debugging
+ set -x
+fi
[ -z $RECORDING_LENGTH ] && RECORDING_LENGTH=15
@@ -26,15 +32,16 @@ if [ ! -z $RTSP_STREAM ];then
# Loop over the streams
for i in "${RTSP_STREAMS_EXPLODED_ARRAY[@]}"
do
- # Map id used to map input to output, this is 0 based in ffmpeg decrement
+ # Map id used to map input to output (first stream being 0), this is 0 based in ffmpeg so decrement our counter (which is more human readable) by 1
MAP_ID=$((RTSP_STREAMS_STARTED_COUNT-1))
- # Build up the parameters to process the RSTP stream, including mapping for the output
+ # Build up the parameters to process the RSTP stream, including mapping for the output, because some streams may have more than one audio stream within it, get the first stream
+ #ffmpeg does this by default when there is only 1 steam, but if there are more than 1 then it doesn't know which one we want
FFMPEG_PARAMS+="-vn -thread_queue_size 512 -i ${i} -map ${MAP_ID} -t ${RECORDING_LENGTH} -acodec pcm_s16le -ac 2 -ar 48000 file:${RECS_DIR}/StreamData/$(date "+%F")-birdnet-RTSP_${RTSP_STREAMS_STARTED_COUNT}-$(date "+%H:%M:%S").wav "
- # Increment counter
+ # Increment counter for the next round
((RTSP_STREAMS_STARTED_COUNT += 1))
done
- # Make sure were passing something valid to ffmpeg, ffmpeg will run interactive and control our look by waiting ${RECORDING_LENGTH} between loops
+ # Make sure were passing something valid to ffmpeg, ffmpeg will run interactive and control our loop by waiting ${RECORDING_LENGTH} between loops because it will stop once that much has been recorded
if [ -n "$FFMPEG_PARAMS" ];then
ffmpeg -hide_banner -loglevel $LOGGING_LEVEL -nostdin $FFMPEG_PARAMS
fi
diff --git a/scripts/livestream.sh b/scripts/livestream.sh
index cfde718..b402bbc 100755
--- a/scripts/livestream.sh
+++ b/scripts/livestream.sh
@@ -2,8 +2,15 @@
# Live Audio Stream Service Script
source /etc/birdnet/birdnet.conf
-# Set logging level
-LOGGING_LEVEL='error'
+# Read the logging level from the configuration option
+LOGGING_LEVEL="${LogLevel_LiveAudioStreamService}"
+# If empty for some reason default to log level of error
+[ -z $LOGGING_LEVEL ] && LOGGING_LEVEL='error'
+# Additionally if we're at debug or info level then allow printing of script commands and variables
+if [ "$LOGGING_LEVEL" == "info" ] || [ "$LOGGING_LEVEL" == "debug" ];then
+ # Enable printing of commands/variables etc to terminal for debugging
+ set -x
+fi
if [ -z ${REC_CARD} ];then
echo "Stream not supported"
diff --git a/scripts/spectrogram.sh b/scripts/spectrogram.sh
index 9e96bc1..fe5ec7a 100755
--- a/scripts/spectrogram.sh
+++ b/scripts/spectrogram.sh
@@ -1,8 +1,17 @@
#!/usr/bin/env bash
-# set -x
# Make sox spectrogram
source /etc/birdnet/birdnet.conf
+# Read the logging level from the configuration option
+LOGGING_LEVEL="${LogLevel_SpectrogramViewerService}"
+# If empty for some reason default to log level of error
+[ -z $LOGGING_LEVEL ] && LOGGING_LEVEL='error'
+# Additionally if we're at debug or info level then allow printing of script commands and variables
+if [ "$LOGGING_LEVEL" == "info" ] || [ "$LOGGING_LEVEL" == "debug" ];then
+ # Enable printing of commands/variables etc to terminal for debugging
+ set -x
+fi
+
# Time to sleep between generating spectrogram's, default set the recording length
# To try catch the spectrogram as soon as possible run at a smaller intervals
SLEEP_DELAY=$((RECORDING_LENGTH / 4))
From fa5662fa006904d3a0c71f4851eaea79ddaf568e Mon Sep 17 00:00:00 2001
From: jaredb7
Date: Thu, 13 Apr 2023 22:42:01 +1000
Subject: [PATCH 2/3] Update Birdnet Snipper to insert out new setting options
Update Birdnet Snipper to insert out new setting options
Update log level descriptions.
---
scripts/advanced.php | 6 +++---
scripts/update_birdnet_snippets.sh | 12 ++++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/scripts/advanced.php b/scripts/advanced.php
index e4a88e2..5e1799c 100644
--- a/scripts/advanced.php
+++ b/scripts/advanced.php
@@ -560,7 +560,7 @@ foreach($formats as $format){
Logging
-
Note:
+ Note:
It is recommended that the Log Level be set to Error on production systems to keep output
manageable by only reporting errors.
@@ -627,8 +627,8 @@ foreach($formats as $format){
'error' - Show all errors, including ones which can be recovered from. This is the default value.
'warning' - Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
- 'info' - Show informative messages and output during processing. This is in addition to warnings and errors.
- 'debug' - Show everything, including debugging information.
+ 'info' - Show informative messages and output during processing. This is in addition to warnings and errors. This will produce more output, use this for initial debugging.
+ 'debug' - Show everything, including debugging information. Produces a lot of output.
diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh
index 1d03b0b..00dea4f 100755
--- a/scripts/update_birdnet_snippets.sh
+++ b/scripts/update_birdnet_snippets.sh
@@ -191,6 +191,18 @@ if ! grep RTSP_STREAM_TO_LIVESTREAM /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "RTSP_STREAM_TO_LIVESTREAM=\"0\"" >> /etc/birdnet/birdnet.conf
fi
+# For new Advanced Setting Logging level options,
+if ! grep LogLevel_BirdnetRecordingService /etc/birdnet/birdnet.conf &>/dev/null;then
+ sudo -u$USER echo "LogLevel_BirdnetRecordingService=\"error\"" >> /etc/birdnet/birdnet.conf
+fi
+
+if ! grep LogLevel_LiveAudioStreamService /etc/birdnet/birdnet.conf &>/dev/null;then
+ sudo -u$USER echo "LogLevel_LiveAudioStreamService=\"error\"" >> /etc/birdnet/birdnet.conf
+fi
+
+if ! grep LogLevel_SpectrogramViewerService /etc/birdnet/birdnet.conf &>/dev/null;then
+ sudo -u$USER echo "LogLevel_SpectrogramViewerService=\"error\"" >> /etc/birdnet/birdnet.conf
+fi
sudo systemctl daemon-reload
restart_services.sh
From e7e2ec472c0326059644f6ffeb8d6c44b35eeaca Mon Sep 17 00:00:00 2001
From: jaredb7
Date: Wed, 19 Apr 2023 21:01:09 +1000
Subject: [PATCH 3/3] Incert the LogLevel_ into the config file is they don't
exisst
Update the saving of the LogLevel_ settings to create the setting in the config file if it doesn't exist at the time of saving, the setting is created with the chosen value.
Moves the RTSP javascript code into it's script tag and moved it be near the controls for the RTSP URL.
---
scripts/advanced.php | 251 ++++++++++++++++++++++++++-----------------
1 file changed, 151 insertions(+), 100 deletions(-)
diff --git a/scripts/advanced.php b/scripts/advanced.php
index 5e1799c..ae46ac3 100644
--- a/scripts/advanced.php
+++ b/scripts/advanced.php
@@ -245,59 +245,106 @@ if(isset($_GET['submit'])) {
}
}
- if (isset($_GET["LogLevel_BirdnetRecordingService"])) {
- $birdnet_recording_service_log_level = trim($_GET["LogLevel_BirdnetRecordingService"]);
+ if (isset($_GET["LogLevel_BirdnetRecordingService"])) {
+ $birdnet_recording_service_log_level = trim($_GET["LogLevel_BirdnetRecordingService"]);
- //Setting exists already, see if the value changed
- if (strcmp($birdnet_recording_service_log_level, $config['LogLevel_BirdnetRecordingService']) !== 0) {
- $contents = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents);
- $contents2 = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents2);
- $fh = fopen("/etc/birdnet/birdnet.conf", "w");
- $fh2 = fopen("./scripts/thisrun.txt", "w");
- fwrite($fh, $contents);
- fwrite($fh2, $contents2);
- sleep(1);
- exec("sudo systemctl restart birdnet_recording.service");
+ //If setting exists change it's value
+ if (array_key_exists('LogLevel_BirdnetRecordingService', $config)) {
+ //Setting exists already, see if the value changed
+ if (strcmp($birdnet_recording_service_log_level, $config['LogLevel_BirdnetRecordingService']) !== 0) {
+ $contents = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents);
+ $contents2 = preg_replace("/LogLevel_BirdnetRecordingService=.*/", "LogLevel_BirdnetRecordingService=\"$birdnet_recording_service_log_level\"", $contents2);
+ $fh = fopen("/etc/birdnet/birdnet.conf", "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
+ sleep(1);
+ exec("sudo systemctl restart birdnet_recording.service");
+ }
+ } else {
+ //Create the setting in the setting file - same as what update_birdnet_snippets.sh does but will take the users selected log level as the value
+ shell_exec('sudo echo "LogLevel_BirdnetRecordingService=\"' . $birdnet_recording_service_log_level . '\"" >> /etc/birdnet/birdnet.conf');
+ //also update this run txt file
+ shell_exec('sudo echo "LogLevel_BirdnetRecordingService=\"' . $birdnet_recording_service_log_level . '\"" >> ./scripts/thisrun.txt');
+
+ //Reload the config files as we've changed the contents, we need to make sure the contents of the existing variables reflects contents of the config file
+ sleep(1);
+ $contents = file_get_contents('/etc/birdnet/birdnet.conf');
+ $contents2 = file_get_contents('./scripts/thisrun.txt');
+
+ exec("sudo systemctl restart birdnet_recording.service");
+ }
}
- }
- if (isset($_GET["LogLevel_SpectrogramViewerService"])) {
- $spectrogram_viewer_service_log_level = trim($_GET["LogLevel_SpectrogramViewerService"]);
+ if (isset($_GET["LogLevel_SpectrogramViewerService"])) {
+ $spectrogram_viewer_service_log_level = trim($_GET["LogLevel_SpectrogramViewerService"]);
- //Setting exists already, see if the value changed
- if (strcmp($spectrogram_viewer_service_log_level, $config['LogLevel_SpectrogramViewerService']) !== 0) {
- $contents = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents);
- $contents2 = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents2);
- $fh = fopen("/etc/birdnet/birdnet.conf", "w");
- $fh2 = fopen("./scripts/thisrun.txt", "w");
- fwrite($fh, $contents);
- fwrite($fh2, $contents2);
- sleep(1);
- exec("sudo systemctl restart spectrogram_viewer.service");
+ //If setting exists change it's value
+ if (array_key_exists('LogLevel_SpectrogramViewerService', $config)) {
+ //Setting exists already, see if the value changed
+ if (strcmp($spectrogram_viewer_service_log_level, $config['LogLevel_SpectrogramViewerService']) !== 0) {
+ $contents = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents);
+ $contents2 = preg_replace("/LogLevel_SpectrogramViewerService=.*/", "LogLevel_SpectrogramViewerService=\"$spectrogram_viewer_service_log_level\"", $contents2);
+ $fh = fopen("/etc/birdnet/birdnet.conf", "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
+ sleep(1);
+ exec("sudo systemctl restart spectrogram_viewer.service");
+ }
+ } else {
+ //Create the setting in the setting file - same as what update_birdnet_snippets.sh does but will take the users selected log level as the value
+ shell_exec('sudo echo "LogLevel_SpectrogramViewerService=\"' . $spectrogram_viewer_service_log_level . '\"" >> /etc/birdnet/birdnet.conf');
+ //also update this run txt file
+ shell_exec('sudo echo "LogLevel_SpectrogramViewerService=\"' . $spectrogram_viewer_service_log_level . '\"" >> ./scripts/thisrun.txt');
+
+ //Reload the config files as we've changed the contents, we need to make sure the contents of the existing variables reflects contents of the config file
+ sleep(1);
+ $contents = file_get_contents('/etc/birdnet/birdnet.conf');
+ $contents2 = file_get_contents('./scripts/thisrun.txt');
+
+ exec("sudo systemctl restart spectrogram_viewer.service");
+ }
}
- }
- if (isset($_GET["LogLevel_LiveAudioStreamService"])) {
- $livestream_audio_service_log_level = trim($_GET["LogLevel_LiveAudioStreamService"]);
+ if (isset($_GET["LogLevel_LiveAudioStreamService"])) {
+ $livestream_audio_service_log_level = trim($_GET["LogLevel_LiveAudioStreamService"]);
- //Setting exists already, see if the value changed
- if (strcmp($livestream_audio_service_log_level, $config['LogLevel_LiveAudioStreamService']) !== 0) {
- $contents = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents);
- $contents2 = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents2);
- $fh = fopen("/etc/birdnet/birdnet.conf", "w");
- $fh2 = fopen("./scripts/thisrun.txt", "w");
- fwrite($fh, $contents);
- fwrite($fh2, $contents2);
- sleep(1);
- exec("sudo systemctl restart livestream.service && sudo systemctl restart icecast2.service");
+ //If setting exists change it's value
+ if (array_key_exists('LogLevel_LiveAudioStreamService', $config)) {
+ //Setting exists already, see if the value changed
+ if (strcmp($livestream_audio_service_log_level, $config['LogLevel_LiveAudioStreamService']) !== 0) {
+ $contents = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents);
+ $contents2 = preg_replace("/LogLevel_LiveAudioStreamService=.*/", "LogLevel_LiveAudioStreamService=\"$livestream_audio_service_log_level\"", $contents2);
+ //Write the settings to the config files, so we can restart the relevant services
+ $fh = fopen("/etc/birdnet/birdnet.conf", "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
+ sleep(1);
+ exec("sudo systemctl restart livestream.service && sudo systemctl restart icecast2.service");
+ }
+ } else {
+ //Create the setting in the setting file - same as what update_birdnet_snippets.sh does but will take the users selected log level as the value
+ shell_exec('sudo echo "LogLevel_LiveAudioStreamService=\"' . $livestream_audio_service_log_level . '\"" >> /etc/birdnet/birdnet.conf');
+ //also update this run txt file
+ shell_exec('sudo echo "LogLevel_LiveAudioStreamService=\"' . $livestream_audio_service_log_level . '\"" >> ./scripts/thisrun.txt');
+
+ //Reload the config files as we've changed the contents, we need to make sure the contents of the existing variables reflects contents of the config file
+ sleep(1);
+ $contents = file_get_contents('/etc/birdnet/birdnet.conf');
+ $contents2 = file_get_contents('./scripts/thisrun.txt');
+
+ exec("sudo systemctl restart livestream.service && sudo systemctl restart icecast2.service");
+ }
}
- }
-
- $fh = fopen('/etc/birdnet/birdnet.conf', "w");
- $fh2 = fopen("./scripts/thisrun.txt", "w");
- fwrite($fh, $contents);
- fwrite($fh2, $contents2);
+ //Finally write the data out. some sections do this themselves in order to have the new settings ready for the services that will be restarted
+ //but will doubly ensure the settings are saved after any modification
+ $fh = fopen('/etc/birdnet/birdnet.conf', "w");
+ $fh2 = fopen("./scripts/thisrun.txt", "w");
+ fwrite($fh, $contents);
+ fwrite($fh2, $contents2);
}
$user = trim(shell_exec("awk -F: '/1000/{print $1}' /etc/passwd"));
@@ -337,57 +384,6 @@ if (file_exists('./scripts/thisrun.txt')) {
output.innerHTML = this.value;
document.getElementById("predictionCount").innerHTML = parseInt((this.value * )/100);
}
- //Keep track of how many new input fields were added
- var number_of_new_rtsp_urls_added = 0;
- //Function to insert new input fields
- function addNewrtspInput() {
- //Find the placeholder input field
- var url_template_element = document.getElementById('rtsp_stream_url_placeholder');
- var new_url_input_template = url_template_element.cloneNode();
- var br_seperator = document.createElement("BR");
-
- //Fix up the new element so it's visible, set the style so it's sligned correctly
- new_url_input_template.setAttribute("id", "rtsp_stream_url_new_" + number_of_new_rtsp_urls_added);
- new_url_input_template.setAttribute("name", "rtsp_stream_new_" + number_of_new_rtsp_urls_added);
- new_url_input_template.removeAttribute("style");
-
- //Insert the new input field before the button to add new urls
- var newrtspstream_button = document.getElementById('newrtspstream_button_container');
- //Insert the new input element before the newrtspstream button
- newrtspstream_button.parentNode.insertBefore(new_url_input_template, newrtspstream_button);
- //Add a separator before the button
- newrtspstream_button.parentNode.insertBefore(br_seperator, newrtspstream_button);
-
- //Increment the counter
- number_of_new_rtsp_urls_added++;
- }
-
- var rtsp_stream_string = "";
- var rtsp_stream_string_array = [];
- //Collect all the rtsp urls that have been set, concat them into a single string and set it into the rtsp_stream input field so it gets saved
- function collectrtspUrls() {
- //Reset the array and string so we don't get duplicates
- rtsp_stream_string = "";
- rtsp_stream_string_array = [];
-
- //Get the inputs by name (which is similar across
- var existing_rtsp_stream_urls = document.querySelectorAll('[name^="rtsp_stream_"]');
- //Loop over the result and get the values
- for (let i = 0; i < existing_rtsp_stream_urls.length; i++) {
- //Only collect results that re not empty and add them to the array
- if (existing_rtsp_stream_urls[i].value !== 'undefined' && existing_rtsp_stream_urls[i].value !== "") {
- rtsp_stream_string_array.push(existing_rtsp_stream_urls[i].value.trim());
- }
- }
-
- //if the array is not empty, then implode the array joining all the values by a comma
- if (rtsp_stream_string_array.length !== 0) {
- rtsp_stream_string = rtsp_stream_string_array.join(',');
- //Locate the hidden rtsp_stream input field that we'll populate with the full string which will get saved to the config file
- var rtsp_stream_input = document.querySelector('[name=rtsp_stream]');
- rtsp_stream_input.setAttribute('value',rtsp_stream_string);
- }
- }
If a Human is predicted anywhere among the top predictions, the sample will be considered of human origin and no data will be collected. Start with 1% and move up as needed.
@@ -457,6 +453,61 @@ foreach($formats as $format){
Add
+
If you place an RTSP stream URL here, BirdNET-Pi will use that as its audio source. Multiple streams are allowed but may have a impact on rPi performance. Analyze ffmpeg CPU/Memory usage with top or htop if necessary. To remove all and use the soundcard again, just delete the RTSP entries and click Save at the bottom.
@@ -562,7 +613,7 @@ foreach($formats as $format){
Note:
It is recommended that the Log Level be set to Error on production systems to keep output
- manageable by only reporting errors.
+ manageable, by only reporting errors.
Not all components support the log level option at this time.
@@ -571,7 +622,7 @@ foreach($formats as $format){
Birdnet Recording:
- >
+ >
Errors Only
>
@@ -589,7 +640,7 @@ foreach($formats as $format){
Live Audio Stream:
- >
+ >
Errors Only
>
@@ -607,7 +658,7 @@ foreach($formats as $format){
Spectrogram Service:
- >
+ >
Errors Only
>
@@ -625,7 +676,7 @@ foreach($formats as $format){
- 'error' - Show all errors, including ones which can be recovered from. This is the default value.
+ 'error' - Show all errors, including ones which can be recovered from. This is the default value.
'warning' - Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
'info' - Show informative messages and output during processing. This is in addition to warnings and errors. This will produce more output, use this for initial debugging.
'debug' - Show everything, including debugging information. Produces a lot of output.