
1 / 3
Project
Streamweaver
in production
What it does
Provides a single API endpoint where developers upload a raw MP4 video and receive back: an AES-128 encrypted HLS adaptive stream, AI-generated chapter markers (WebVTT), a full timestamped transcript, seek-bar thumbnail sprites, and a content-sensitivity threat analysis — all delivered via CDN with a key server that enforces auth on every decryption key request.
Problem
Building secure video infrastructure is extremely complex. Developers today must manually configure FFmpeg, OpenSSL, and transcription pipelines; handle resumable uploads for large files; implement content-aware encryption policies; and manage ephemeral processing infrastructure — often resulting in months of DevOps work, fragile pipelines, and endless security audits.
Approach
A fully decoupled, event-driven microservice architecture with four layers: (1) A Rust/Actix-Web API gateway that accepts uploads and responds instantly with 202 Accepted, (2) A Redis queue that bridges the fast HTTP layer with slow video processing, (3) A Rust async worker that runs a parallel pipeline — Branch A handles audio extraction → Whisper transcription → AI chapter generation, while Branch B handles AES key generation → encrypted HLS transcode + sprite generation — both branches execute concurrently via Tokio, (4) S3-compatible cloud storage with CDN delivery and a dedicated key server that never stores encryption keys alongside video segments.
Highlights
- Parallel processing pipeline: audio (WAV → Whisper → chapters) and video (AES → HLS → sprites) branches run concurrently via Tokio, cutting total processing time nearly in half
- Context-aware encryption: Whisper transcripts are scanned for financial keywords, PII patterns, and compliance terms to automatically determine threat level and encryption strength (static vs. rotating AES keys)
- Zero-trust key architecture: AES decryption keys are stored in PostgreSQL and served by the Rust API with per-request auth — even a full S3 bucket exfiltration yields nothing playable
- Whisper.cpp integration: Self-hosted speech-to-text via a dedicated Docker container running the whisper-server binary, producing word-level timestamps at ~6x realtime on CPU
- AI-powered chapter generation: Transcripts are segmented into intelligent chapters using NLP topic analysis with keyword overlap merging
- Full Docker Compose orchestration: 6-service stack (PostgreSQL, Redis, Whisper server, Rust backend, Rust worker, Next.js frontend) with health checks and dependency ordering
- Chunked upload support: Frontend uses Cloudinary chunked uploads for large video files with progress tracking
- Clerk JWT authentication: Full auth flow with JWKS validation on the Rust backend and protected Next.js routes
- Sprite sheet generation: FFmpeg captures frames every 5 seconds and tiles them into a single JPEG sprite with a companion VTT for seek-bar preview
- Memory-optimized design: Entire processing pipeline fits within ~771 MB peak RAM, comfortable on a 2 GB VPS