Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- VIDEO="$1"
- if [[ -z "$VIDEO" || ! -f "$VIDEO" ]]; then
- echo "Usage: $0 input_video"
- exit 1
- fi
- # Create working directories
- mkdir -p frames ascii_frames
- ffmpeg -hide_banner -loglevel error -i "$VIDEO" -vf fps=10 frames/frame_%04d.png
- if [[ $? -ne 0 ]]; then
- exit 1
- fi
- for f in frames/*.png; do
- base=$(basename "$f" .png)
- jp2a --width=100 --height=40 --colors "$f" > ascii_frames/${base}.txt
- done
- echo "[3/3] Playing ASCII animation..."
- for f in $(ls ascii_frames/*.txt | sort); do
- clear
- cat "$f"
- sleep 1
- done
Advertisement
Add Comment
Please, Sign In to add comment