This application allows you to generate mathematical animations using natural language descriptions. It uses OpenAI's GPT model to convert your descriptions into Manim code, which is then used to create beautiful mathematical animations.
- Python 3.7+
- FFmpeg
- LaTeX distribution (for rendering mathematical equations)
- OpenAI API key
- Clone this repository:
git clone https://github.com/rohitg00/manim-video-generator.git
cd manim-video-generator
- Install the required dependencies:
pip install -r requirements.txt
- Install Manim system dependencies:
# For macOS
brew install cairo ffmpeg
- Set up your environment variables:
cp .env.example .env
Then edit .env
and add your OpenAI API key.
- Start the Flask application:
python app.py
-
Open your web browser and navigate to
http://localhost:5000
-
Enter a description of the mathematical animation you want to create in the text area
-
Click "Generate Video" and wait for your animation to be created
Here are some example prompts you can try:
- "Create an animation showing a circle transforming into a square"
- "Show the unit circle with sine and cosine waves being traced out"
- "Demonstrate the Pythagorean theorem with animated squares on triangle sides"
- The application takes your natural language description and sends it to OpenAI's GPT model
- GPT generates the appropriate Manim code for your animation
- The code is executed using Manim to create an MP4 video
- The video is served back to your browser
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.