Generate professional YouTube Shorts with perfectly synchronized speech captions from any video.
- YouTube Shorts with Synchronized Captions: Convert any video into YouTube Shorts format with perfectly timed captions that only appear when people are talking
- Speech Detection: Advanced algorithm detects when people are speaking and only shows captions during those moments
- Multiple Shorts Generation: Automatically extracts the most engaging segments from longer videos
- Professional Formatting: Captions are placed with proper timing, fading, and formatting for maximum engagement
- Python 3.8+
- Flask
- OpenCV
- MoviePy
- SpeechRecognition
- ImageMagick (for text rendering)
- FFmpeg (recommended)
- yt-dlp (for YouTube video downloads)
- Clone the repository:
git clone https://github.com/yourusername/youtube-shorts-caption-generator.git
cd youtube-shorts-caption-generator
- Install the required packages:
pip install -r requirements.txt
- Install external dependencies:
- ImageMagick: Required for text rendering. Download here
- FFmpeg: Recommended for better video processing. Download here
- Start the Flask application:
python run.py
-
Open your web browser and go to
http://127.0.0.1:5000 -
Either:
- Enter a YouTube URL in the input field
- Upload a video file using the file picker
-
Click "Generate Captioned Shorts" and wait for processing to complete
-
View and download your captioned shorts!
- Video Input: Process YouTube videos or uploaded files
- Speech Detection: Analyze audio to detect when people are talking
- Segment Extraction: Identify and extract the most engaging segments
- Caption Generation: Transcribe speech and generate precisely timed captions
- Shorts Formatting: Convert to vertical 9:16 format with professional caption styling
- Output Generation: Create downloadable MP4 files ready for YouTube Shorts
You can modify various settings in the .env file:
UPLOAD_FOLDER: Where processed videos are storedTEMP_FOLDER: For temporary processing filesYOUTUBE_API_KEY: Optional YouTube Data API key for enhanced features
This project is licensed under the MIT License - see the LICENSE file for details.