Merge pull request #851 from jaredb7/RTSP-Recording-fixes

Make ffmpeg record the first audio stream for RTSP
This commit is contained in:
ehpersonal38
2023-04-16 16:36:36 -04:00
committed by GitHub
+1 -1
View File
@@ -29,7 +29,7 @@ if [ ! -z $RTSP_STREAM ];then
# Map id used to map input to output, this is 0 based in ffmpeg decrement
MAP_ID=$((RTSP_STREAMS_STARTED_COUNT-1))
# 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-RTSP_${RTSP_STREAMS_STARTED_COUNT}-$(date "+%H:%M:%S").wav "
FFMPEG_PARAMS+="-vn -thread_queue_size 512 -i ${i} -map ${MAP_ID}:a:0 -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
((RTSP_STREAMS_STARTED_COUNT += 1))
done