File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ jobs:
127127 - name : Wait for services to start
128128 run : |
129129 echo "Waiting for services to start..."
130- sleep 300
130+ sleep 60
131131
132132 - name : Test Stream Container Health Endpoint
133133 run : |
@@ -159,10 +159,26 @@ jobs:
159159 echo "RTMP server is ready"
160160 '
161161
162- # Use ffprobe to check stream properties
163- echo "Checking stream properties with ffprobe..."
164- timeout 30 "ffprobe" -v quiet -print_format json -show_streams rtmp://localhost:1935/live/stream > stream_info.json 2>/dev/null || {
165- echo "Stream not available yet, checking container logs..."
162+ # Use ffprobe to check stream properties and wait for video stream
163+ echo "Checking stream properties with ffprobe and waiting for video stream..."
164+ timeout 300 bash -c '
165+ while true; do
166+ if ffprobe -v quiet -print_format json -show_streams rtmp://localhost:1935/live/stream > stream_info.json 2>/dev/null; then
167+ # Check if we have a video stream
168+ video_stream_count=$(cat stream_info.json | jq -r "[.streams[] | select(.codec_type == \"video\")] | length")
169+ if [ "$video_stream_count" -gt 0 ]; then
170+ echo "Video stream found! Stream is ready."
171+ break
172+ else
173+ echo "Only audio stream found, waiting for video stream..."
174+ fi
175+ else
176+ echo "Stream not yet available, retrying..."
177+ fi
178+ sleep 2
179+ done
180+ ' || {
181+ echo "Timeout waiting for video stream, checking container logs..."
166182 docker logs stream-webpage
167183 exit 1
168184 }
You can’t perform that action at this time.
0 commit comments