# juneyaooo/rea-video architecture

> Architecture diagram of the GitHub repository juneyaooo/rea-video, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juneyaooo/rea-video
- Repository: https://github.com/juneyaooo/rea-video

## Overview

rea-video is a video reverse-engineering CLI: an engineer or agent supplies a clip and receives a shot-by-shot account of how it was made, plus a remake plan and report. The documented analysis spans shot segmentation, production-method classification, visual and audio evidence, overlays and editing, and photographic production aspects; optional vision-model and agent review can refine the findings. The graph follows the documented workflow and source-index references. Some implementation details and call sites were not sampled, so uncertain connections are omitted rather than inferred.

Main entry points: [`rea_video/pipeline.py`](https://github.com/juneyaooo/rea-video/blob/main/rea_video/pipeline.py) (Decomposition), [`rea_video/cli.py`](https://github.com/juneyaooo/rea-video/blob/main/rea_video/cli.py) (CLI), [`rea_video/review.py`](https://github.com/juneyaooo/rea-video/blob/main/rea_video/review.py) (Agent review), [`rea_video/integrations/capsule_cinema.py`](https://github.com/juneyaooo/rea-video/blob/main/rea_video/integrations/capsule_cinema.py) (Capsule bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_cli["CLI<br/>[cli.py]"]
  node_pipeline["Decomposition<br/>[pipeline.py]"]
  node_i18n["Language support<br/>[i18n.py]"]
end

subgraph group_analysis["Video analysis"]
  node_media["Media probing<br/>[media.py]"]
  node_probe["Video metadata<br/>[probe.py]"]
  node_shots["Shot detection<br/>[shots.py]"]
  node_features["Visual features<br/>[features.py]"]
  node_visual["Visual analysis<br/>[visual.py]"]
  node_audio["Audio analysis<br/>[audio.py]"]
  node_sound["Sound sources<br/>[sound_source.py]"]
  node_packaging["Text and overlays<br/>[packaging.py]"]
  node_motion["Motion analysis<br/>[motion.py]"]
end

subgraph group_interpretation["Interpretation and review"]
  node_classification["Method classification<br/>[classify.py]"]
  node_vlm["Vision model<br/>[vlm.py]"]
  node_review["Agent review<br/>[review.py]"]
  node_memory[("Review memory<br/>[memory.py]")]
  node_aspects["Production aspects<br/>[base.py]"]
end

subgraph group_outputs["Plans and outputs"]
  node_production["Production summary<br/>[production.py]"]
  node_plan["Remake plan<br/>[plan.py]"]
  node_report["Analysis report<br/>[report.py]"]
  node_evaluate["Evaluation<br/>[evaluate.py]"]
end

subgraph group_integration["Remake integration"]
  node_capsule["Capsule bridge<br/>[capsule_cinema.py]"]
  node_remake["Remake workflow<br/>[remake.py]"]
end

node_user(("Video analyst"))

node_user -->|"submits video"| node_cli
node_cli -->|"runs analysis"| node_pipeline
node_pipeline -->|"reads media"| node_media
node_pipeline -->|"probes video"| node_probe
node_pipeline -->|"finds shots"| node_shots
node_pipeline -->|"extracts features"| node_features
node_pipeline -->|"classifies shots"| node_classification
node_pipeline -->|"analyzes visuals"| node_visual
node_pipeline -->|"analyzes audio"| node_audio
node_pipeline -->|"finds sound sources"| node_sound
node_pipeline -->|"analyzes overlays"| node_packaging
node_pipeline -->|"measures motion"| node_motion
node_pipeline -->|"requests model analysis"| node_vlm
node_pipeline -->|"uses aspect analyses"| node_aspects
node_cli -->|"builds review tasks"| node_review
node_review -->|"uses review hints"| node_memory
node_cli -->|"uses stored patterns"| node_memory
node_cli -->|"creates plan"| node_plan
node_cli -->|"exports analysis"| node_capsule
node_cli -->|"runs remake"| node_remake
node_cli -->|"evaluates results"| node_evaluate
node_pipeline -.->|"provides report data"| node_report
node_capsule -->|"uses plan details"| node_plan
node_cli -->|"sets language"| node_i18n
node_user -.->|"configures optionally"| node_vlm

click node_cli "https://github.com/juneyaooo/rea-video/blob/main/rea_video/cli.py"
click node_pipeline "https://github.com/juneyaooo/rea-video/blob/main/rea_video/pipeline.py"
click node_media "https://github.com/juneyaooo/rea-video/blob/main/rea_video/media.py"
click node_probe "https://github.com/juneyaooo/rea-video/blob/main/rea_video/probe.py"
click node_shots "https://github.com/juneyaooo/rea-video/blob/main/rea_video/shots.py"
click node_features "https://github.com/juneyaooo/rea-video/blob/main/rea_video/features.py"
click node_classification "https://github.com/juneyaooo/rea-video/blob/main/rea_video/classify.py"
click node_visual "https://github.com/juneyaooo/rea-video/blob/main/rea_video/visual.py"
click node_audio "https://github.com/juneyaooo/rea-video/blob/main/rea_video/audio.py"
click node_sound "https://github.com/juneyaooo/rea-video/blob/main/rea_video/sound_source.py"
click node_packaging "https://github.com/juneyaooo/rea-video/blob/main/rea_video/packaging.py"
click node_motion "https://github.com/juneyaooo/rea-video/blob/main/rea_video/motion.py"
click node_vlm "https://github.com/juneyaooo/rea-video/blob/main/rea_video/vlm.py"
click node_review "https://github.com/juneyaooo/rea-video/blob/main/rea_video/review.py"
click node_memory "https://github.com/juneyaooo/rea-video/blob/main/rea_video/memory.py"
click node_aspects "https://github.com/juneyaooo/rea-video/blob/main/rea_video/aspects/base.py"
click node_production "https://github.com/juneyaooo/rea-video/blob/main/rea_video/production.py"
click node_plan "https://github.com/juneyaooo/rea-video/blob/main/rea_video/plan.py"
click node_report "https://github.com/juneyaooo/rea-video/blob/main/rea_video/report.py"
click node_evaluate "https://github.com/juneyaooo/rea-video/blob/main/rea_video/evaluate.py"
click node_capsule "https://github.com/juneyaooo/rea-video/blob/main/rea_video/integrations/capsule_cinema.py"
click node_remake "https://github.com/juneyaooo/rea-video/blob/main/rea_video/remake.py"
click node_i18n "https://github.com/juneyaooo/rea-video/blob/main/rea_video/i18n.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_pipeline,node_i18n toneBlue
class node_media,node_probe,node_shots,node_features,node_visual,node_audio,node_sound,node_packaging,node_motion toneAmber
class node_classification,node_vlm,node_review,node_memory,node_aspects toneMint
class node_production,node_plan,node_report,node_evaluate toneRose
class node_capsule,node_remake,node_user toneIndigo
```

## Components

### Entry and orchestration

- [CLI](https://github.com/juneyaooo/rea-video/blob/main/rea_video/cli.py): `rea_video/cli.py`
- [Decomposition](https://github.com/juneyaooo/rea-video/blob/main/rea_video/pipeline.py): `rea_video/pipeline.py`
- [Language support](https://github.com/juneyaooo/rea-video/blob/main/rea_video/i18n.py): `rea_video/i18n.py`

### Video analysis

- [Media probing](https://github.com/juneyaooo/rea-video/blob/main/rea_video/media.py): `rea_video/media.py`
- [Video metadata](https://github.com/juneyaooo/rea-video/blob/main/rea_video/probe.py): `rea_video/probe.py`
- [Shot detection](https://github.com/juneyaooo/rea-video/blob/main/rea_video/shots.py): `rea_video/shots.py`
- [Visual features](https://github.com/juneyaooo/rea-video/blob/main/rea_video/features.py): `rea_video/features.py`
- [Visual analysis](https://github.com/juneyaooo/rea-video/blob/main/rea_video/visual.py): `rea_video/visual.py`
- [Audio analysis](https://github.com/juneyaooo/rea-video/blob/main/rea_video/audio.py): `rea_video/audio.py`
- [Sound sources](https://github.com/juneyaooo/rea-video/blob/main/rea_video/sound_source.py): `rea_video/sound_source.py`
- [Text and overlays](https://github.com/juneyaooo/rea-video/blob/main/rea_video/packaging.py): `rea_video/packaging.py`
- [Motion analysis](https://github.com/juneyaooo/rea-video/blob/main/rea_video/motion.py): `rea_video/motion.py`

### Interpretation and review

- [Method classification](https://github.com/juneyaooo/rea-video/blob/main/rea_video/classify.py): `rea_video/classify.py`
- [Vision model](https://github.com/juneyaooo/rea-video/blob/main/rea_video/vlm.py): `rea_video/vlm.py`
- [Agent review](https://github.com/juneyaooo/rea-video/blob/main/rea_video/review.py): `rea_video/review.py`
- [Review memory](https://github.com/juneyaooo/rea-video/blob/main/rea_video/memory.py): `rea_video/memory.py`
- [Production aspects](https://github.com/juneyaooo/rea-video/blob/main/rea_video/aspects/base.py): `rea_video/aspects/base.py`

### Plans and outputs

- [Production summary](https://github.com/juneyaooo/rea-video/blob/main/rea_video/production.py): `rea_video/production.py`
- [Remake plan](https://github.com/juneyaooo/rea-video/blob/main/rea_video/plan.py): `rea_video/plan.py`
- [Analysis report](https://github.com/juneyaooo/rea-video/blob/main/rea_video/report.py): `rea_video/report.py`
- [Evaluation](https://github.com/juneyaooo/rea-video/blob/main/rea_video/evaluate.py): `rea_video/evaluate.py`

### Remake integration

- [Capsule bridge](https://github.com/juneyaooo/rea-video/blob/main/rea_video/integrations/capsule_cinema.py): `rea_video/integrations/capsule_cinema.py`
- [Remake workflow](https://github.com/juneyaooo/rea-video/blob/main/rea_video/remake.py): `rea_video/remake.py`

### Other components

- **Video analyst**

## Connections

- Video analyst → CLI: submits video
- CLI → Decomposition: runs analysis (evidence: `rea_video/cli.py`)
- Decomposition → Media probing: reads media (evidence: `rea_video/pipeline.py`)
- Decomposition → Video metadata: probes video (evidence: `rea_video/pipeline.py`)
- Decomposition → Shot detection: finds shots (evidence: `rea_video/pipeline.py`)
- Decomposition → Visual features: extracts features (evidence: `rea_video/pipeline.py`)
- Decomposition → Method classification: classifies shots (evidence: `rea_video/pipeline.py`)
- Decomposition → Visual analysis: analyzes visuals (evidence: `rea_video/pipeline.py`)
- Decomposition → Audio analysis: analyzes audio (evidence: `rea_video/pipeline.py`)
- Decomposition → Sound sources: finds sound sources (evidence: `rea_video/pipeline.py`)
- Decomposition → Text and overlays: analyzes overlays (evidence: `rea_video/pipeline.py`)
- Decomposition → Motion analysis: measures motion (evidence: `rea_video/pipeline.py`)
- Decomposition → Vision model: requests model analysis (evidence: `rea_video/pipeline.py`)
- Decomposition → Production aspects: uses aspect analyses (evidence: `rea_video/pipeline.py`)
- CLI → Agent review: builds review tasks (evidence: `rea_video/cli.py`)
- Agent review → Review memory: uses review hints (evidence: `rea_video/review.py`)
- CLI → Review memory: uses stored patterns (evidence: `rea_video/cli.py`)
- CLI → Remake plan: creates plan (evidence: `rea_video/cli.py`)
- CLI → Capsule bridge: exports analysis (evidence: `rea_video/cli.py`)
- CLI → Remake workflow: runs remake (evidence: `rea_video/cli.py`)
- CLI → Evaluation: evaluates results (evidence: `rea_video/cli.py`)
- Decomposition → Analysis report: provides report data (evidence: `rea_video/pipeline.py`)
- Capsule bridge → Remake plan: uses plan details (evidence: `rea_video/integrations/capsule_cinema.py`)
- CLI → Language support: sets language (evidence: `rea_video/cli.py`)
- Video analyst → Vision model: configures optionally
