Update advanced.php

This commit is contained in:
Patrick McGuire
2022-04-25 09:11:25 -04:00
committed by GitHub
parent 737042b24b
commit ce782c4b83
+16
View File
@@ -64,6 +64,19 @@ if(isset($_GET['submit'])) {
}
}
if(isset($_GET["rtsp_stream"])) {
$rtsp_stream = $_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');
}
}
if(isset($_GET["overlap"])) {
$overlap = $_GET["overlap"];
if(strcmp($overlap,$config['OVERLAP']) !== 0) {
@@ -201,6 +214,9 @@ if (file_exists('./scripts/thisrun.txt')) {
<label for="channels">Audio Channels: </label>
<input name="channels" type="number" min="1" max="32" step="1" value="<?php print($newconfig['CHANNELS']);?>" required/><br>
<p>Set Channels to the number of channels supported by your sound card. 32 max.</p>
<label for="rtsp_stream">RTSP Stream: </label>
<input name="rtsp_stream" type="url" value="<?php print($newconfig['RTSP_STREAM']);?>" /><br>
<p>If you place an RTSP stream URL here, BirdNET-Pi will use that as its audio source.</p>
<label for="recording_length">Recording Length: </label>
<input name="recording_length" oninput="document.getElementsByName('extraction_length')[0].setAttribute('max', this.value);" type="number" min="3" max="60" step="1" value="<?php print($newconfig['RECORDING_LENGTH']);?>" required/><br>
<p>Set Recording Length in seconds between 6 and 60. Multiples of 3 are recommended, as BirdNET analyzes in 3-second chunks.</p>