A terminal-based video player that converts video files into colored ASCII art and plays them in real-time.
- Frame Reading: OpenCV reads video frames sequentially
- Resizing: Each frame is resized to fit your terminal dimensions
- ASCII Conversion:
- Frame is converted to grayscale
- Each pixel's brightness maps to an ASCII character from the density table
- Original RGB colors are preserved using ANSI escape codes
- Display: Colored ASCII frame is printed to terminal
- Threading: Frame processing runs in a separate thread for smooth playback
- Play any video format supported by OpenCV
- Full-color ASCII art conversion using RGB values
- Playback controls (play, pause, speed adjustment)
- Automatic terminal size adaptation
- Multi-threaded frame processing for smooth playback
- Real-time playback speed indicator
- Python 3.7+
- OpenCV
- Clone this repository:
git clone https://github.com/manthanawgan/ascii-motion.git
cd ascii-motion- Install dependencies:
pip install -r requirements.txtpython main.py <video_file>python main.py my_video.mp4| Key | Action |
|---|---|
q or Q |
Quit the player |
Space |
Pause/Resume playback |
← (Left Arrow) |
Slow down playback (0.25x → 4x) |
→ (Right Arrow) |
Speed up playback (4x → 0.25x) |
The conversion uses this character density table (darkest to lightest):
.'`^",:;Il!i><~+_-?][}{1)(|\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$
This project is licensed under the MIT License - see the LICENSE file for details.