You cannot edit the settings for this installation'; exit; } else { $submittedpwd = $_SERVER['PHP_AUTH_PW']; $submitteduser = $_SERVER['PHP_AUTH_USER']; if($submittedpwd !== $caddypwd || $submitteduser !== 'birdnet'){ header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo '
You cannot edit the settings for this installation
'; exit; } } if(isset($_GET['submit'])) { $contents = file_get_contents('/etc/birdnet/birdnet.conf'); $contents2 = file_get_contents('./scripts/thisrun.txt'); if(isset($_GET["caddy_pwd"])) { $caddy_pwd = $_GET["caddy_pwd"]; if(strcmp($caddy_pwd,$config['CADDY_PWD']) !== 0) { $contents = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=\"$caddy_pwd\"", $contents); $contents2 = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=\"$caddy_pwd\"", $contents2); $fh = fopen('/etc/birdnet/birdnet.conf', "w"); $fh2 = fopen("./scripts/thisrun.txt", "w"); fwrite($fh, $contents); fwrite($fh2, $contents2); exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); } } if(isset($_GET["ice_pwd"])) { $ice_pwd = $_GET["ice_pwd"]; if(strcmp($ice_pwd,$config['ICE_PWD']) !== 0) { $contents = preg_replace("/ICE_PWD=.*/", "ICE_PWD=$ice_pwd", $contents); $contents2 = preg_replace("/ICE_PWD=.*/", "ICE_PWD=$ice_pwd", $contents2); } } if(isset($_GET["birdnetpi_url"])) { $birdnetpi_url = $_GET["birdnetpi_url"]; if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) { $contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents); $contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2); $fh = fopen('/etc/birdnet/birdnet.conf', "w"); $fh2 = fopen("./scripts/thisrun.txt", "w"); fwrite($fh, $contents); fwrite($fh2, $contents2); exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); } } if(isset($_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); $fh = fopen('/etc/birdnet/birdnet.conf', "w"); $fh2 = fopen("./scripts/thisrun.txt", "w"); fwrite($fh, $contents); fwrite($fh2, $contents2); exec('sudo systemctl restart birdnet_recording.service'); exec('sudo systemctl restart livestream.service'); } } if (isset($_GET["rtsp_stream_to_livestream"])) { $rtsp_stream_selected = trim($_GET["rtsp_stream_to_livestream"]); //Setting exists already, see if the value changed if (strcmp($rtsp_stream_selected, $config['RTSP_STREAM_TO_LIVESTREAM']) !== 0) { $contents = preg_replace("/RTSP_STREAM_TO_LIVESTREAM=.*/", "RTSP_STREAM_TO_LIVESTREAM=\"$rtsp_stream_selected\"", $contents); $contents2 = preg_replace("/RTSP_STREAM_TO_LIVESTREAM=.*/", "RTSP_STREAM_TO_LIVESTREAM=\"$rtsp_stream_selected\"", $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"); } } if(isset($_GET["overlap"])) { $overlap = $_GET["overlap"]; if(strcmp($overlap,$config['OVERLAP']) !== 0) { $contents = preg_replace("/OVERLAP=.*/", "OVERLAP=$overlap", $contents); $contents2 = preg_replace("/OVERLAP=.*/", "OVERLAP=$overlap", $contents2); } } if(isset($_GET["confidence"])) { $confidence = $_GET["confidence"]; if(strcmp($confidence,$config['CONFIDENCE']) !== 0) { $contents = preg_replace("/CONFIDENCE=.*/", "CONFIDENCE=$confidence", $contents); $contents2 = preg_replace("/CONFIDENCE=.*/", "CONFIDENCE=$confidence", $contents2); } } if(isset($_GET["sensitivity"])) { $sensitivity = $_GET["sensitivity"]; if(strcmp($sensitivity,$config['SENSITIVITY']) !== 0) { $contents = preg_replace("/SENSITIVITY=.*/", "SENSITIVITY=$sensitivity", $contents); $contents2 = preg_replace("/SENSITIVITY=.*/", "SENSITIVITY=$sensitivity", $contents2); } } if(isset($_GET["freqshift_hi"]) && is_numeric($_GET['freqshift_hi'])) { $freqshift_hi = $_GET["freqshift_hi"]; if(strcmp($freqshift_hi,$config['FREQSHIFT_HI']) !== 0) { $contents = preg_replace("/FREQSHIFT_HI=.*/", "FREQSHIFT_HI=$freqshift_hi", $contents); $contents2 = preg_replace("/FREQSHIFT_HI=.*/", "FREQSHIFT_HI=$freqshift_hi", $contents2); } } if(isset($_GET["freqshift_lo"]) && is_numeric($_GET['freqshift_lo'])) { $freqshift_lo = $_GET["freqshift_lo"]; if(strcmp($freqshift_lo,$config['FREQSHIFT_LO']) !== 0) { $contents = preg_replace("/FREQSHIFT_LO=.*/", "FREQSHIFT_LO=$freqshift_lo", $contents); $contents2 = preg_replace("/FREQSHIFT_LO=.*/", "FREQSHIFT_LO=$freqshift_lo", $contents2); } } if(isset($_GET["freqshift_pitch"]) && is_numeric($_GET['freqshift_pitch'])) { $freqshift_pitch = $_GET["freqshift_pitch"]; if(strcmp($freqshift_pitch,$config['FREQSHIFT_PITCH']) !== 0) { $contents = preg_replace("/FREQSHIFT_PITCH=.*/", "FREQSHIFT_PITCH=$freqshift_pitch", $contents); $contents2 = preg_replace("/FREQSHIFT_PITCH=.*/", "FREQSHIFT_PITCH=$freqshift_pitch", $contents2); } } if(isset($_GET["freqshift_tool"])) { $freqshift_tool = $_GET["freqshift_tool"]; if(strcmp($freqshift_tool,$config['FREQSHIFT_TOOL']) !== 0) { $contents = preg_replace("/FREQSHIFT_TOOL=.*/", "FREQSHIFT_TOOL=$freqshift_tool", $contents); $contents2 = preg_replace("/FREQSHIFT_TOOL=.*/", "FREQSHIFT_TOOL=$freqshift_tool", $contents2); } } if(isset($_GET["full_disk"])) { $full_disk = $_GET["full_disk"]; if(strcmp($full_disk,$config['FULL_DISK']) !== 0) { $contents = preg_replace("/FULL_DISK=.*/", "FULL_DISK=$full_disk", $contents); $contents2 = preg_replace("/FULL_DISK=.*/", "FULL_DISK=$full_disk", $contents2); } } if(isset($_GET["privacy_threshold"])) { $privacy_threshold = $_GET["privacy_threshold"]; if(strcmp($privacy_threshold,$config['PRIVACY_THRESHOLD']) !== 0) { $contents = preg_replace("/PRIVACY_THRESHOLD=.*/", "PRIVACY_THRESHOLD=$privacy_threshold", $contents); $contents2 = preg_replace("/PRIVACY_THRESHOLD=.*/", "PRIVACY_THRESHOLD=$privacy_threshold", $contents2); exec('restart_services.sh'); } } if(isset($_GET["rec_card"])) { $rec_card = $_GET["rec_card"]; if(strcmp($rec_card,$config['REC_CARD']) !== 0) { $contents = preg_replace("/REC_CARD=.*/", "REC_CARD=\"$rec_card\"", $contents); $contents2 = preg_replace("/REC_CARD=.*/", "REC_CARD=\"$rec_card\"", $contents2); } } if(isset($_GET["channels"])) { $channels = $_GET["channels"]; if(strcmp($channels,$config['CHANNELS']) !== 0) { $contents = preg_replace("/CHANNELS=.*/", "CHANNELS=$channels", $contents); $contents2 = preg_replace("/CHANNELS=.*/", "CHANNELS=$channels", $contents2); } } if(isset($_GET["recording_length"])) { $recording_length = $_GET["recording_length"]; if(strcmp($recording_length,$config['RECORDING_LENGTH']) !== 0) { $contents = preg_replace("/RECORDING_LENGTH=.*/", "RECORDING_LENGTH=$recording_length", $contents); $contents2 = preg_replace("/RECORDING_LENGTH=.*/", "RECORDING_LENGTH=$recording_length", $contents2); } } if(isset($_GET["extraction_length"])) { $extraction_length = $_GET["extraction_length"]; if(strcmp($extraction_length,$config['EXTRACTION_LENGTH']) !== 0) { $contents = preg_replace("/EXTRACTION_LENGTH=.*/", "EXTRACTION_LENGTH=$extraction_length", $contents); $contents2 = preg_replace("/EXTRACTION_LENGTH=.*/", "EXTRACTION_LENGTH=$extraction_length", $contents2); } } if(isset($_GET["audiofmt"])) { $audiofmt = $_GET["audiofmt"]; if(strcmp($audiofmt,$config['AUDIOFMT']) !== 0) { $contents = preg_replace("/AUDIOFMT=.*/", "AUDIOFMT=$audiofmt", $contents); $contents2 = preg_replace("/AUDIOFMT=.*/", "AUDIOFMT=$audiofmt", $contents2); } } if(isset($_GET["silence_update_indicator"])) { $silence_update_indicator = 1; if(strcmp($silence_update_indicator,$config['SILENCE_UPDATE_INDICATOR']) !== 0) { $contents = preg_replace("/SILENCE_UPDATE_INDICATOR=.*/", "SILENCE_UPDATE_INDICATOR=$silence_update_indicator", $contents); $contents2 = preg_replace("/SILENCE_UPDATE_INDICATOR=.*/", "SILENCE_UPDATE_INDICATOR=$silence_update_indicator", $contents2); } } else { $contents = preg_replace("/SILENCE_UPDATE_INDICATOR=.*/", "SILENCE_UPDATE_INDICATOR=0", $contents); $contents2 = preg_replace("/SILENCE_UPDATE_INDICATOR=.*/", "SILENCE_UPDATE_INDICATOR=0", $contents2); } if(isset($_GET["raw_spectrogram"])) { $raw_spectrogram = 1; if(strcmp($RAW_SPECTROGRAM,$config['RAW_SPECTROGRAM']) !== 0) { $contents = preg_replace("/RAW_SPECTROGRAM=.*/", "RAW_SPECTROGRAM=$raw_spectrogram", $contents); $contents2 = preg_replace("/RAW_SPECTROGRAM=.*/", "RAW_SPECTROGRAM=$raw_spectrogram", $contents2); } } else { $contents = preg_replace("/RAW_SPECTROGRAM=.*/", "RAW_SPECTROGRAM=0", $contents); $contents2 = preg_replace("/RAW_SPECTROGRAM=.*/", "RAW_SPECTROGRAM=0", $contents2); } if(isset($_GET["custom_image"])) { $custom_image = $_GET["custom_image"]; if(strcmp($custom_image,$config['CUSTOM_IMAGE']) !== 0) { $contents = preg_replace("/CUSTOM_IMAGE=.*/", "CUSTOM_IMAGE=$custom_image", $contents); $contents2 = preg_replace("/CUSTOM_IMAGE=.*/", "CUSTOM_IMAGE=$custom_image", $contents2); } } if(isset($_GET["custom_image_label"])) { $custom_image_label = $_GET["custom_image_label"]; if(strcmp($custom_image_label,$config['CUSTOM_IMAGE_TITLE']) !== 0) { $contents = preg_replace("/CUSTOM_IMAGE_TITLE=.*/", "CUSTOM_IMAGE_TITLE=\"$custom_image_label\"", $contents); $contents2 = preg_replace("/CUSTOM_IMAGE_TITLE=.*/", "CUSTOM_IMAGE_TITLE=\"$custom_image_label\"", $contents2); } } $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")); $home = trim(shell_exec("awk -F: '/1000/{print $6}' /etc/passwd")); $count_labels = count(file($home."/BirdNET-Pi/model/labels.txt")); $count = $count_labels; ?>

Advanced Settings


Value: %

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.

When the disk becomes full, you can choose to 'purge' old files to make room for new ones or 'keep' your data and stop all services instead.
Note: you can exclude specific files from 'purge' on the Recordings page.


Set Audio Card to 'default' to use PulseAudio (always recommended), or an ALSA recognized sound card device from the output of `arecord -L`. Choose the `dsnoop` device if it is available


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


$stream_url) { //For the first input keep the element mostly the same as the original but without styling to align it if ($stream_idx === 0) { ?>


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.


Set Recording Length in seconds between 6 and 60. Multiples of 3 are recommended, as BirdNET analyzes in 3-second chunks.


Set Extraction Length to something less than your Recording Length. Min=3 Max=Recording Length

BirdNET-Pi Password

This password will protect your "Tools" page and "Live Audio" stream.

show

Custom URL

When you update the URL below, the web server will reload, so be sure to wait at least 30 seconds and then go to your new URL.


The BirdNET-Pi URL is how the main page will be reached. If you want your installation to respond to an IP address, place that here, but be sure to indicate "http://".
Example for IP: http://192.168.0.109
Example if you own your own domain: https://virginia.birdnetpi.com

>

This allows you to quiet the display of how many commits your installation is behind by relative to the Github repo. This number appears next to "Tools" when you're 50 or more commits behind.

>

This allows you to remove the axes and labels of the spectrograms that are generated by Sox for each detection for a cleaner appearance.




These allow you to show a custom image on the Overview page of your BirdNET-Pi. This can be used to show a dynamically updating picture of your garden, for example.

BirdNET-Lite Settings


    Min=0.0, Max=2.9


    Min=0.01, Max=0.99


    Min=0.5, Max=1.5

Accessibility Settings

Birdsongs Frequency shifting configuration:
this can be useful for hearing impaired people. Note: audio files will only be pitch shifted when the "FREQ SHIFT" button is manually clicked for a detection on the "Recordings" page.

Choose here the shifting tool.

using ffmpeg: e.g. origin=6000, target=4000, performs a shift of 2000 Hz down.

using sox: e.g. shiftPitch=-1200 performs a shift of 1 octave down. This value is in 100ths of a semitone.