mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
Update DOCS.md
This commit is contained in:
@@ -94,8 +94,8 @@ fi
|
|||||||
# Wait for a moment to check if the process fails
|
# Wait for a moment to check if the process fails
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# Check if GStreamer is still running
|
# Check if GStreamer is still running using ps aux
|
||||||
if [ "$gst_pid" -ne 0 ] && ! ps -p "$gst_pid" > /dev/null; then
|
if [ "$gst_pid" -ne 0 ] && ! ps aux | grep "[r]tsp_audio_server.py" > /dev/null; then
|
||||||
echo "GStreamer failed, switching to ffmpeg"
|
echo "GStreamer failed, switching to ffmpeg"
|
||||||
|
|
||||||
# Start mediamtx first and give it a moment to initialize
|
# 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
|
# Fallback if 'get_uri()' doesn't exist
|
||||||
logging.info("Creating pipeline for RTSP stream.")
|
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 = (
|
pipeline_str = (
|
||||||
f"alsasrc device={self.device} ! "
|
f"alsasrc device={self.device} ! "
|
||||||
f"audio/x-raw, format={self.format}, rate={self.rate}, channels={self.channels} ! "
|
f"audio/x-raw, format={self.format}, rate={self.rate}, channels={self.channels} ! "
|
||||||
"audioconvert ! audioresample ! "
|
"audioconvert ! audioresample ! "
|
||||||
"opusenc ! rtpopuspay name=pay0 pt=96"
|
"rtpL16pay name=pay0 pt=96"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logging.info(f"Pipeline: {pipeline_str}")
|
||||||
|
|
||||||
# Parse and launch the pipeline
|
# Parse and launch the pipeline
|
||||||
pipeline = Gst.parse_launch(pipeline_str)
|
pipeline = Gst.parse_launch(pipeline_str)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user