$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.csv files if (stripos($stream_file_name, 'RTSP_' . $RTSP_STREAM_LISTENED_TO) !== false && stripos($stream_file_name, '.wav.json') !== 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(); } $contents = file_get_contents($look_in_directory . $newest_file); if ($contents !== false) { $json = json_decode($contents); if ($json != null) { $datetime = DateTime::createFromFormat(DateTime::ISO8601, $json->{'timestamp'}); $now = new DateTime(); $interval = $now->diff($datetime); $json->delay = $interval->format('%s'); echo json_encode($json); } } //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...