-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest_mediamtx.sh
More file actions
executable file
·72 lines (60 loc) · 1.68 KB
/
test_mediamtx.sh
File metadata and controls
executable file
·72 lines (60 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
echo "🚀 Starting MediaMTX Test Setup for TrackStudio"
echo "==============================================="
echo ""
# Function to cleanup on exit
cleanup() {
echo ""
echo "🛑 Stopping all processes..."
docker compose down
pkill -f "tests/stream_camera[0-1]_ffmpeg.sh"
exit 0
}
# Set trap for cleanup
trap cleanup EXIT INT TERM
# Check if docker compose is available
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
# Start MediaMTX
echo "📡 Starting MediaMTX server..."
docker compose up -d mediamtx
# Wait for MediaMTX to start
echo "⏳ Waiting for MediaMTX to start..."
sleep 5
echo "✅ MediaMTX is running!"
echo ""
echo "📺 MediaMTX endpoints:"
echo " RTSP: rtsp://localhost:8554/"
echo " RTMP: rtmp://localhost:1935/"
echo " HLS: http://localhost:8888/"
echo " WebRTC: http://localhost:8889/"
echo ""
# Start test streams
echo "🎬 Starting test streams..."
echo ""
# Make scripts executable
chmod +x tests/stream_camera0_ffmpeg.sh tests/stream_camera1_ffmpeg.sh
# Start camera streams in background
./tests/stream_camera0_ffmpeg.sh &
sleep 2
./tests/stream_camera1_ffmpeg.sh &
echo ""
echo "✅ Test streams are starting..."
echo ""
echo "📹 Available RTSP streams for TrackStudio:"
echo " Camera 0: rtsp://localhost:8554/camera0"
echo " Camera 1: rtsp://localhost:8554/camera1"
echo ""
echo "🎯 To use with TrackStudio:"
echo " uv run trackstudio run -c config_test.json"
echo ""
echo "📊 To monitor MediaMTX:"
echo " docker compose logs -f mediamtx"
echo ""
echo "Press Ctrl+C to stop all services..."
# Keep script running
while true; do
sleep 1
done