This project allows you to create short videos based on a given topic. Version 2 (improve transform image and real clip) can be found at: Colab notebook. The reason why version 2 is in this GitHub is that my laptop cannot afford the Nvidia-smi utility, which is required to install xformers for stable diffusion.
openai
: For interacting with the OpenAI API to generate text.python-dotenv
: For loading environment variables from a.env
file.moviepy
: For video editing and manipulation.pydub
: For audio manipulation.
ffmpeg
: For encoding and decoding video and audio.ghostscript
: For converting PDF files to images.imagemagick
: For image manipulation.
├── img
│ └──
├── result
│ └──
├── root
│ └──
├── script
│ └──
├── video
│ └──
├── .DS_Store
├── .gitignore
├── README.md
├── main.py
├── output_subtitle.srt
├── requirements.txt
└── secrets.py
-
Install dependencies:
pip install -r requirements.txt brew install ffmpeg ghostscript imagemagick
-
Create a
.env
file and set the following environment variables:OPENAI_API_KEY=your_openai_api_key
-
Run the script:
python main.py
-
Enter the topic for your video.
-
The script will generate a video file in the
video
folder.
- Make sure you have a valid OpenAI API key.
- The video generation process may take some time depending on the length of the video and the complexity of the topic.
- You can customize the video output by modifying the script.
Contributions are welcome! Feel free to open an issue or submit a pull request.