Text2Slide is a Python (CLI or GUI) tool that converts a simple text file with slide titles and content into an animated video presentation using Manim.
For now, the generated slides are basic, and there is no major customization other than text color, but it will come.
- Parses a plain text file structured with slide titles and content.
- Automatically generates a Manim scene from the slides.
- Supports rendering videos at multiple quality levels:
-ql: Low (480p, 15 FPS)-qm: Medium (720p, 30 FPS)-qh: High (1080p, 60 FPS)-qp: 2K (1440p, 60 FPS)-qk: 4K (2160p, 60 FPS)
- Supports various text colors (see
--help). - Optionally, add an MP3 audio track as background music.
- Outputs the final video in a dedicated
output/folder. - Cleans up temporary files after rendering.
# For CLI:
python src/main.py input.txt <quality> <output_filename> [audio.mp3]
# or
python src/main.py --help
# For GUI:
python src/gui.pyinput.txt: Path to the input text file with slide data.<quality>: Render quality flag. Choose one of-ql,-qm,-qh,-qp, or-qk.<output_filename>: Desired name for the output video file (without extension).[audio.mp3](optional): Path to an MP3 file to use as background music.--help: Show usage and supported options.
Without audio:
python src/main.py input.txt -qm my_presentationWith audio:
python src/main.py input.txt -qm my_presentation assets/music.mp3Please see the provided input_example.txt file for a sample input and syntax details.
The input text file should follow this structure:
Slide 1: Title of Slide One
Content line 1
Content line 2
Slide 2: Title of Slide Two
More content here
- Each slide starts with a line beginning with
Slide X:(where X is any number). - Following lines until the next slide, header is treated as content.
-
Clone the repository.
-
Install dependencies:
pip install -r requirements.txtmanim_files/ (created after generating the first video)
output/ (created after generating the first video)
src/audio.py
src/backend.py
src/gui.py
src/help.py
src/main.py
.gitignore
input_example.txt
README.md
requirements.txt
- Now supports a GUI
- The script validates quality flags, file names, and color options.
- The rendered video is saved as
output/<output_filename>.mp4. - If an MP3 is provided, it is added as background audio using MoviePy.
- Temporary files created during rendering are automatically cleaned up.
manim_files/contains Manim's intermediate rendering files and is ignored in version control.
Feel free to open issues or contribute!