Read this in other languages: English | KR.
An automated Python tool that takes a long-form video, identifies the most engaging highlights ("hooks"), and automatically edits them into viral short-form videos (TikTok, YouTube Shorts, Instagram Reels).
I also make CLI!!
- Interactive CLI: Easy-to-use menu-driven command-line interface.
- Smart Hook Extraction: Leverages Large Language Models (Gemini or OpenAI) to analyze transcripts and find the most engaging parts of your video.
- High-Performance Transcription: Uses
faster-whisperfor fast and accurate local speech-to-text conversion. - Dynamic Face Tracking: Automatically detects and tracks faces, cropping landscape (16:9) videos into portrait (9:16) format while keeping the subject centered.
- Bouncing Subtitles: Generates TikTok-style word-by-word highlighted subtitles with a dynamic bounce effect.
- Auto Background Blur: Fills the background with a blurred version of the original video for a premium look.
- Python 3.12 or higher.
- FFmpeg: Must be installed and added to your system's PATH.
- GPU (Optional but recommended): For faster Whisper transcription and NVENC video encoding (NVIDIA).
RTX 50XX Series Currently, there may be library compatibility issues with NVIDIA RTX 50-series GPUs, which can cause the Whisper transcription speed to be significantly slower than expected. This is a known issue with the underlying libraries and may be resolved in future updates.
This project uses uv for lightning-fast Python package management.
-
Install uv:
pip install uv
-
Clone this repository:
git clone https://github.com/liquidtii/Auto_Shorts_Generator.git cd Auto_Shorts_Generator -
Install dependencies (this will automatically create a virtual environment and install packages using
pyproject.toml/uv.lock):uv sync
Run the main script using uv to start the interactive CLI:
uv run main.pyOn your first run, the tool will guide you through an initial setup. You will need to provide:
- LLM Provider: Choose between
geminioropenai. - API Key: Your Gemini API Key or OpenAI API Key (depending on your choice).
- Other Settings: Output directory, Whisper model size (tiny, base, small, medium, large), subtitle font settings, etc.
Settings are saved to settings.json so you don't have to enter them every time.
main.py: The entry point of the application. Handles the interactive CLI, user settings, and orchestrates the video generation pipeline.extractor.py: Handles audio extraction from the video, speech-to-text transcription usingfaster-whisper, and hook analysis using the chosen LLM API.video_editor.py: The core video editing engine usingmoviepyandOpenCV. Handles face tracking, 9:16 cropping, background blurring, audio mixing, and generating word-by-word subtitle clips.
You can manually edit settings.json or update it via the CLI Menu (Option 2).
llm_provider: "gemini" or "openai"model_size: Whisper model size (default: "base")max_duration: Maximum length of the generated short in seconds (default: 60)highlight_color: Color of the spoken word in subtitles (default: "yellow")
This project is open-source and available under the MIT License.


