- Implemented a new subtitle generator tool using Tkinter for GUI. - Added functionality to load video and SRT files, and display subtitles. - Created text rendering using PIL for better font handling. - Introduced preset saving and loading for subtitle settings and word selections. - Added support for highlighting specific words in subtitles. - Included multiple preset slots for different configurations. - Created JSON files for storing presets and word selections. |
||
|---|---|---|
| .github | ||
| .gitignore | ||
| app2.py | ||
| app.py | ||
| README.md | ||
| requirements.txt | ||
| shorts_generator2.py | ||
| shorts_generator.py | ||
| subtitle_generator2_fixed.py | ||
| subtitle_generator2.py | ||
| subtitle_generator.py | ||
| subtitle_gui_presets_slot_1.json | ||
| subtitle_gui_presets_slot_2.json | ||
| subtitle_gui_presets.json | ||
| subtitles.srt | ||
| word_presets_slot_1.json | ||
| word_presets_slot_2.json | ||
| word_presets.json | ||
ShortGenerator
A Python-based tool for automatically generating short-form videos from longer video content, optimized for platforms like TikTok, Instagram Reels, and YouTube Shorts.
Features
- Automatic loud moment detection: Identifies exciting parts of videos using audio analysis
- AI-powered transcription: Uses Whisper for accurate speech-to-text conversion
- Dynamic subtitles: Creates engaging, word-by-word highlighted subtitles in the style of popular content creators
- Vertical format optimization: Automatically converts landscape videos to 9:16 aspect ratio
- Batch processing: Generate multiple shorts from a single video
Requirements
- Python 3.8+
- FFmpeg
- Required Python packages (install with
pip install -r requirements.txt):- moviepy
- faster-whisper
- numpy
Installation
- Clone the repository:
git clone https://git.ptbox.org/klop51/ShortGenerator.git
cd ShortGenerator
- Install dependencies:
pip install -r requirements.txt
- Ensure FFmpeg is installed and accessible from your PATH
Usage
Basic usage:
python shorts_generator2.py your_video.mp4
This will:
- Analyze your video for loud/exciting moments
- Generate up to 3 short clips (5 seconds each by default)
- Add dynamic subtitles with word-by-word highlighting
- Save the shorts in the
shorts/folder
Customization
You can modify the script parameters:
max_clips: Number of shorts to generatechunk_duration: Length of each short clipthreshold_db: Audio loudness threshold for moment detectionoutput_folder: Where to save generated shorts
Output
Generated shorts will be:
- 1080x1920 resolution (9:16 aspect ratio)
- MP4 format with H.264 codec
- Include dynamic subtitles with highlighting effects
- Automatically cropped and centered from the original video
File Structure
ShortGenerator/
├── shorts_generator2.py # Main script (latest version)
├── shorts_generator.py # Legacy version
├── fonts/ # Font files for subtitles
├── shorts/ # Generated short videos (gitignored)
└── README.md # This file
Contributing
Feel free to submit issues and enhancement requests!
License
This project is open source. Please check the license file for details.