$stream_file_name) { //Skip the folder hierarchy entries if ($stream_file_name != "." && $stream_file_name != "..") { //See if the filename contains the correct RTSP name, also only check .wav files by excluding the csv files with the filter .wav.csv if (stripos($stream_file_name, 'RTSP_' . $RTSP_STREAM_LISTENED_TO) !== false && stripos($stream_file_name, '.wav.csv') === false) { //Found a match - set it as the newest file $newest_file = $stream_file_name; } } } } //If the newest file param has been supplied and it's the same as the newest file found //then stop processing if($newest_file == $_GET['newest_file']) { die(); } //Print out the filename echo "file,".$newest_file."\n"; //Print out the detected birds as CSV $row = 1; if (($handle = fopen($look_in_directory . $newest_file . ".csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { if($row != 1){ $num = count($data); for ($c=0; $c < $num; $c++) { $exp = explode(';',$data[$c]); echo (($exp[0]+$exp[1])/2).",".$exp[3].",".$exp[4]."\n"; } } $row++; } fclose($handle); } //Kill the script so no further processing or output is done die(); } //Hold the array of RTSP steams once they are exploded $RTSP_Stream_Config = array(); //Load the birdnet config so we can read the RTSP setting // Valid config data if (is_array($config) && array_key_exists('RTSP_STREAM',$config)) { if (is_null($config['RTSP_STREAM']) === false && $config['RTSP_STREAM'] !== "") { $RTSP_Stream_Config_Data = explode(",", $config['RTSP_STREAM']); //Process the stream further //we need to able to ID it (just do this by position), get the hostname to show in the dropdown box foreach ($RTSP_Stream_Config_Data as $stream_idx => $stream_url) { //$stream_idx is the array position of the the RSP stream URL, idx of 0 is the first, 1 - second etc $RTSP_stream_url = parse_url($stream_url); $RTSP_Stream_Config[$stream_idx] = $RTSP_stream_url['host']; } } } ?>
%
disabled>

Loading...