AI-assisted first cut — gets you 5 strong draft clips from any stream, fast.
StreamClipper runs an end-to-end pipeline: find → download → transcribe → score → rerank → cut → deliver. No manual scrubbing, no export queues. Just clips in your Telegram.
Find video → Download → Whisper transcribe → LLM candidates → Vision rerank → Quality filter → ffmpeg cut → Telegram
Every run writes three inspectable artifacts to output/<video_id>_vision/:
candidates.json— all LLM-generated clip proposalsranking.json— vision model scoresselection.json— final selected clips with policy applied
| Requirement | Details |
|---|---|
| OS | Windows 10 / 11 (current target) |
| Python | 3.10+ (3.11 or 3.12 recommended) |
| ffmpeg + ffprobe | Both must be on PATH |
| Internet | YouTube, Groq, and Telegram APIs called at runtime |
Download from python.org. During install, check "Add Python to PATH".
python --versionOption A — winget (Windows):
winget install Gyan.FFmpegOption B — manual: Download a build, extract, and add the bin/ folder to your PATH.
Verify:
ffmpeg -version
ffprobe -versiongit clone <your-repo-url>
cd StreamClipperpython -m venv .venv
.venv\Scripts\activatepip install --upgrade pip
pip install -r requirements.txtWhisper is already included in requirements.txt (openai-whisper + torch), but on first run it downloads the selected model automatically.
Default in config.yaml:
whisper_model: "base"You can switch to:
tiny(fastest, lowest accuracy)base(recommended default)small(better accuracy, slower)medium/large(best quality, much slower/heavier)
Optional pre-download (so first pipeline run is faster):
python -c "import whisper; whisper.load_model('base')"copy config.example.yaml config.yamlOpen config.yaml and fill in:
youtube_channel_id: "YOUR_CHANNEL_ID"
youtube_api_key: "YOUR_YT_KEY"
groq_api_key: "YOUR_GROQ_KEY"
telegram_bot_token: "YOUR_BOT_TOKEN"
telegram_chat_id: "YOUR_CHAT_ID"- Message @BotFather and run
/newbot - Copy the bot token →
telegram_bot_token - Send any message to your new bot, then open:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Copy the
chat.idvalue →telegram_chat_id
- Create a project in Google Cloud Console
- Enable YouTube Data API v3
- Create an API key →
youtube_api_key - Find your target channel ID →
youtube_channel_id
- Create an account at console.groq.com
- Generate an API key →
groq_api_key - Optionally change models in config:
groq_model— candidate generationgroq_vision_model— vision reranking
python pipeline.py "pragyan chakra sih"Or use the batch shortcut:
run_streamclipper.bat "pragyan chakra sih"python pipeline.py health # verify API connectivity
python pipeline.py status # show last run state
python pipeline.py # auto polling mode (continuous)| Key | What it controls |
|---|---|
max_candidates |
Upper bound on LLM clip candidates per run |
target_final_clips |
How many clips to aim for in the final selection |
quality_* |
Score thresholds — clips below these are dropped |
min_* |
Minimum acceptance policy (overrides quality gate) |
preselection_backfill_* |
LLM score backfill limits before selection runs |
created_backfill_* |
LLM score backfill limits for post-creation clips |
telegram_retries |
Retry budget for Telegram delivery failures |
groq_retries |
Retry budget for Groq API failures |
youtube_api_retries |
Retry budget for YouTube API failures |
| Video length | Estimated runtime |
|---|---|
| 3–10 minutes | ~2–8 minutes |
| 30–60 minutes | ~8–25 minutes |
| 2–3 hour stream | ~20–60+ minutes |
Times vary with Groq API latency and vision reranking workload.
If StreamClipper can't produce a full output it degrades gracefully:
- Sends any partial clips it successfully cut
- Falls back to a "Top fallback picks" list delivered via Telegram
- On hard Groq rate limits: aborts early and notifies Telegram before exiting
⚠️ Never commit real credentials.
Only config.example.yaml belongs in the repo. config.yaml, output/, and temp/ are gitignored.
Before publishing:
- Revoke and regenerate any keys used locally
- Confirm
config.yamlis not in git history - Keep only
config.example.yamlin the repo
ffmpeg not found
Install ffmpeg and add the bin/ directory to your PATH environment variable. Restart your terminal after updating PATH.
Stopped due to rate limit
The run aborted by design to avoid burning retries on a capped API window. Wait for your Groq quota to reset and retry. Upgrading your Groq plan increases throughput.
Telegram messages not arriving
Check telegram_bot_token and telegram_chat_id in config.yaml. Confirm you sent at least one message to the bot from your account before running.
Slow run near vision/backfill stage Lower these config values to reduce API workload:
max_candidatespreselection_backfill_limitpreselection_backfill_time_budget_seconds
Whisper model download or load feels stuck
- First run can take time while downloading model weights.
- Keep
whisper_model: "base"for balanced speed/quality. - For low-RAM machines, use
tinyorbase.
StreamClipper is a product-style starter — clone, key, run. Not a black box, a fast first cut.