@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
sh 13 lines 746 Bytes
Raw
1 #!/usr/bin/env bash
2 # Renders <dir>/story.html to <dir>/<name>.mp4 (1920x1080, 30 fps) and <dir>/outro.png (its last frame).
3 # Usage: render.sh <dir> [name]
4 set -euo pipefail
5 dir=$(cd "${1:?usage: render.sh <dir> [name]}" && pwd)
6 name=${2:-video}
7 here=$(cd "$(dirname "$0")" && pwd)
8 node "$here/capture.mjs" "$dir/story.html" "$dir/frames"
9 ffmpeg -hide_banner -loglevel error -y -reinit_filter 0 -framerate 30 -i "$dir/frames/f%04d.png" \
10 -c:v libx264 -preset slow -crf 16 -pix_fmt yuv420p -movflags +faststart "$dir/$name.mp4"
11 cp "$(ls "$dir/frames"/f*.png | tail -1)" "$dir/outro.png"
12 ffprobe -v error -show_entries format=duration:stream=width,height -of default=nw=1 "$dir/$name.mp4"
13 echo "video -> $dir/$name.mp4, outro -> $dir/outro.png"