feat: 카드·영상 스크립트를 윈도우에서도 돌게 — 외부 프로그램 위치를 scripts/bin.mjs 로 모음, 크롬이 45초 넘게 멈추면 그 장만 다시 찍음, claude 프롬프트는 stdin 으로

This commit is contained in:
minaChoi committed 2026-10-29 09:05:31 +09:00
1 parent 63b4fa74fe
commit e28359ff47
15 files changed
+150 -51

No files matched your search

+8 -6
View File
@@ -7,12 +7,14 @@ set -euo pipefail
HERE=$(cd "$(dirname "$0")" && pwd)
WORK=$(cd "$1" && pwd)
MUSIC=${2:-}
# 윈도우는 python3 대신 python·py 일 수 있다
PY=${PYTHON:-python3}
cd "$WORK"
[ -s mask.png ] || python3 "$HERE/render.py" mask --out mask.png
[ -s frame.png ] || python3 "$HERE/render.py" frame --out frame.png
[ -s outro.png ] || python3 "$HERE/render.py" outro --out outro.png
[ -s mask.png ] || "$PY" "$HERE/render.py" mask --out mask.png
[ -s frame.png ] || "$PY" "$HERE/render.py" frame --out frame.png
[ -s outro.png ] || "$PY" "$HERE/render.py" outro --out outro.png
part=6.7; outro=2.4; fade=0.4
o1=$(python3 -c "print($part - $fade)"); o2=$(python3 -c "print(2 * $part - 2 * $fade)")
o1=$(awk "BEGIN{print $part - $fade}"); o2=$(awk "BEGIN{print 2 * $part - 2 * $fade}")
card="scale=816:1440:flags=lanczos,format=rgba"
blur="scale=272:480,boxblur=10:2,scale=1088:1920,crop=1080:1920:4:0,eq=brightness=0.03:saturation=0.9,format=rgba"
join() { # 클립a 클립b 이름
@@ -37,11 +39,11 @@ inputs=(); chain=""; prev="0:v"; k=1
while read -r name start end; do
[ -n "${name:-}" ] || continue
inputs+=(-loop 1 -framerate 24 -t 15 -i "bubbles/$name.png")
fo=$(python3 -c "print(round($end - 0.2, 2))")
fo=$(awk "BEGIN{printf \"%g\", $end - 0.2}")
chain+="[$k:v]format=rgba,fade=in:st=$start:d=0.2:alpha=1,fade=out:st=$fo:d=0.2:alpha=1[b$k];"
chain+="[$prev][b$k]overlay=x=0:y='max(0\,20*(1-(t-$start)/0.2))':enable='between(t,$start,$end)'[v$k];"
prev="v$k"; k=$((k+1))
done < bubbles.txt
done < <(tr -d '\r' < bubbles.txt)
if [ $k -eq 1 ]; then cp base.mp4 bubbles.mp4; else
ffmpeg -hide_banner -loglevel error -y -i base.mp4 "${inputs[@]}" -filter_complex "${chain%;}" -map "[$prev]" -map 0:a \
-c:v libx264 -preset slow -crf 17 -profile:v high -pix_fmt yuv420p -c:a copy -movflags +faststart bubbles.mp4