This Python project lets you convert video frames into ASCII art and display the resulting ASCII video in the terminal. It uses the ascii-magic
library to convert images to ASCII and cv2
to extract frames from a video file. The video can be played back in the terminal using symbols and dots.
ascii-video-converter
ascii-video-converter
is a Python-based tool that extracts frames from a video, converts them to ASCII art, and plays the ASCII video in the terminal. Users can control playback speed during the video playback. This project is compatible with Windows and uses ascii-magic
, PIL
, and cv2
.
I’ve created a video tutorial to demonstrate how this code works. Watch it below to see the project in action and follow along with the code:
You can also download the tutorial MP4 file directly from the repository:
- Extract frames from any video file.
- Convert video frames to ASCII art using customizable settings.
- Display ASCII video in the terminal with playback controls.
main.py
: The main script to run the project.ConvertAscii
: A class to convert images to ASCII.Display
: A class to handle ASCII video playback.ExtractFrame
: A class that extracts frames from a video.
-
Clone the repository:
git clone https://github.com/harshkasat/ascii-video-converter.git cd ascii-video-converter
-
Install the required Python libraries:
pip install -r requirements.txt
-
Create the
requirements.txt
file with the following dependencies:pillow opencv-python ascii-magic
To use the tool, provide the path to a video file as a command-line argument:
python main.py path_to_video.mp4
+
: Increase playback speed.-
: Decrease playback speed.q
: Quit playback.