test
All checks were successful
Generate Map Previews for Switzerland25 Tournament / Full CI/CD Pipeline (push) Successful in 7s
All checks were successful
Generate Map Previews for Switzerland25 Tournament / Full CI/CD Pipeline (push) Successful in 7s
This commit is contained in:
@@ -65,6 +65,8 @@ jobs:
|
||||
- name: Generate Danser videos
|
||||
shell: bash
|
||||
run: |
|
||||
set +e # Don't exit on error
|
||||
|
||||
JSON_FILE="$TIMESTAMPS_JSON"
|
||||
mapfile -t REPLAYS < <(find "$REPLAY_DIR" -type f -name "*.osr")
|
||||
|
||||
@@ -145,21 +147,34 @@ jobs:
|
||||
echo " Timestamps: ${START}s - ${END}s"
|
||||
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 \
|
||||
-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
|
||||
echo " Moving video to output directory..."
|
||||
mv "$DANSER_VIDEO_DIR/$REPLAY_NAME.mp4" "$OUT_VIDEO_FILE" 2>/dev/null
|
||||
|
||||
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 \
|
||||
-i "$OUT_VIDEO_FILE" \
|
||||
-c:v h264_nvenc -preset slow -rc vbr -cq 19 -b:v 10M -maxrate 20M \
|
||||
-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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user