01 — AI Video Processing SaaS

ViralRot

Production-grade AI platform converting 2-hour videos into viral shorts. Built on a distributed architecture utilizing Inngest, Modal GPUs, and DeepSeek v3 for automated video pipelines.

Next.js SSR tRPC Inngest FastAPI Modal GPU DeepSeek v3 FFmpeg Polar.sh
The challenge

Heavy processing.
Zero blocked threads.

Problem

Manually scrubbing through a 2-hour podcast to find viral moments, extracting clips, detecting active speakers, and burning in subtitles takes creators hours of tedious work.

From an engineering perspective, processing massive video files (up to 500MB) requires complex orchestration. Synchronous HTTP requests timeout. FFmpeg chokes standard CPUs. And running LLMs + Whisper concurrently requires serious, scalable GPU infrastructure.

Solution

ViralRot decouples the frontend from the heavy lifting. Next.js handles the UI and tRPC APIs, instantly offloading processing to Inngest background jobs. Inngest orchestrates the pipeline, passing tasks to FastAPI workers.

The heavy compute runs on Modal GPU workers: a custom fine-tuned Whisper model handles Hinglish transcription, DeepSeek v3 reasons about viral moments alongside LR-ASD (Active Speaker Detection), and FFmpeg handles the final compositing and subtitle burn-in.

500MB max video payload
Modal elastic GPU workers
SaaS paid tier via Polar.sh
System design

Architecture diagram

An event-driven orchestration layer ensures the Next.js client remains non-blocking while heavy video and AI workloads are executed on distributed GPU clusters.

Next.js Client heavy SSR · TanStack Query
tRPC API end-to-end typesafe
Better Auth & Polar.sh sessions · subscription limits
PostgreSQL + Prisma job state · tracking
Inngest Engine durable background jobs
FastAPI Workers python orchestration
Modal GPUs elastic compute scaling
Custom Whisper hinglish transcription
+
DeepSeek v3 + LR-ASD viral reasoning · active speaker
FFmpeg compositing · subtitle burn-in
Cloudflare R2 final asset delivery
Interface

Screenshots

Landing Page
Conversion-focused marketing site detailing the AI pipeline, supported video formats, and SaaS pricing tiers.
User Dashboard
Central hub for tracking job statuses, managing generated clips, and reviewing remaining processing minutes.
Video Editor
Manual review UI for editing DeepSeek-selected clips, correcting Hinglish transcripts, and applying gameplay overlays.
Engineering

Technical deep-dive

01
Durable Background Jobs with Inngest
Processing a 2-hour video involves multiple sequential stages: transcription, analysis, clipping, and rendering. Doing this synchronously is impossible. I implemented Inngest to orchestrate these multi-stage pipelines. Jobs are completely idempotent, restartable on failure, and continuously sync progress to the Next.js UI via TanStack Query without blocking HTTP threads.
await step.run("transcribe", async () => {
return await fastApiWorker.process(video)
});
02
DeepSeek v3 & Active Speaker Detection
Instead of relying purely on audio spikes, the backend utilizes OpenCV and LR-ASD to pinpoint the active speaker's bounding box per frame. This visual data, combined with the transcript, is fed into DeepSeek v3. The LLM acts as an AI director, analyzing semantic context to find narrative peaks and extract highly engaging, continuous 60-second viral segments.
const viral_moments = await deepseek.analyze({
transcript: text,
speaker_metadata: lr_asd_data
});
03
Custom Fine-Tuned Hinglish Whisper
Standard transcription models severely hallucinate when processing "Hinglish" (mixed Hindi and English). To solve this, I deployed a custom fine-tuned Whisper model onto Modal GPU instances. This drastically improved subtitle accuracy for Indian creators. The resulting text is then synced to milliseconds and burned in with dynamic styling via FFmpeg.
@modal.function(gpu="A100")
def transcribe_hinglish(audio_path):
return custom_whisper.transcribe(audio_path)
04
Billing & Access Control Infrastructure
Operating GPU workloads is expensive, making access control critical. I integrated Better Auth to manage robust OAuth (Google/GitHub) and email sessions. Monetization is handled through Polar.sh, enabling subscription tiers that enforce strict guardrails on maximum upload sizes (capped at 500MB), concurrent processing jobs, and total monthly compute minutes.
if (user.minutes_used > plan.limit) {
throw new TRPCError({ code: "FORBIDDEN" });
}
Previous Beatflow AI Music · GPU Pipelines Next OpenFlowX No-code Workflows · Open Source