stream optimizations

This commit is contained in:
Maik Jurischka
2025-12-12 14:37:57 +01:00
parent 43a1abdd31
commit 9c9f822f35
10 changed files with 168 additions and 24 deletions

View File

@@ -4,8 +4,18 @@
SOCKET="/tmp/vizion_control.sock"
PORT="${1:-8080}"
# Check if gst-plugins-good with souphttpsink is available
if gst-inspect-1.0 souphttpsink &>/dev/null; then
echo "Using souphttpsink for HTTP server..."
PIPELINE="videoconvert ! jpegenc quality=85 ! multipartmux boundary=\"--videoboundary\" ! souphttpsink port=$PORT"
else
echo "WARNING: souphttpsink not found. Using tcpserversink (may not work in browsers)."
echo "Install gst-plugins-good: sudo apt install gstreamer1.0-plugins-good"
PIPELINE="videoconvert ! jpegenc quality=85 ! multipartmux ! tcpserversink host=0.0.0.0 port=$PORT"
fi
echo "Setting MJPEG HTTP streaming pipeline on port $PORT..."
echo "{\"command\":\"set_pipeline\",\"params\":{\"pipeline\":\"videoconvert ! jpegenc ! multipartmux ! tcpserversink host=0.0.0.0 port=$PORT\"}}" | socat - UNIX-CONNECT:$SOCKET
echo "{\"command\":\"set_pipeline\",\"params\":{\"pipeline\":\"$PIPELINE\"}}" | socat - UNIX-CONNECT:$SOCKET
echo ""
echo "Pipeline set. Start streaming with start_stream.sh"