Skip to content

AmiXDme/AI-Shorts-Creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AI Shorts Creator (Gemini 2.5 Flash Only)

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


๐Ÿš€ Features

  • 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.

๐Ÿ“† Requirements

  • Python 3.8+
  • Gemini API key (model: gemini-2.5-flash)
  • FFmpeg (installed and accessible via system PATH)

โš™๏ธ Setup

1. Clone or Download the Repository

git clone https://github.com/AmiXDme/AI-Shorts-Creator.git
cd AI-Shorts-Creator

2. Create a Virtual Environment

  • Windows:

    python -m venv venv
  • Mac/Linux:

    python3 -m venv venv

3. Activate the Virtual Environment

  • Windows:

    venv\Scripts\activate
  • Mac/Linux:

    source venv/bin/activate

4. Install Dependencies

pip install -r requirements.txt

5. Prepare Input Files

  • Create a video/ directory in the root of the project.
  • Place your video file inside video/ and name it input_video.mp4.
  • Place the transcript file (plain text or SRT) inside video/ and name it transcript.txt.
  • Transcripts can be in any language (e.g., English, Bengali, etc.).

6. Set Your Gemini API Key

  • Open the .env file 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๐Ÿ˜’

โš ๏ธ Replace your_api_key_here๐Ÿ˜’ with your actual Gemini API key every time before running the script.

  • Then, open autocropper.py in 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.

7. Run the Script

python autocropper.py

๐Ÿ“ค Output

  • 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

๐Ÿ“Œ Notes

  • This tool only supports the gemini-2.5-flash model.
  • 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.

๐Ÿง  Credits

Crafted with automation in mind. Powered by Gemini and FFmpeg.
Inspired by NisaarAgharia/AI-Shorts-Creator

About

AI Shorts Creator uses Gemini 2.5 Flash API to auto-find 5 viral video segments (>30s) & compile them into a 3-min clip. No YouTube or manual edits needed. Supports any language transcript. Easy setup, runs via command line. Outputs viral compilation & audio. ๐Ÿš€๐ŸŽฅ

Resources

Stars

Watchers

Forks

Contributors

Languages