Optimize streaming latency: remove -re flag, add keyframe settings, reduce HLS segments, faster ICE timeout
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 21s

This commit is contained in:
Your Name
2025-09-02 12:37:28 +12:00
parent a2c82d66d0
commit 2459274a19
3 changed files with 8 additions and 5 deletions

View File

@@ -22,8 +22,8 @@ rtspTransports: [tcp, udp]
hls: yes hls: yes
hlsAddress: :8888 hlsAddress: :8888
hlsAllowOrigin: '*' hlsAllowOrigin: '*'
hlsSegmentCount: 10 hlsSegmentCount: 3
hlsSegmentDuration: 2s hlsSegmentDuration: 1s
hlsPartDuration: 200ms hlsPartDuration: 200ms
hlsAlwaysRemux: yes hlsAlwaysRemux: yes

View File

@@ -9,7 +9,6 @@ fi
# Start ffmpeg with drawtext filter for score overlay # Start ffmpeg with drawtext filter for score overlay
exec ffmpeg \ exec ffmpeg \
-re \
-rtsp_transport tcp \ -rtsp_transport tcp \
-i rtsp://localhost:8554/court \ -i rtsp://localhost:8554/court \
-vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:\ -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:\
@@ -25,7 +24,11 @@ y=10" \
-c:v libx264 \ -c:v libx264 \
-preset ultrafast \ -preset ultrafast \
-tune zerolatency \ -tune zerolatency \
-g 30 \
-keyint_min 30 \
-b:v 2M \ -b:v 2M \
-maxrate 2M \
-bufsize 1M \
-f rtsp \ -f rtsp \
-rtsp_transport tcp \ -rtsp_transport tcp \
rtsp://localhost:8554/court_h264 rtsp://localhost:8554/court_h264

View File

@@ -230,8 +230,8 @@
resolve(); resolve();
} }
}; };
// Timeout after 2 seconds // Timeout after 500ms for faster connection
setTimeout(resolve, 2000); setTimeout(resolve, 500);
} }
}); });