Files
dropshell-templates/squashkiwi-streaming/config/transcoder/transcoder.sh
Your Name 2459274a19
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 21s
Optimize streaming latency: remove -re flag, add keyframe settings, reduce HLS segments, faster ICE timeout
2025-09-02 12:37:28 +12:00

34 lines
801 B
Bash

#!/bin/bash
# Transcoder with live score overlay for SquashKiwi streaming
# Create initial score file if it doesn't exist
SCORE_FILE="/tmp/score.txt"
if [ ! -f "$SCORE_FILE" ]; then
echo "Waiting for match..." > "$SCORE_FILE"
fi
# Start ffmpeg with drawtext filter for score overlay
exec ffmpeg \
-rtsp_transport tcp \
-i rtsp://localhost:8554/court \
-vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:\
textfile='$SCORE_FILE':\
reload=1:\
fontcolor=white:\
fontsize=24:\
box=1:\
boxcolor=black@0.7:\
boxborderw=5:\
x=10:\
y=10" \
-c:v libx264 \
-preset ultrafast \
-tune zerolatency \
-g 30 \
-keyint_min 30 \
-b:v 2M \
-maxrate 2M \
-bufsize 1M \
-f rtsp \
-rtsp_transport tcp \
rtsp://localhost:8554/court_h264