Transform 60-minute podcasts and lectures into 10 viral vertical clips β fully automated.
π Quick Start β’ π¬ Demo β’ π Docs β’ π Hackathon Edge
AttentionX is a fully automated AI pipeline that takes a long-form video (lecture, podcast, interview, webinar) and produces platform-ready 9:16 vertical short clips complete with:
- β Smart clip selection β Detects emotionally charged, high-impact moments using audio energy + NLP
- β Face-tracked vertical crop β Converts 16:9 β 9:16 automatically keeping the speaker centered
- β Burned-in subtitles β TikTok-style bold captions with word-level timestamps
- β Viral hooks β Claude AI generates 3 platform-specific hooks per clip (TikTok, Instagram, YouTube)
- β One-click pipeline β Upload β Process β Download. Zero manual editing
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER INTERFACE (Streamlit) β
β Upload Video βββΊ Track Progress βββΊ Download β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTP REST API
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β FASTAPI BACKEND β
β POST /upload βββΊ Background Job βββΊ GET /status βββΊ /results β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β PROCESSING PIPELINE β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β STEP 1 β β STEP 2 β β STEP 3 β β STEP 4 β β
β β FFmpeg ββββΊβ Whisper ββββΊβ Librosa ββββΊβ FFmpeg β β
β β Audio β β STT β β + NLP β β Clip β β
β β Extract β βTranscribeβ βDetection β β Extract β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ β
β β STEP 5 β β STEP 6 β β STEP 7 β β
β βMediaPipe ββββΊβ FFmpeg ββββΊβ Claude β β
β β Face β βSubtitle β β Hook β β
β β Tracking β β Burning β βGenerator β β
β ββββββββββββ ββββββββββββ ββββββββββββ β
β β
β βΌ β
β OUTPUT: Vertical MP4 + SRT + JSON Metadata β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Feature | Technology | Detail |
|---|---|---|
| π΅ Audio Extraction | FFmpeg | WAV 16kHz mono, loudness normalized |
| π Transcription | OpenAI Whisper | Word-level timestamps, multi-language |
| π₯ Emotion Detection | Librosa + NLP | RMS energy + pitch variance + keyword scoring |
| βοΈ Clip Extraction | FFmpeg | Lossless stream copy or re-encode |
| π± Face Tracking | MediaPipe | Smooth 16:9β9:16 crop with exponential smoothing |
| π¬ Subtitles | FFmpeg drawtext | TikTok-style bold burned-in captions |
| πͺ Viral Hooks | Claude AI | 3 platform-specific hooks per clip |
| π Async Processing | FastAPI + BackgroundTasks | Non-blocking, real-time status polling |
| π¦ Export | JSON + SRT + MP4 | Ready to upload to any platform |
# Required system tools
python3.11+
ffmpeg # brew install ffmpeg | sudo apt install ffmpeg
git# 1. Clone repository
git clone https://github.com/yourusername/attentionx.git
cd attentionx
# 2. Run the setup script (handles everything)
chmod +x start.sh
./start.shThat's it! Open http://localhost:8501 in your browser.
# 1. Clone
git clone https://github.com/yourusername/attentionx.git
cd attentionx
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY
# 5. Create storage directories
mkdir -p storage/uploads storage/outputs storage/temp
# 6. Start backend (Terminal 1)
cd backend
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
# 7. Start frontend (Terminal 2)
cd frontend
streamlit run app.py --server.port 8501# 1. Clone and configure
git clone https://github.com/yourusername/attentionx.git
cd attentionx
cp .env.example .env
# Edit .env with your API key
# 2. Run with Docker Compose
docker-compose up --build
# Access:
# Frontend: http://localhost:8501
# API Docs: http://localhost:8000/docsattentionx/
βββ π README.md
βββ π requirements.txt
βββ π .env.example
βββ π .gitignore
βββ π Dockerfile
βββ π docker-compose.yml
βββ π start.sh
β
βββ π§ backend/
β βββ main.py # FastAPI app + endpoints
β βββ pipeline/
β β βββ __init__.py
β β βββ processor.py # Master pipeline orchestrator
β β βββ audio_extractor.py # Step 1: FFmpeg audio extraction
β β βββ transcriber.py # Step 2: Whisper STT
β β βββ emotion_detector.py # Step 3: Librosa + NLP scoring
β β βββ clip_extractor.py # Step 4: Clip extraction
β β βββ face_tracker.py # Step 5: MediaPipe face tracking
β β βββ subtitle_generator.py # Step 6: Subtitle burning
β β βββ hook_generator.py # Step 7: Claude AI hooks
β βββ utils/
β βββ __init__.py
β βββ config.py # Pydantic settings
β βββ helpers.py # Utility functions
β
βββ π¨ frontend/
β βββ app.py # Streamlit UI
β
βββ π¦ storage/ # Auto-created at runtime
βββ uploads/ # Raw uploaded videos
βββ outputs/ # Processed clips + metadata
βββ temp/ # Intermediate files (auto-cleaned)
AttentionX uses Claude AI for viral hook generation. To enable this:
- Go to console.anthropic.com
- Create an account (free tier available)
- Generate an API key
- Add it to your
.envfile:ANTHROPIC_API_KEY=sk-ant-your-key-here
Note: Hook generation works without an API key using our built-in template engine. The AI-powered hooks are simply higher quality.
Once running, visit http://localhost:8000/docs for interactive Swagger UI.
POST /upload Upload video + start processing
GET /status/{job_id} Poll processing progress
GET /results/{job_id} Get completed results
GET /download/{job_id}/{filename} Download a clip
DELETE /jobs/{job_id} Clean up job data
GET /jobs List all jobs
GET /health Service health check
import requests
# Upload video
with open("my_podcast.mp4", "rb") as f:
resp = requests.post(
"http://localhost:8000/upload",
files={"file": ("my_podcast.mp4", f, "video/mp4")},
params={"max_clips": 5, "clip_duration": 60, "generate_hooks": True}
)
job_id = resp.json()["job_id"]
# Poll for completion
import time
while True:
status = requests.get(f"http://localhost:8000/status/{job_id}").json()
print(f"Progress: {status['progress']}% - {status['stage']}")
if status["status"] in ["completed", "failed"]:
break
time.sleep(3)
# Get results
results = requests.get(f"http://localhost:8000/results/{job_id}").json()
for clip in results["clips"]:
print(f"Clip {clip['clip_number']}: {clip['title']}")
print(f"Download: {clip['download_url']}")Input: 60-minute tech podcast (16:9 horizontal)
Output (5 clips, processed in ~8 minutes on CPU):
Clip 1 β 04:23 β 05:23 | Score: 87%
Title: "The Hidden Cost of Technical Debt Nobody Talks About"
Hook: "EVERY STARTUP FAILS FOR THIS EXACT REASON"
Tags: #startup #techdebt #programming #viral #coding
Clip 2 β 18:41 β 19:41 | Score: 82%
Title: "Why 90% of Developers Get This Completely Wrong"
Hook: "THEY NEVER TEACH YOU THIS IN COMPUTER SCIENCE"
Tags: #developer #coding #javascript #learn #shorts
Clip 3 β 34:12 β 35:12 | Score: 79%
Title: "The Real Reason Your Code Is Slow"
Hook: "WARNING: THIS MISTAKE COSTS COMPANIES MILLIONS"
Tags: #performance #coding #software #engineering #fyp
1
00:00:00,000 --> 00:00:01,200
THE TRUTH IS
2
00:00:01,200 --> 00:00:02,800
NOBODY TALKS ABOUT
3
00:00:02,800 --> 00:00:04,400
TECHNICAL DEBT UNTIL
4
00:00:04,400 --> 00:00:06,000
IT'S TOO LATEAll settings are in .env or backend/utils/config.py:
| Variable | Default | Description |
|---|---|---|
WHISPER_MODEL |
base |
tiny/base/small/medium/large |
WHISPER_DEVICE |
cpu |
cpu or cuda |
MAX_CLIPS_PER_VIDEO |
10 |
Max clips to generate |
DEFAULT_CLIP_DURATION |
60 |
Clip length in seconds |
OUTPUT_WIDTH |
1080 |
Output video width |
OUTPUT_HEIGHT |
1920 |
Output video height |
EMOTION_PEAK_THRESHOLD |
0.65 |
Min score to select as peak |
FACE_TRACKING_SMOOTH_FACTOR |
0.15 |
Camera smoothness (lower = smoother) |
SUBTITLE_FONT_SIZE |
60 |
Caption font size |
# Install Railway CLI
npm install -g @railway/cli
railway login
railway init
railway up# Connect GitHub repo to render.com
# Set build command: pip install -r requirements.txt
# Set start command: cd backend && uvicorn main:app --host 0.0.0.0 --port $PORT# Expose local server (for demos without deployment)
# Install ngrok: https://ngrok.com
ngrok http 8501 # Frontend
ngrok http 8000 # Backend API1. π§ Multi-Signal Emotion Detection We don't just look for loud moments. Our proprietary scoring combines:
- Audio RMS energy (volume peaks)
- Spectral flux (rapid speech dynamics)
- Pitch variation (emotional vocal range)
- NLP keyword scoring (power words database of 60+ terms)
This creates a composite impact score that identifies moments humans would actually find compelling.
2. π± Smooth Face-Tracked Vertical Crop Unlike naive center-crop tools, we use MediaPipe face detection + exponential position smoothing to create a natural "camera operator" feel. The crop window follows the speaker without jarring jumps.
3. πͺ Platform-Native AI Hooks Hooks aren't generic β they're tailored per platform:
- TikTok: FOMO + shock + curiosity gap
- Instagram: Lifestyle + aspiration + save-worthy
- YouTube Shorts: Question-based + SEO-optimized
"Let me show you a problem every content creator faces.
You spend 3 hours recording a podcast.
You get 200 views.
Meanwhile, a 60-second clip from that same podcast
could get 2 million views on TikTok.
The problem isn't your content. It's distribution.
AttentionX solves this automatically.
[LIVE DEMO: Upload a 10-min video]
Watch as our AI:
1. Finds the 5 most emotionally compelling moments β not just the loudest ones
2. Converts horizontal video to vertical with face tracking
3. Burns TikTok-style captions
4. Generates platform-specific viral hooks using Claude AI
[Show results in 60 seconds on a pre-processed video]
What took an editor 4 hours now takes 8 minutes.
We're not replacing creators β we're giving them a 10x multiplier.
Thank you."
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
MIT License β see LICENSE for details.
- OpenAI Whisper β Speech recognition
- Google MediaPipe β Face detection
- Librosa β Audio analysis
- FFmpeg β Video processing
- Anthropic Claude β AI hook generation