summaryrefslogtreecommitdiff
path: root/synopticMorph.sh
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2026-07-30 12:10:48 +1000
committerSt33v <github@f3rr3t.com>2026-07-30 12:10:48 +1000
commitd9ae5bc0f61d777ff72d3f830a34775ebfc60632 (patch)
tree70653e0b33407d60c00d1a7e277c70d831de8a84 /synopticMorph.sh
parent172cad3b441166bc456436ca20f05ff36a06dafe (diff)
Add right-to-left progress glyph to morph timelapse
A drifting cloud glyph maps linearly to elapsed video time so viewers can see how far through the loop they are; outlined for legibility against both light ocean and dark chart backgrounds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'synopticMorph.sh')
-rw-r--r--synopticMorph.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/synopticMorph.sh b/synopticMorph.sh
index 0c22ca1..22749f4 100644
--- a/synopticMorph.sh
+++ b/synopticMorph.sh
@@ -23,6 +23,8 @@ LINGER="${LINGER:-8}"
DWELL="${DWELL:-36}"
FADE_IN="${FADE_IN:-1}"
FADE_OUT="${FADE_OUT:-2}"
+GLYPH_FONT="${GLYPH_FONT:-/usr/share/fonts/TTF/DejaVuSans.ttf}"
+GLYPH_SIZE="${GLYPH_SIZE:-28}"
require_cmd() {
command -v "$1" >/dev/null 2>&1 || { echo "Required: $1" >&2; exit 127; }
@@ -126,10 +128,15 @@ fout=$(awk "BEGIN{printf \"%.3f\", $out/$FPS - $FADE_OUT}")
echo "Sequence: $out frames = ${dur}s at ${FPS} fps; fade-out ${FADE_OUT}s from ${fout}s"
# --- 6. Encode ----------------------------------------------------------
+# Progress glyph: a cloud drifts right-to-left across the top of the frame,
+# x mapped linearly to elapsed video time (0 at right edge, dur at left edge),
+# so it visibly pauses during linger/dwell holds rather than skipping ahead.
+GLYPH="drawtext=fontfile=$GLYPH_FONT:text='☁':fontsize=$GLYPH_SIZE:fontcolor=white@0.9:borderw=2:bordercolor=black@0.6:x=(w-tw)*(1-t/$dur):y=h*0.07"
+
TMP_MP4=$(mktemp "$OUT_DIR/morph.XXXXXX.mp4")
ffmpeg -y -hide_banner -loglevel error -framerate "$FPS" \
-i "$SEQ_DIR/seq_%06d.png" \
- -vf "fade=t=in:st=0:d=$FADE_IN,fade=t=out:st=$fout:d=$FADE_OUT" \
+ -vf "$GLYPH,fade=t=in:st=0:d=$FADE_IN,fade=t=out:st=$fout:d=$FADE_OUT" \
-c:v libx264 -pix_fmt yuv420p -movflags +faststart "$TMP_MP4"
mkdir -p "$(dirname "$PUBLISH_PATH")"