diff --git a/4-seasons.sh b/4-seasons.sh index f480596..43bdf36 100755 --- a/4-seasons.sh +++ b/4-seasons.sh @@ -129,12 +129,11 @@ if [ "${#images[@]}" -eq 0 ]; then fi for img in "${images[@]}"; do - printf "file '%s'\nduration %s\n" "$img" "$INTERVAL" + printf "file '%s'\n" "$img" done > "$temp_file" -printf "file '%s'\n" "${images[-1]}" >> "$temp_file" # ── Step 1: Build raw video ─────────────────────────────────────────────────── -echo "Step 1/2: encoding raw video from ${#images[@]} frames ($(( ${#images[@]} * INTERVAL / 3600 ))h coverage)..." +echo "Step 1/2: encoding raw video from ${#images[@]} frames..." ffmpeg -loglevel warning \ -f concat -safe 0 -i "$temp_file" \ -c:v libx264 -pix_fmt yuv420p -preset "$ENCODE_PRESET" -crf "$CRF_SEASONS_RAW" -vsync 2 -an \ @@ -142,14 +141,6 @@ ffmpeg -loglevel warning \ raw_duration=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$temp_video") echo "Raw duration: $raw_duration s" -# Warn if raw video covers less than 50% of expected image count (big gap or camera outage) -expected_dur=$(echo "scale=0; ${#images[@]} * $INTERVAL" | bc) -coverage_pct=$(echo "scale=0; $raw_duration * 100 / $expected_dur" | bc 2>/dev/null || echo "?") -if [ "$coverage_pct" != "?" ] && [ "$coverage_pct" -lt 50 ]; then - echo "WARNING: raw video is ${coverage_pct}% of expected ${expected_dur}s — significant image gap detected" - "$SCRIPT_DIR/notify.sh" "WARNING: [$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT — only ${coverage_pct}% coverage ($yesterday)" \ - "Raw video ${raw_duration}s of expected ${expected_dur}s — check camera logs for gaps" || true -fi # ── Step 2: Speed-adjust to target clip duration ────────────────────────────── speed_factor=$(echo "scale=6; $raw_duration / $target_per_clip" | bc)