Skip to Content
🎬Video-Labs
Engine Architecture

Remotion React Video Engine

Compositions, frame evaluations, word reveals, and look routing.

Video-Labs uses Remotion 4 with React 19 to render animations deterministically at 60 frames per second.


1. Dynamic Composition Discovery (src/episodes.ts)

Instead of hardcoded imports, src/episodes.ts dynamically scans the filesystem:

  • Discovers all channels/*/episodes/*/script.json files.
  • Checks if public/episodes/<id>/timeline.json exists.
  • Automatically registers a <Composition> for each valid episode with its exact frame count derived from total audio duration.

2. Look Routing (src/Episode.tsx)

src/Episode.tsx routes each episode to its configured visual look:

const LOOKS: Record<LookName, React.ComponentType<LookProps>> = {
  ink: InkLook,
  documentary: DocLook,
  cartoon: CartoonLook,
  cinematic: CineLook,
  brush: BrushLook,
  office: OfficeLook,
  streamer: StreamerLook,
};

3. Frame-Accurate Word Reveals

Word animations are calculated mathematically using Remotion's useCurrentFrame() and timeline.json:

const frame = useCurrentFrame();
const currentTime = frame / fps;

const isWordSpoken = (wordTiming) => {
  return currentTime >= wordTiming.start;
};

This guarantees that text reveals, camera pans, and SFX cues land with sub-frame accuracy regardless of narrator speed or cadence.

On this page