text.mp4 is a project that takes a video as input, converts each frame into ASCII art using any font you want, and generates a text-based video output along with the ASCII frames.
Example (takes a few seconds to load):
- GNU
make
- OpenCV4 (
libopencv-dev
) - g++ compiler (for C++ engine)
- Python 3.x (for Python engine and video linking)
- pip3 (for installing Python dependencies)
- Clone the repository:
git clone https://github.com/yantavares/text.mp4.git
cd text.mp4
- Install required dependencies:
make install
-
(Optional) Add your desired video file to the
videos
directory, or use the providedSampleVideo.mp4
. -
(Optional) Add your desired font (.ttf files) to the
fonts
directory, or use the providedComicMono.ttf
.
For non-UNIX systems, you need to install the dependencies manually. They are listed here.
You can also modify the Makefile
to change the default C++ compiler or Python version.
To run the project, use the make
command:
make
- Choose Engine: C++ or Python.
- The C++ engine is way faster, and so it is the recommended option.
- Default is C++.
- Select Font:
- Default is
Comic Mono
.
- Default is
- Choose Font Size:
- Choose a font size between 2 and 20.
- Default is 10.
- Provide Video Filename:
- You will be prompted to choose a video file from the
videos
directory. - Default is
SampleVideo.mp4
.
- You will be prompted to choose a video file from the
Observation: If no input is provided, the default values will be used.
- The output will be available inside the
output
directory, which contains:frames/
: Each frame as an ASCII image.text/
: ASCII text representation of each frame as a text file.text.mp4
: The final text-based video output.
This project is licensed under the MIT License.
Contributions are welcome! Please open an issue or a pull request for any changes or improvements.