diff --git a/daily_sunrise_video.sh b/daily_sunrise_video.sh index d262b1f..1118685 100644 --- a/daily_sunrise_video.sh +++ b/daily_sunrise_video.sh @@ -143,7 +143,7 @@ echo "Speed-adjusted: ${sped_dur}s (saved — overlay still pending)" SR_TIME=$(echo "$sunrise_time_local" | cut -d'-' -f1,2 | tr '-' ':') DT="" if [ "${SUNRISE_OVERLAY_ENABLED:-true}" = "true" ]; then - SR_VERT=$(echo "$SR_TIME" | awk 'BEGIN{FS=""}{for(i=1;i<=NF;i++){printf "%s",$i; if(i/dev/null || true; } trap cleanup EXIT -printf "file '%s'\n" "${frames[@]}" > "$TMP_LIST" +# Write concat list with explicit duration per frame so raw video represents +# real elapsed time: 12 frames × CAPTURE_INTERVAL seconds = ~2 minutes. +# The final entry needs a duplicate without duration (ffmpeg concat requirement). +for f in "${frames[@]}"; do + printf "file '%s'\nduration %s\n" "$f" "${CAPTURE_INTERVAL:-10}" +done >> "$TMP_LIST" +printf "file '%s'\n" "${frames[-1]}" >> "$TMP_LIST" # ── Step 1: raw video from frames ───────────────────────────────────────────── echo "" @@ -111,7 +120,7 @@ if [ -n "$RTSP_URL" ]; then -i "$RTSP_URL" \ -t "$SUNRISE_TARGET_SECS" \ -vn -c:a aac -b:a 64k \ - -y "$TMP_AUDIO" 2>/dev/null; then + -y "$TMP_AUDIO"; then HAS_AUDIO=true echo " Audio: captured OK" else