An AI-powered video highlight generator that automatically extracts the most interesting segments from videos.
- Automated video highlight generation
- Scene detection and analysis
- Audio energy analysis for exciting moment detection
- Speech transcription with OpenAI's Whisper model
- Intelligent clip selection and assembly
- YouTube video support (download and process)
- Animated captions with speech synchronization and keyword highlighting
- Python 3.8 or higher
- FFmpeg (required for video processing)
- Clone the repository:
git clone https://github.com/bugkill3r/video-clipper.git
cd video-clipper- Install dependencies:
pip install -e .Or for development:
pip install -e ".[dev]"Basic usage:
videoclipper process path/to/video.mp4 --output-dir highlights/With advanced options:
videoclipper process path/to/video.mp4 \
--output-dir highlights/ \
--duration 60 \
--transcribe \
--whisper-model base \
--min-segment 3 \
--max-segment 15 \
--num-clips 5 \
--captions \
--highlight-words "important,keywords,to,highlight"You can directly process YouTube videos by providing a URL:
videoclipper process https://www.youtube.com/watch?v=dQw4w9WgXcQWith options:
videoclipper process https://www.youtube.com/watch?v=dQw4w9WgXcQ \
--output-dir custom_highlights/ \
--num-clips 3 \
--duration 45 \
--captionsfrom videoclipper import VideoProcessor
# Initialize the processor
processor = VideoProcessor("path/to/video.mp4")
# Run analysis
processor.analyze(transcribe=True, detect_scenes=True)
# Generate highlight clip
processor.create_highlight("output.mp4", max_duration=60, add_captions=True, highlight_keywords=["important", "words"])# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit installpytestOr with coverage:
pytest --cov=videoclipperMIT
The video clipper now supports animated captions that synchronize with speech timing:
- Captions are disabled by default and can be enabled with the
--captionsflag - Captions appear in short phrases (4-6 words) timed to match when words are spoken
- Keywords are automatically identified and highlighted in alternating yellow/green
- You can specify your own highlight words with the
--highlight-wordsoption - The style matches viral social media videos with a dark background and highlighted words
- Word-by-word highlighting makes important terms stand out for viewers
Example usage:
videoclipper process video.mp4 --captions --highlight-words "important,keywords,to,highlight"Contributions are welcome! Please feel free to submit a Pull Request.