From ed8982da0e78981b725cf47c66ab42e0538b103c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 1 May 2026 05:09:57 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20afade:=20bc=20omits=20leading=20zero=20fo?= =?UTF-8?q?r=20values=20<=201=20(.850=20=E2=86=92=200.850)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fade_dur = SUNRISE_TARGET_SECS * 0.085 = 0.850 at the default 10s target. bc outputs .850 without a leading zero, which ffmpeg's afade filter rejects with "Unable to parse option value .850 as duration". Pipe bc output through sed to prepend the zero when the value starts with '.'. https://claude.ai/code/session_01DANuzLCLhhQ7Li12RTcswY --- daily_sunrise_video.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daily_sunrise_video.sh b/daily_sunrise_video.sh index 8e1db4d..eeaa7bd 100755 --- a/daily_sunrise_video.sh +++ b/daily_sunrise_video.sh @@ -440,8 +440,8 @@ if $TEST_MODE; then else final_video="$output_dir/$CAM_NAME-$current_date-daily-sunrise.mp4" fi -fade_dur=$(echo "scale=3; $SUNRISE_TARGET_SECS * 0.085" | bc) -fade_out=$(echo "scale=3; $SUNRISE_TARGET_SECS - $fade_dur" | bc) +fade_dur=$(echo "scale=3; $SUNRISE_TARGET_SECS * 0.085" | bc | sed 's/^\./0./') +fade_out=$(echo "scale=3; $SUNRISE_TARGET_SECS - $fade_dur" | bc | sed 's/^\./0./') # ── Step 3a: mix audio (video copied, not re-encoded) ──────────────────────── work_video="$sped_video"