Update spelling for the RTSP acronym
This commit is contained in:
@@ -8,7 +8,7 @@ source /etc/birdnet/birdnet.conf
|
|||||||
if [ ! -z $RTSP_STREAM ];then
|
if [ ! -z $RTSP_STREAM ];then
|
||||||
[ -d $RECS_DIR/StreamData ] || mkdir -p $RECS_DIR/StreamData
|
[ -d $RECS_DIR/StreamData ] || mkdir -p $RECS_DIR/StreamData
|
||||||
# Explode the RSPT steam setting into an array so we can count the number we have
|
# Explode the RSPT steam setting into an array so we can count the number we have
|
||||||
RSTP_STREAMS_EXPLODED_ARRAY=(${RTSP_STREAM//,/ })
|
RTSP_STREAMS_EXPLODED_ARRAY=(${RTSP_STREAM//,/ })
|
||||||
|
|
||||||
while true;do
|
while true;do
|
||||||
# Original loop
|
# Original loop
|
||||||
@@ -17,18 +17,18 @@ if [ ! -z $RTSP_STREAM ];then
|
|||||||
# done
|
# done
|
||||||
|
|
||||||
# Initially start the count off at 1 - our very first stream
|
# Initially start the count off at 1 - our very first stream
|
||||||
RSTP_STREAMS_STARTED_COUNT=1
|
RTSP_STREAMS_STARTED_COUNT=1
|
||||||
FFMPEG_PARAMS=""
|
FFMPEG_PARAMS=""
|
||||||
|
|
||||||
# Loop over the streams
|
# Loop over the streams
|
||||||
for i in "${RSTP_STREAMS_EXPLODED_ARRAY[@]}"
|
for i in "${RTSP_STREAMS_EXPLODED_ARRAY[@]}"
|
||||||
do
|
do
|
||||||
# Map id used to map input to output, this is 0 based in ffmpeg decrement
|
# Map id used to map input to output, this is 0 based in ffmpeg decrement
|
||||||
MAP_ID=$((RSTP_STREAMS_STARTED_COUNT-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
|
||||||
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-RSTP_${RSTP_STREAMS_STARTED_COUNT}-$(date "+%H:%M:%S").wav "
|
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
|
||||||
((RSTP_STREAMS_STARTED_COUNT += 1))
|
((RTSP_STREAMS_STARTED_COUNT += 1))
|
||||||
done
|
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 look by waiting ${RECORDING_LENGTH} between loops
|
||||||
|
|||||||
+6
-6
@@ -406,15 +406,15 @@ def handle_client(conn, addr):
|
|||||||
file_name = Path(full_file_name).stem
|
file_name = Path(full_file_name).stem
|
||||||
|
|
||||||
# Get the RSTP stream identifier from the filename if it exists
|
# Get the RSTP stream identifier from the filename if it exists
|
||||||
rstp_ident_for_fn = ""
|
RTSP_ident_for_fn = ""
|
||||||
rstp_ident = re.search("RSTP_[0-9]+-", file_name)
|
RTSP_ident = re.search("RTSP_[0-9]+-", file_name)
|
||||||
if rstp_ident is not None:
|
if RTSP_ident is not None:
|
||||||
rstp_ident_for_fn = rstp_ident.group()
|
RTSP_ident_for_fn = RTSP_ident.group()
|
||||||
|
|
||||||
# Find and remove the identifier for the RSTP stream url it was from that is added when more than one
|
# Find and remove the identifier for the RSTP stream url it was from that is added when more than one
|
||||||
# RSTP stream is recorded simultaneously, in order to make the filenames unique as filenames are all
|
# RSTP stream is recorded simultaneously, in order to make the filenames unique as filenames are all
|
||||||
# generated at the same time
|
# generated at the same time
|
||||||
file_name = re.sub("RSTP_[0-9]+-", "", file_name)
|
file_name = re.sub("RTSP_[0-9]+-", "", file_name)
|
||||||
|
|
||||||
# Now we can read the date and time as normal
|
# Now we can read the date and time as normal
|
||||||
# First portion of the filename contaning the date in Y m d
|
# First portion of the filename contaning the date in Y m d
|
||||||
@@ -480,7 +480,7 @@ def handle_client(conn, addr):
|
|||||||
Overlap = str(args.overlap)
|
Overlap = str(args.overlap)
|
||||||
Com_Name = Com_Name.replace("'", "")
|
Com_Name = Com_Name.replace("'", "")
|
||||||
File_Name = Com_Name.replace(" ", "_") + '-' + Confidence + '-' + \
|
File_Name = Com_Name.replace(" ", "_") + '-' + Confidence + '-' + \
|
||||||
Date.replace("/", "-") + '-birdnet-' + rstp_ident_for_fn + Time + audiofmt
|
Date.replace("/", "-") + '-birdnet-' + RTSP_ident_for_fn + Time + audiofmt
|
||||||
|
|
||||||
# Connect to SQLite Database
|
# Connect to SQLite Database
|
||||||
for attempt_number in range(3):
|
for attempt_number in range(3):
|
||||||
|
|||||||
Reference in New Issue
Block a user