j0h

v2a

j0h
Oct 13th, 2025
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. VIDEO="$1"
  4.  
  5. if [[ -z "$VIDEO" || ! -f "$VIDEO" ]]; then
  6.     echo "Usage: $0 input_video"
  7.     exit 1
  8. fi
  9.  
  10. # Create working directories
  11. mkdir -p frames ascii_frames
  12.  
  13. ffmpeg -hide_banner -loglevel error -i "$VIDEO" -vf fps=10 frames/frame_%04d.png
  14. if [[ $? -ne 0 ]]; then
  15.  
  16.  
  17.     exit 1
  18. fi
  19.  
  20. for f in frames/*.png; do
  21.     base=$(basename "$f" .png)
  22.     jp2a --width=100 --height=40 --colors "$f" > ascii_frames/${base}.txt
  23. done
  24.  
  25. echo "[3/3] Playing ASCII animation..."
  26. for f in $(ls ascii_frames/*.txt | sort); do
  27.     clear
  28.     cat "$f"
  29.     sleep 1
  30. done
  31.  
Advertisement
Add Comment
Please, Sign In to add comment