ShortGenerator/README.md

83 lines
2.3 KiB
Markdown

# 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
1. Clone the repository:
```bash
git clone https://git.ptbox.org/klop51/ShortGenerator.git
cd ShortGenerator
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Ensure FFmpeg is installed and accessible from your PATH
## Usage
### Basic usage:
```bash
python shorts_generator2.py your_video.mp4
```
This will:
1. Analyze your video for loud/exciting moments
2. Generate up to 3 short clips (5 seconds each by default)
3. Add dynamic subtitles with word-by-word highlighting
4. Save the shorts in the `shorts/` folder
### Customization
You can modify the script parameters:
- `max_clips`: Number of shorts to generate
- `chunk_duration`: Length of each short clip
- `threshold_db`: Audio loudness threshold for moment detection
- `output_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.