Turn full movies or .MP4 Files into AI-generated movie trailers and summaries using OpenAI.
Example Video: Citizen Kane (1941)
#This repository only works on Windows PCs
#Clone the Git repository:
git clone https://github.com/keithhb33/AI-Movie-Shorts.git
#Navigate to the cloned repo:
cd AI-Movie-Shorts
#Install modules and dependencies within the cloned "AI-Movie-Shorts" directory:
python3 -m pip install -r requirements.txt
#Remove .placeholder files (Windows PowerShell Terminal Command):
Get-ChildItem -Recurse -Filter ".placeholder" | Remove-Item
Due to OpenAI's API usage rate costs, users must configure their own GPT 4o API keys.
Key acquisition guide here.
Once acquired, edit the config.json file:
# Replace with OpenAI and ElevenLabs API keys ('legacy' user OpenAI API keys are utilized here).
# IMPORTANT: OpenAI TIER 2 API ACCOUNT IS REQUIRED DUE TO CHARACTER LIMITS ON LEVEL 1.
config.json
After configuration:
#Run the terminal command in the "AI-Movie-Shorts" directory:
python3 main.py
An application GUI should appear.
Place .MP4 (movie) files into the "movies" directory. Ensure all filenames are the titles of their respective movies (Ex: "American Psycho.mp4")
Click "Start Generation"
If the algorithm cannot find a particular movie script, it will ask for you to place it in scripts/srt_files/{movie_title}_summary.txt. Find the movie script online and paste it into this file. Then rerun "Start Generation."
For non-public movies, the algorithm may have trouble finding an SRT file for the movie. If this error occurs, find an SRT file for your movie/video and place it in scripts/srt_files/{movie_title}.srt
After all narrations are complete, the GUI will indicate such. Processed movie shorts can be viewed in the "output" directory. Here is an example movie short: Watch Short
Users must configure the YouTube API to access their particular YouTube channel. This configuration is optional if users only wish to generate MP4 files.
Follow the steps here only under the "Requirements" heading. Configure your YouTube API here. Once the YouTube Data API web application has been configured, paste the correct "client_id" and "client_secret" into a client_secrets.json file.
After clicking "Upload All to Youtube" on the GUI, users should be asked to sign in to the Google account associated with their YouTube channel, and all of the outputted .MP4 files in the "output" directory will upload to YouTube.
Unfortunately, as of 2020 July, only audited and approved user-created YouTube APIs can be used to upload public videos to the platform. Using non-audited APIs to upload videos to YouTube results in the videos being locked as private. The audit application can be found here. The process usually only takes a few days.