System Architecture · Local-First · Zero Re-Encode Pipeline

Inside the Montajo
Local-First Engine

Built to run on your own hardware without cloud lock-in. Every scene is hashed, cached as an independent bitstream segment, narrated by Kokoro ONNX, aligned by local Whisper, and composited with Remotion and headless Blender 5.2 workers.

montajo-engine · architecture.tree (localhost:8765) ⠋ LOCAL PIPELINE READY
┌── montajo-engine ──────────────────────────────────────────────────────────────────────────┐
│  content-addressed scene graph · zero untouched re-encoding · local-first execution        │
└────────────────────────────────────────────────────────────────────────────────────────────┘
   │
   ├── [01] faster-whisper (Base 0.45x / Small) ──► word-level timestamps & cue indices
   │         └─ { word: "spikes", start: 0.66s, end: 1.02s, cue: "chart_rise" }
   │
   ├── [02] Kokoro v1.0 ONNX (325MB · Apache 2.0) ──► 28 voices · text-normalized WAV
   │         └─ "$6.6B" -> "6.6 billion dollars" · af_heart / am_michael / bf_emma
   │
   ├── [03] Remotion React + Glyph Auto-Fit ──► spring physics locked to word index
   │         └─ 170 stress scenes x 2 aspect ratios · zero text overflow guarantee
   │
   ├── [04] Headless Blender 5.2 Worker (:8790) ──► WoL (UDP 7/9) · Standard transform
   │         └─ logo-9x16.jpg · title-9x16.jpg · stat-9x16.jpg · 4x fast draft mode
   │
   └── [05] FFmpeg Delta Concat (-c copy) ──► [██████████] 1.2s scene update
             ├─ scene_01.mp4  [CACHED  0.00s]  (bitstream untouched)
             ├─ scene_02.mp4  [DELTA   1.14s]  (re-synthesized slice)
             └─ scene_03.mp4  [CACHED  0.00s]  ──► libass caption burn ──► final_9x16.mp4

1–2s Incremental Scene-Clip Engine

Traditional video editors re-encode the entire timeline whenever you fix a typo. Montajo caches every scene as an independent rendered segment, redrawing only what changed and joining untouched clips via FFmpeg bitstream copy.

Traditional NLE Rendering

Full 60s Re-Encode on Every Edit

Scene 1 (Re-render)
Scene 2 (Re-render)
Scene 3 (Typo Fixed)
Scene 4 (Re-render)
Compute Required: 100% full CPU/GPU pipeline
Wait Time for 1 Typo: 45 to 120 seconds
Subtitle Restyling: Full video re-compression
Montajo Scene-Clip Engine

1–2s Stream Concatenation

Scene 1 (Cached 0s)
Scene 2 (Cached 0s)
Scene 3 (Redrawn 1.2s)
Scene 4 (Cached 0s)
Compute Required: Only touched scene slice
Wait Time for 1 Typo: 1.2 seconds
Subtitle Restyling: Updates caption layer only (0 footage re-encode)

How the Incremental Cache Guarantees Zero Quality Loss

01
Deterministic Hash Keys

Each scene is hashed by its script, voice model, visual template, aspect ratio, and caption look.

02
Exact Frame Snapping

Scene lengths are locked to whole video frames. Narration is isolated so audio timing never drifts.

03
Stream-Level Concat

FFmpeg joins untouched scene clips directly in bitstream copy mode with zero transcoding loss.

04
Isolated Caption Layer

Changing subtitle fonts or highlight colors updates only the subtitle pass, leaving 3D & clips untouched.

FFMPEG CONCAT & SEGMENT ARCHITECTURE

Delta Scene-Clip Assembly Pipeline

ffmpeg -f concat -safe 0 -i segments.txt -c copy -movflags +faststart out.mp4
Stage A · Cache Lookup
Content-Addressed Scene Store

Every scene resolves to a SHA-256 manifest of narration text, Kokoro voice ID, Remotion props, and frame duration. Cache hits skip rendering completely.

cache/scenes/<hash>.mp4 · 0ms compute
Stage B · Delta Render
Single-Slice Re-Synthesis

Only the modified scene regenerates its Kokoro WAV, Whisper word cues, and Remotion/Blender video slice—matching exact GOP, pixel format, and 30fps timebase.

1.1s–1.8s local render · untouched clips skipped
Stage C · Bitstream Join
Zero-Reencode Concat & ASS Burn

FFmpeg demuxer concatenates all scene segments with -c copy, then applies the isolated libass caption overlay only when subtitle styling changes.

Zero generation loss · instant MP4 mux

Remotion Word-Synced Motion Engine

No generic stock B-roll for data. Remotion renders React-driven bar charts, stat counters, and flow diagrams locked directly to spoken word indices from local Whisper alignment.

Remotion React Engine

Synced to the Exact Word

Elements don’t run on arbitrary timers. Every bar, bullet, and number is linked to a word index in the narration script. A bar animates when Kokoro says "growth"; a stat counter thuds when the digit is spoken.

cues.times: [ { word: "video", at: 1.24s }, { word: "spikes", at: 2.80s } ]
Fluid Spring Physics

Overshoot Springs, Never Linear

Built using Remotion springs with slight natural overshoots, 3-frame sibling staggers, camera punch-ins on key cues, and automatic audio pops/whooshes synthesized directly by ffmpeg.

spring({ fps: 30, config: { damping: 12, mass: 0.5, stiffness: 100 } })
Text Auto-Fitting

Zero Text Overflow Guarantee

Montajo’s layout engine measures real font glyphs in Unbounded and Figtree before rendering. Long titles automatically wrap, font sizes scale to fit, and graphics always stay strictly above caption zones.

tested across 170 stress scenes x 2 frame shapes

Headless Blender 5.2 Stage Workers

For hero openers, 3D titles, and beveled stat callouts, Montajo dispatches jobs to a headless Blender 5.2 worker on your local network—keeping brand colors true with Standard view transform.

WAKE-ON-LAN DISPATCH
On-Demand GPU Waking

Montajo sends Wake-on-LAN magic packets (UDP ports 7 & 9) to wake your rendering workstation only when a 3D scene enters the queue, then lets it sleep when idle.

SANDBOXED REST QUEUE
Tokenized Template Execution

Jobs are submitted over a tokenized REST API to parameterized Blender templates—no arbitrary Python injection, deterministic output paths, and automatic local caching.

COLOR & DRAFT MODE
Standard View Transform

Uses Blender's Standard view transform so Saffron #F4B33D and Magenta #E0457B stay exact, with a 4× faster draft preview mode for rapid layout checks.

Kokoro TTS & Local Whisper Pipeline

Zero per-character TTS fees and zero cloud audio uploads. Montajo pairs full-precision Kokoro v1.0 ONNX synthesis with local faster-whisper alignment for millisecond-accurate word timestamps.

Speech Synthesis · Apache 2.0

Kokoro v1.0 ONNX (28 English Voices)

Runs locally from a compact 325MB full-precision ONNX model. Before synthesis, Montajo's text normalizer expands symbols, currencies, and acronyms (such as $6.6B → 6.6 billion dollars) so narration sounds natural without manual respelling.

af_heart (Default) am_michael af_bella am_adam bf_emma bm_george +22 more voices
Model Footprint 325 MB · Full-Precision ONNX
Voice Licence Apache 2.0 (Commercial-Ready)
Text Normalization Currencies, units & acronyms
Forced Word Alignment · faster-whisper

Word-Level Timestamps for Graphics & Captions

Every generated or uploaded audio track passes through local faster-whisper—using the Base model (0.45× realtime) in Studio and Small in Campaigns for real creator recordings.

{
  "scene_id": "scene_02",
  "voice": "af_heart",
  "words": [
    { "word": "Engagement", "start": 0.08, "end": 0.64 },
    { "word": "spikes",     "start": 0.66, "end": 1.02, "cue": "chart_rise" },
    { "word": "73%",        "start": 1.58, "end": 2.14, "cue": "stat_thud" }
  ]
}
Studio Alignment Whisper Base · 0.45× realtime
Campaigns Footage Whisper Small · noisy audio ready
Downstream Consumers Remotion cues + libass captions

Self-Hosted GoTrue Auth & Local Stack

No cloud subscription lock-in. Montajo runs on your own hardware, home servers, or private containers with hardened authentication and automated backups.

Self-Hosted Supabase Auth (GoTrue)

Powered by self-hosted GoTrue in Docker. Supports one-time magic link emails, Google OAuth, and secure PBKDF2 local password hashes stored with mode 600 permissions.

  • • Role-based access: Admin, Member, Viewer
  • • Rate-limited logins (5 per address / 15m)
  • • HttpOnly, SameSite strict session cookies

FastAPI & Local AI Runtimes

The core backend orchestrates clip.server:app via Uvicorn on port 8765, coordinating Kokoro ONNX, faster-whisper, Remotion headless Chromium, and FFmpeg subprocesses.

  • • Zero external telemetry or audio egress
  • • Plain MP4 segments & JSON scene manifests
  • • Deterministic SHA-256 scene cache directory

Headless Blender 5.2 Worker

Offload 3D stage rendering to a remote GPU workstation. Montajo uses Wake-on-LAN packets (UDP ports 7 & 9) to wake the rendering PC on demand and puts it to sleep when idle.

  • • Tokenized REST queue on port 8790
  • • Standard view transform keeps brand colors true
  • • Fast draft preview mode (4× faster check)

Proxmox Dual-Disk Backup

Engineered for continuous reliability. Automated nightly backups snapshot the Montajo container (CT 114) and bind-mounted media storage across dual USB SSDs with hardlink deduplication.

  • • 02:10 nightly data copy to host SSD
  • • 02:30 Zstd container snapshots (14-night retention)
  • • Zero cloud lock-in: plain MP4s & JSON configs
terminal · bash (montajo-quickstart)
$ brew install ffmpeg-full # libass support for word captions
$ git clone https://github.com/montajo/studio && cd studio
$ python3 -m venv .venv && source .venv/bin/activate
$ pip install -r requirements.txt -r requirements-voice.txt
$ uvicorn clip.server:app --port 8765
✓ Montajo Studio running at http://localhost:8765 (Workers connected)