Go to file
klop51 336ef32a49 Add subtitle generator with GUI and preset management
- 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.
2025-08-07 00:34:27 +02:00
.github Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
.gitignore Initial commit: ShortGenerator project setup 2025-08-05 00:34:23 +02:00
app2.py feat: Implement subtitle positioning tool with GUI 2025-08-06 20:41:10 +02:00
app.py feat: Implement subtitle positioning tool with GUI 2025-08-06 20:41:10 +02:00
README.md Fix formatting in README.md by removing extraneous author name 2025-08-05 00:44:11 +02:00
requirements.txt Initial commit: ShortGenerator project setup 2025-08-05 00:34:23 +02:00
shorts_generator2.py feat: Implement subtitle positioning tool with GUI 2025-08-06 20:41:10 +02:00
shorts_generator.py Initial commit: ShortGenerator project setup 2025-08-05 00:34:23 +02:00
subtitle_generator2_fixed.py Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
subtitle_generator2.py Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
subtitle_generator.py feat: Implement subtitle positioning tool with GUI 2025-08-06 20:41:10 +02:00
subtitle_gui_presets_slot_1.json Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
subtitle_gui_presets_slot_2.json Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
subtitle_gui_presets.json Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
subtitles.srt feat: Implement subtitle positioning tool with GUI 2025-08-06 20:41:10 +02:00
word_presets_slot_1.json Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
word_presets_slot_2.json Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00
word_presets.json Add subtitle generator with GUI and preset management 2025-08-07 00:34:27 +02:00

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:
git clone https://git.ptbox.org/klop51/ShortGenerator.git
cd ShortGenerator
  1. Install dependencies:
pip install -r requirements.txt
  1. Ensure FFmpeg is installed and accessible from your PATH

Usage

Basic usage:

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.