From 9ac28bb49a28f96f56048c573570f89e28a09f6a Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:56:47 +0200 Subject: [PATCH] Update DOCS.md --- birdnet-pi/DOCS.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/birdnet-pi/DOCS.md b/birdnet-pi/DOCS.md index 1aa3a76db..c24608d5c 100644 --- a/birdnet-pi/DOCS.md +++ b/birdnet-pi/DOCS.md @@ -94,8 +94,8 @@ fi # Wait for a moment to check if the process fails sleep 5 -# Check if GStreamer is still running -if [ "$gst_pid" -ne 0 ] && ! ps -p "$gst_pid" > /dev/null; then +# Check if GStreamer is still running using ps aux +if [ "$gst_pid" -ne 0 ] && ! ps aux | grep "[r]tsp_audio_server.py" > /dev/null; then echo "GStreamer failed, switching to ffmpeg" # Start mediamtx first and give it a moment to initialize @@ -199,14 +199,16 @@ class PCMStream(GstRtspServer.RTSPMediaFactory): # Fallback if 'get_uri()' doesn't exist logging.info("Creating pipeline for RTSP stream.") - # Define the GStreamer pipeline string with Opus encoding for better compatibility + # Define the GStreamer pipeline string for PCM streaming pipeline_str = ( f"alsasrc device={self.device} ! " f"audio/x-raw, format={self.format}, rate={self.rate}, channels={self.channels} ! " "audioconvert ! audioresample ! " - "opusenc ! rtpopuspay name=pay0 pt=96" + "rtpL16pay name=pay0 pt=96" ) + logging.info(f"Pipeline: {pipeline_str}") + # Parse and launch the pipeline pipeline = Gst.parse_launch(pipeline_str)