test
All checks were successful
Generate Map Previews for Switzerland25 Tournament / Full CI/CD Pipeline (push) Successful in 7s

This commit is contained in:
2025-09-18 12:19:35 +02:00
parent 25021b4209
commit b97fee01aa

View File

@@ -65,6 +65,8 @@ jobs:
- name: Generate Danser videos - name: Generate Danser videos
shell: bash shell: bash
run: | run: |
set +e # Don't exit on error
JSON_FILE="$TIMESTAMPS_JSON" JSON_FILE="$TIMESTAMPS_JSON"
mapfile -t REPLAYS < <(find "$REPLAY_DIR" -type f -name "*.osr") mapfile -t REPLAYS < <(find "$REPLAY_DIR" -type f -name "*.osr")
@@ -145,21 +147,34 @@ jobs:
echo " Timestamps: ${START}s - ${END}s" echo " Timestamps: ${START}s - ${END}s"
echo " Generating video with danser-cli..." echo " Generating video with danser-cli..."
xvfb-run -a "$DANSER_DIR/danser-cli" \ # Capture danser output and errors
if ! xvfb-run -a "$DANSER_DIR/danser-cli" \
-replay "$REPLAY" -record -skip -settings="tourneypreview" -skin="$SKIN" -start=$START -end=$END -noupdatecheck \ -replay "$REPLAY" -record -skip -settings="tourneypreview" -skin="$SKIN" -start=$START -end=$END -noupdatecheck \
-out="$REPLAY_NAME" >/dev/null 2>&1 -out="$REPLAY_NAME" >/dev/null 2>&1; then
echo " ERROR: Danser failed for $REPLAY_NAME"
((skipped++))
continue
fi
if [ -f "$DANSER_VIDEO_DIR/$REPLAY_NAME.mp4" ]; then if [ -f "$DANSER_VIDEO_DIR/$REPLAY_NAME.mp4" ]; then
echo " Moving video to output directory..." echo " Moving video to output directory..."
mv "$DANSER_VIDEO_DIR/$REPLAY_NAME.mp4" "$OUT_VIDEO_FILE" 2>/dev/null mv "$DANSER_VIDEO_DIR/$REPLAY_NAME.mp4" "$OUT_VIDEO_FILE" 2>/dev/null
echo " Post-processing with ffmpeg..." echo " Post-processing with ffmpeg..."
ffmpeg -hide_banner -loglevel error \ # Capture ffmpeg errors but suppress normal output
ffmpeg_output=$(ffmpeg -hide_banner -loglevel error \
-ss 5 \ -ss 5 \
-i "$OUT_VIDEO_FILE" \ -i "$OUT_VIDEO_FILE" \
-c:v h264_nvenc -preset slow -rc vbr -cq 19 -b:v 10M -maxrate 20M \ -c:v h264_nvenc -preset slow -rc vbr -cq 19 -b:v 10M -maxrate 20M \
-c:a aac -b:a 192k \ -c:a aac -b:a 192k \
"${OUT_VIDEO_FILE}.tmp.mp4" 2>/dev/null "${OUT_VIDEO_FILE}.tmp.mp4" 2>&1)
if [ $? -ne 0 ]; then
echo " ERROR: FFmpeg failed for $REPLAY_NAME:"
echo "$ffmpeg_output"
((skipped++))
continue
fi
mv "${OUT_VIDEO_FILE}.tmp.mp4" "$OUT_VIDEO_FILE" 2>/dev/null mv "${OUT_VIDEO_FILE}.tmp.mp4" "$OUT_VIDEO_FILE" 2>/dev/null