Engine Architecture
System Architecture
Comprehensive technical architecture and module layout for developers.
Video-Labs couples React Remotion for declarative video rendering, Python PyTorch for speech synthesis, and Bun/Next.js for the cloud control plane.
1. Top-Level Directory Layout
video-labs/
├── channels/ # Channel configs, brand assets, and episode projects
├── docs/ # Markdown documentation hub
├── public/ # Static assets, sound effects, brand watermarks, voice samples
├── src/ # Remotion React video compositions
│ ├── Episode.tsx # Main entry point routing to visual looks
│ ├── episodes.ts # Dynamic discovery of local episodes and timelines
│ ├── Watermark.tsx # Channel corner branding burn-in
│ ├── doc/ # Classic documentary templates (stat, quote, chapter)
│ ├── ink/ # Ink-and-watercolour Look (p5.brush WebGL2 canvas)
│ ├── brush/ # Whiteboard tech explainer Look
│ └── cinematic/ # Atmospheric 16:9 widescreen Look
├── tts/ # Multi-engine text-to-speech runtime
│ ├── engine.py # Unified BaseVoiceEngine adapter registry
│ └── render_episode.py # Script parser, voice synthesizer, and alignment generator
├── scripts/
│ ├── vlab/ # CLI command engine (run as ./vlab): core, checks, episode, artwork, posting, cli
│ ├── render.sh # Main Remotion + FFmpeg rendering pipeline
│ └── clipper/ # Twitch/YouTube GTA VI live stream highlight clipper
└── web/ # Cloud Web Studio monorepo (Bun workspace)
├── app/ # Next.js 16 Web Studio dashboard
├── api/ # Elysia background API & job runner
├── db/ # PostgreSQL schema and Drizzle migrations
├── docs/ # Astro Starlight documentation website
└── infra/ # AWS CDK and deployment definitions2. Rendering Flow
[script.json] ──▶ ./vlab voice ──▶ [timeline.json + narration.wav]
│
â–¼
./vlab art ──▶ [public/episodes/<id>/art/*.jpg]
│
â–¼
scripts/render.sh ──▶ Remotion React (60fps) + FFmpeg VideoToolbox
│
â–¼
[out/<channel>/<id>/<id>.mp4] (-14 LUFS)