mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-01 19:48:47 +02:00
Remove gstreamer
This commit is contained in:
@@ -77,38 +77,14 @@ echo "Starting birdmic"
|
|||||||
# Disable gigabit ethernet
|
# Disable gigabit ethernet
|
||||||
sudo ethtool -s eth0 speed 100 duplex full autoneg on
|
sudo ethtool -s eth0 speed 100 duplex full autoneg on
|
||||||
|
|
||||||
# Run GStreamer RTSP server if installed
|
# Start mediamtx first and give it a moment to initialize
|
||||||
if command -v gst-launch-1.0 &>/dev/null; then
|
./mediamtx &
|
||||||
./rtsp_audio_server.py & sleep 2 >/tmp/log_rtsp 2>/tmp/log_rtsp_error &
|
|
||||||
gst_pid=$!
|
|
||||||
else
|
|
||||||
echo "GStreamer not found, skipping to ffmpeg fallback"
|
|
||||||
gst_pid=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Wait for a moment to let GStreamer initialize
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# Check if the RTSP stream can be accessed (i.e., the feed can be read)
|
|
||||||
if ! ffmpeg -rtsp_transport tcp -i rtsp://localhost:8554/birdmic -t 1 -f null - > /dev/null 2>&1; then
|
|
||||||
echo "GStreamer RTSP stream is not accessible, switching to ffmpeg"
|
|
||||||
|
|
||||||
# Kill the GStreamer process if it's still running
|
# Run ffmpeg
|
||||||
if [ "$gst_pid" -ne 0 ]; then
|
ffmpeg -nostdin -use_wallclock_as_timestamps 1 -fflags +genpts -f alsa -acodec pcm_s16be -ac 2 -ar 96000 \
|
||||||
kill "$gst_pid"
|
-i plughw:0,0 -ac 2 -f rtsp -acodec pcm_s16be rtsp://localhost:8554/birdmic -rtsp_transport tcp \
|
||||||
fi
|
-buffer_size 512k 2>/tmp/rtsp_error &
|
||||||
|
|
||||||
# Start mediamtx first and give it a moment to initialize
|
|
||||||
./mediamtx &
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
# Run ffmpeg as fallback
|
|
||||||
ffmpeg -nostdin -use_wallclock_as_timestamps 1 -fflags +genpts -f alsa -acodec pcm_s16be -ac 2 -ar 96000 \
|
|
||||||
-i plughw:0,0 -ac 2 -f rtsp -acodec pcm_s16be rtsp://localhost:8554/birdmic -rtsp_transport tcp \
|
|
||||||
-buffer_size 512k 2>/tmp/rtsp_error &
|
|
||||||
else
|
|
||||||
echo "GStreamer RTSP stream is running successfully"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set microphone volume
|
# Set microphone volume
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|||||||
Reference in New Issue
Block a user