- Read topics on which the Shorts are to be made.
- Get text on the topic from ChatGPT API.
- Get images as per the topic's picture description from Bing Images API.
- Convert the text into speech using GTTS API.
- Generate video by combining images, speech and background music using MoviePy module.
- Get timed subtitles by transcribing the speech using OpenAI Whisper API.
- Generate final video by attaching the subtitles.
# cd into-this-repo
# Get OpenAI API key from https://platform.openai.com/account/api-keys
# Put this key in .env.example
mv .env.example .env
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Put prompts into "config.py"
python main.py
# Generated YoutTube Shorts videos in "./shorts/"
- Downloading Pictures: https://stackoverflow.com/a/64460085/21929891
- Generating Video: https://www.geeksforgeeks.org/convert-audio-to-video-using-static-images-in-python/
- Burning Subtitles: https://github.com/ramsrigouthamg/Supertranslate.ai/blob/main/Burn_Subtitles_Into_Video/Burn_Subtitles_to_video_using_Moviepy.ipynb