# neartana/rea-video architecture

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

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

## Overview

rea-video is a video reverse-engineering CLI: an engineer or agent supplies a clip, the tool analyzes it shot by shot, and returns a breakdown, remake plan, and HTML report. Its stages cover media inspection and shot sampling, visual and audio forensics, production-method classification, packaging and cinematography analysis, optional model or agent review, and synthesis into reports and remake outputs. The pipeline and CLI excerpts/index support the main wiring; several capabilities are documented in the README but their internals were not sampled, so those links are marked unverified.

Main entry points: [`rea_video/pipeline.py`](https://github.com/neartana/rea-video/blob/main/rea_video/pipeline.py) (Analysis pipeline), [`rea_video/cli.py`](https://github.com/neartana/rea-video/blob/main/rea_video/cli.py) (CLI), [`rea_video/vlm.py`](https://github.com/neartana/rea-video/blob/main/rea_video/vlm.py) (Vision model), [`rea_video/review.py`](https://github.com/neartana/rea-video/blob/main/rea_video/review.py) (Agent review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_cli["CLI<br/>[cli.py]"]
  node_pipeline["Analysis pipeline<br/>[pipeline.py]"]
end

subgraph group_analysis["Media analysis"]
  node_media["Media inspection<br/>[media.py]"]
  node_probe["Video probing<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_motion["Motion analysis<br/>[motion.py]"]
  node_audio["Audio analysis<br/>[audio.py]"]
  node_sound["Sound sourcing<br/>[sound_source.py]"]
end

subgraph group_interpret["Interpretation and review"]
  node_classify["Production classifier<br/>[classify.py]"]
  node_aspects["Production aspects<br/>[base.py]"]
  node_packaging["Text and overlays<br/>[packaging.py]"]
  node_vlm["Vision model<br/>[vlm.py]"]
  node_review["Agent review<br/>[review.py]"]
  node_memory[("Analysis memory<br/>[memory.py]")]
end

subgraph group_outputs["Plans and outputs"]
  node_plan["Remake planning<br/>[plan.py]"]
  node_report["HTML report<br/>[report.py]"]
  node_stems["Audio stems<br/>[stems.py]"]
end

subgraph group_integration["External integrations"]
  node_remake["Remake export<br/>[capsule_cinema.py]"]
end

node_user(("Engineer or agent"))
node_model_service{{"Vision model service"}}
node_capsule{{"Capsule Cinema"}}

node_user -->|"runs analysis"| node_cli
node_cli -->|"runs pipeline"| node_pipeline
node_pipeline -->|"reads video"| node_media
node_pipeline -->|"probes media"| node_probe
node_pipeline -->|"samples shots"| node_shots
node_pipeline -->|"extracts features"| node_features
node_pipeline -->|"analyzes visuals"| node_visual
node_pipeline -->|"analyzes motion"| node_motion
node_pipeline -->|"analyzes audio"| node_audio
node_pipeline -->|"identifies sound"| node_sound
node_pipeline -->|"classifies shots"| node_classify
node_pipeline -->|"measures aspects"| node_aspects
node_pipeline -->|"analyzes overlays"| node_packaging
node_pipeline -.->|"requests judgments"| node_vlm
node_pipeline -->|"builds plan"| node_plan
node_vlm -.->|"sends prompts"| node_model_service
node_cli -->|"offers review"| node_review
node_review -->|"uses patterns"| node_memory
node_cli -->|"uses memory"| node_memory
node_cli -->|"extracts stems"| node_stems
node_cli -.->|"produces report"| node_report
node_cli -->|"exports remake"| node_remake
node_remake -.->|"creates jobs"| node_capsule
node_pipeline -.->|"feeds breakdown"| node_report
node_pipeline -->|"writes timeline"| node_packaging

click node_cli "https://github.com/neartana/rea-video/blob/main/rea_video/cli.py"
click node_pipeline "https://github.com/neartana/rea-video/blob/main/rea_video/pipeline.py"
click node_media "https://github.com/neartana/rea-video/blob/main/rea_video/media.py"
click node_probe "https://github.com/neartana/rea-video/blob/main/rea_video/probe.py"
click node_shots "https://github.com/neartana/rea-video/blob/main/rea_video/shots.py"
click node_features "https://github.com/neartana/rea-video/blob/main/rea_video/features.py"
click node_visual "https://github.com/neartana/rea-video/blob/main/rea_video/visual.py"
click node_motion "https://github.com/neartana/rea-video/blob/main/rea_video/motion.py"
click node_audio "https://github.com/neartana/rea-video/blob/main/rea_video/audio.py"
click node_sound "https://github.com/neartana/rea-video/blob/main/rea_video/sound_source.py"
click node_classify "https://github.com/neartana/rea-video/blob/main/rea_video/classify.py"
click node_aspects "https://github.com/neartana/rea-video/blob/main/rea_video/aspects/base.py"
click node_packaging "https://github.com/neartana/rea-video/blob/main/rea_video/packaging.py"
click node_vlm "https://github.com/neartana/rea-video/blob/main/rea_video/vlm.py"
click node_review "https://github.com/neartana/rea-video/blob/main/rea_video/review.py"
click node_memory "https://github.com/neartana/rea-video/blob/main/rea_video/memory.py"
click node_plan "https://github.com/neartana/rea-video/blob/main/rea_video/plan.py"
click node_report "https://github.com/neartana/rea-video/blob/main/rea_video/report.py"
click node_stems "https://github.com/neartana/rea-video/blob/main/rea_video/stems.py"
click node_remake "https://github.com/neartana/rea-video/blob/main/rea_video/integrations/capsule_cinema.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 toneBlue
class node_media,node_probe,node_shots,node_features,node_visual,node_motion,node_audio,node_sound toneAmber
class node_classify,node_aspects,node_packaging,node_vlm,node_review,node_memory toneMint
class node_plan,node_report,node_stems toneRose
class node_remake,node_user,node_model_service,node_capsule toneIndigo
```

## Components

### Entry and orchestration

- [CLI](https://github.com/neartana/rea-video/blob/main/rea_video/cli.py): `rea_video/cli.py`
- [Analysis pipeline](https://github.com/neartana/rea-video/blob/main/rea_video/pipeline.py): `rea_video/pipeline.py`

### Media analysis

- [Media inspection](https://github.com/neartana/rea-video/blob/main/rea_video/media.py): `rea_video/media.py`
- [Video probing](https://github.com/neartana/rea-video/blob/main/rea_video/probe.py): `rea_video/probe.py`
- [Shot detection](https://github.com/neartana/rea-video/blob/main/rea_video/shots.py): `rea_video/shots.py`
- [Visual features](https://github.com/neartana/rea-video/blob/main/rea_video/features.py): `rea_video/features.py`
- [Visual analysis](https://github.com/neartana/rea-video/blob/main/rea_video/visual.py): `rea_video/visual.py`
- [Motion analysis](https://github.com/neartana/rea-video/blob/main/rea_video/motion.py): `rea_video/motion.py`
- [Audio analysis](https://github.com/neartana/rea-video/blob/main/rea_video/audio.py): `rea_video/audio.py`
- [Sound sourcing](https://github.com/neartana/rea-video/blob/main/rea_video/sound_source.py): `rea_video/sound_source.py`

### Interpretation and review

- [Production classifier](https://github.com/neartana/rea-video/blob/main/rea_video/classify.py): `rea_video/classify.py`
- [Production aspects](https://github.com/neartana/rea-video/blob/main/rea_video/aspects/base.py): `rea_video/aspects/base.py`
- [Text and overlays](https://github.com/neartana/rea-video/blob/main/rea_video/packaging.py): `rea_video/packaging.py`
- [Vision model](https://github.com/neartana/rea-video/blob/main/rea_video/vlm.py): `rea_video/vlm.py`
- [Agent review](https://github.com/neartana/rea-video/blob/main/rea_video/review.py): `rea_video/review.py`
- [Analysis memory](https://github.com/neartana/rea-video/blob/main/rea_video/memory.py): `rea_video/memory.py`

### Plans and outputs

- [Remake planning](https://github.com/neartana/rea-video/blob/main/rea_video/plan.py): `rea_video/plan.py`
- [HTML report](https://github.com/neartana/rea-video/blob/main/rea_video/report.py): `rea_video/report.py`
- [Audio stems](https://github.com/neartana/rea-video/blob/main/rea_video/stems.py): `rea_video/stems.py`

### External integrations

- [Remake export](https://github.com/neartana/rea-video/blob/main/rea_video/integrations/capsule_cinema.py): `rea_video/integrations/capsule_cinema.py`

### Other components

- **Engineer or agent**
- **Vision model service**
- **Capsule Cinema**

## Connections

- Engineer or agent → CLI: runs analysis
- CLI → Analysis pipeline: runs pipeline (evidence: `rea_video/cli.py`)
- Analysis pipeline → Media inspection: reads video (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Video probing: probes media (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Shot detection: samples shots (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Visual features: extracts features (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Visual analysis: analyzes visuals (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Motion analysis: analyzes motion (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Audio analysis: analyzes audio (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Sound sourcing: identifies sound (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Production classifier: classifies shots (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Production aspects: measures aspects (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Text and overlays: analyzes overlays (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Vision model: requests judgments (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Remake planning: builds plan (evidence: `rea_video/pipeline.py`)
- Vision model → Vision model service: sends prompts
- CLI → Agent review: offers review (evidence: `rea_video/cli.py`)
- Agent review → Analysis memory: uses patterns (evidence: `rea_video/review.py`)
- CLI → Analysis memory: uses memory (evidence: `rea_video/cli.py`)
- CLI → Audio stems: extracts stems (evidence: `rea_video/cli.py`)
- CLI → HTML report: produces report
- CLI → Remake export: exports remake (evidence: `rea_video/cli.py`)
- Remake export → Capsule Cinema: creates jobs
- Analysis pipeline → HTML report: feeds breakdown (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Text and overlays: writes timeline (evidence: `rea_video/pipeline.py`)
