How bitbranchi/simple-ascii-player works
This is a small command-line ASCII video player. The user supplies a video path and target width; the script reads frames, resizes and converts them to grayscale, maps pixel brightness to ASCII characters, and prints each frame in the terminal. The graph separates input and playback control from frame conversion and terminal output. All runtime behavior is in main.py; OpenCV and NumPy are dependencies. The relationships shown are visible in the excerpted script.
Main entry points: main.py Playback loop
Components 13
Input and control
- Video and width prompts
main.py - Video capture
main.py - Playback loop
main.py
Frame conversion
- Frame dimensions
main.py - Resize and grayscale
main.py - Brightness mapping
main.py - ASCII row encoding
main.py
Terminal output
- Frame rendering
main.py - Quit-key polling
main.py
Other components
- User
- Terminal
- OpenCV
- NumPy
Connections 16
- User → Video and width prompts: provides inputs
main.py - Video and width prompts → Video capture: opens video
main.py - Video capture → Playback loop: reads frames
main.py - Playback loop → Frame dimensions: gets dimensions
main.py - Frame dimensions → Resize and grayscale: resizes and converts
main.py - Resize and grayscale → Brightness mapping: maps intensities
main.py - Brightness mapping → ASCII row encoding: encodes pixels
main.py - ASCII row encoding → Frame rendering: joins rows
main.py - Frame rendering → Terminal: prints frame
main.py - Playback loop → Quit-key polling: polls key
main.py - Quit-key polling → Playback loop: stops on Q
main.py - Playback loop → Video capture: releases capture
main.py - Video capture → OpenCV: uses video API
main.py - Resize and grayscale → OpenCV: uses image operations
main.py - Quit-key polling → OpenCV: checks key
main.py - Brightness mapping → NumPy: uses arrays
main.py