PreenCut is an intelligent video editing tool that automatically analyzes audio/video content using speech recognition and large language models. It helps you quickly find and extract relevant segments from your media files using natural language queries.
- Automatic Speech Recognition: Powered by WhisperX for accurate transcription
- AI-Powered Analysis: Uses large language models to segment and summarize content
- Natural Language Querying: Find clips using descriptive prompts like "Find all product demo segments"
- Smart Clipping: Select and export segments as individual files or merged video
- Batch Processing: find a specific topic across multiple files
- Re-analysis: Experiment with different prompts without reprocessing audio
- Clone the repository:
git clone https://github.com/roothch/PreenCut.git
cd PreenCut
- Install dependencies:
pip install -r requirements.txt
- Install FFmpeg (required for video processing):
# ubuntu/Debian
sudo apt install ffmpeg
# CentOS/RHEL
sudo yum install ffmpeg
# macOS (using Homebrew)
brew install ffmpeg
# Windows: Download from https://ffmpeg.org/
- Set up API keys (for LLM services):
First you need to set your llm services in LLM_MODEL_OPTIONS of
config.py
. Then set your API keys as environment variables:
# for example, if you are using DeepSeek and DouBao as LLM services
export DEEPSEEK_V3_API_KEY=your_deepseek_api_key
export DOUBAO_1_5_PRO_API_KEY=your_doubao_api_key
- Start the Gradio interface:
python main.py
- Access the web interface at http://localhost:7860
- Upload video/audio files (supported formats: mp4, avi, mov, mkv, ts, mxf, mp3, wav, flac)
- Configure options:
- Select LLM model
- Choose Whisper model size (tiny → large-v3)
- Add custom analysis prompt (Optional)
- Click "Start Processing" to analyze content
- View results in the analysis table:
- Start/end timestamps
- Duration
- Content summary
- AI-generated tags
- Use the "Re-analyze" tab to experiment with different prompts
- Use the "Cut" tab to select segments and choose export mode:
- Export as ZIP package
- Merge into a single video file
- Adjust WHISPERX_BATCH_SIZE based on available VRAM
- Reduce WHISPERX_MODEL_SIZE in config.py for faster processing
- Use smaller model sizes for CPU-only systems
This project is licensed under the MIT License. See the LICENSE file for details.