Convert video files to compressed terminal ANSI streams for playback.
Inspired by Simon Willison, who was in turn inspired by Darren Burns.
Warning: vibe-coded
It takes a video file, extracts frames with ffmpeg, converts each frame to ANSI escape sequences with randomized pixel ordering (anti-tearing effect), and compresses the stream with zstd.
ffmpeg, pv, zstd
# macOS
brew install ffmpeg pv zstd
# Ubuntu/Debian
sudo apt install ffmpeg pv zstdPython dependencies are managed with uv (see script header).
Convert a video to an ANSI stream:
uv run vidcat.py path/to/video.mp4 --width 80 --output video.zstWarning big width means big output file.
vidcat prints playback instructions at the end of the conversion.
MIT.
If you really want this code. But I don't know why you would.
