AI Shorts Creator automatically identifies and compiles the 5 most viral sections of your video using the Gemini 2.5 Flash API. Just provide your own video and transcriptโno YouTube API, face cropping, or manual selection needed.
GitHub Repository: AmiXDme/AI-Shorts-Creator
YouTube Channel: @AmiXDme
- Detects the top 5 viral segments (each at least 30 seconds long).
- Combines selected segments into a single compilation video.
- Optionally trims the final video to a 3-minute maximum.
- Fully automated โ no manual input required during execution.
- Python 3.8+
- Gemini API key (model:
gemini-2.5-flash) - FFmpeg (installed and accessible via system PATH)
git clone https://github.com/AmiXDme/AI-Shorts-Creator.git
cd AI-Shorts-Creator-
Windows:
python -m venv venv
-
Mac/Linux:
python3 -m venv venv
-
Windows:
venv\Scripts\activate
-
Mac/Linux:
source venv/bin/activate
pip install -r requirements.txt- Create a
video/directory in the root of the project. - Place your video file inside
video/and name itinput_video.mp4. - Place the transcript file (plain text or SRT) inside
video/and name ittranscript.txt. - Transcripts can be in any language (e.g., English, Bengali, etc.).
- Open the
.envfile in the root directory (create it if it doesn't exist). - Add the following line to the file:
GEMINI_API_KEY=your_api_key_here๐
โ ๏ธ Replaceyour_api_key_here๐with your actual Gemini API key every time before running the script.
- Then, open
autocropper.pyin a text editor (e.g., Notepad). This line should already exist at the top:# Set Gemini API key automatically import os os.environ['GEMINI_API_KEY'] = 'your_api_key_here๐'
โ ๏ธ Replace'your_api_key_here๐'with your actual Gemini API key every time before you run the script.
python autocropper.py- All outputs are saved in the
output/directory:- Extracted segments:
output/outputXXX.mp4 - Full compilation:
output/viral_compilation.mp4 - Trimmed (3-minute) version:
output/viral_compilation_3min.mp4 - Audio-only file:
output/combine.mp3
- Extracted segments:
- This tool only supports the
gemini-2.5-flashmodel. - No YouTube API or downloads โ your input video and transcript are required.
- No face detection/cropping or advanced editing features.
- Once setup is done, no user prompts are needed during runtime.
Crafted with automation in mind. Powered by Gemini and FFmpeg.
Inspired by NisaarAgharia/AI-Shorts-Creator