This project is a tool that automatically generates explanatory videos from a given prompt. It leverages the following technologies:
- Pydantic AI: Used to create intelligent agents that process the prompt and generate the video script.
- Gemini: The LLM that powers the agent, understanding the prompt and generating creative content.
- Manim: A powerful animation engine for creating mathematical and explanatory videos.
- MoviePy: A library for video editing, used here to combine the Manim-generated scenes into a final video.
In essence, you provide a prompt, and the system uses AI to create a video explaining the topic described in the prompt.
- Automatic video generation from a text prompt.
- Uses Gemini for prompt understanding and content creation.
- Leverages Manim for high-quality animations.
- Combines animations into a complete video using MoviePy.
Here's how to get the video generator up and running:
-
Clone the Repository:
git clone <your_repository_url> cd <your_repository_directory>
(Replace
<your_repository_url>and<your_repository_directory>with the actual URL and directory.) -
Configure the API Key:
-
Create a copy of the
config-example.pyfile and rename it toconfig.py. -
Open
config.pyand add your Gemini API key:api_key='<google-gemini-api-key>'" # Replace with your actual Gemini API key
-
-
Install Dependencies:
- It's highly recommended to use a virtual environment to manage dependencies. If you're not familiar with them, here's a quick primer:
python3 -m venv .venv #create a virtual environment source .venv/bin/activate #activate the virtual environment. If on windows use .\.venv\Scripts\activate
- Install the required Python packages:
pip install -r requirements.txt
- It's highly recommended to use a virtual environment to manage dependencies. If you're not familiar with them, here's a quick primer:
-
Run the Application:
streamlit run app.py or python app_no_ui.py
- Run the
app.py/app_no_ui.pyscript as described in the setup instructions. - The application will take a text prompt as input. (in streamlit/cmd line)
- The AI will process the prompt, generate a video script, and then create the video.
- The generated video will be saved to a
final.mp4file.