# marcelinho4499/rea-video architecture

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

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

## Overview

rea-video is a video reverse-engineering CLI that produces a human-readable report and layered VIDEO.md breakdown, with an optional remake plan. The main workflow accepts a video, inspects its media and shots, analyzes production methods and audiovisual details, then assembles the breakdown and outputs. Major capabilities also cover special-moment analysis, remake planning, and capsule-cinema integration. Edges reflect README statements and the supplied source index/excerpts; some subsystem links are omitted or marked unverified because their implementation was not sampled.

Main entry points: [`rea_video/pipeline.py`](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/pipeline.py) (Analysis pipeline), [`rea_video/report.py`](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/report.py) (HTML report), [`rea_video/cli.py`](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/cli.py) (CLI), [`rea_video/classify.py`](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/classify.py) (Production classification)

## 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["Video analysis"]
  node_media["Media inspection<br/>[media.py]"]
  node_shots["Shot detection<br/>[shots.py]"]
  node_survey["Visual survey<br/>[survey.py]"]
end

subgraph group_interpretation["Interpretation"]
  node_classify["Production classification<br/>[classify.py]"]
  node_aspects["Production aspects<br/>[base.py]"]
  node_packaging["Text and overlays<br/>[packaging.py]"]
  node_audio["Audio analysis<br/>[audio.py]"]
  node_entities["People and entities<br/>[entities.py]"]
  node_vlm["Vision model analysis<br/>[vlm.py]"]
  node_review["Review answers<br/>[review.py]"]
  node_moments["Special moments<br/>[moments.py]"]
end

subgraph group_outputs["Breakdown outputs"]
  node_report["HTML report<br/>[report.py]"]
  node_videomd["VIDEO.md format<br/>[videomd.py]"]
  node_pdf["PDF export<br/>[pdf.py]"]
end

subgraph group_remake["Remake and integrations"]
  node_plan["Remake plan<br/>[plan.py]"]
  node_generation["Generation planning<br/>[generation.py]"]
  node_production["Production guidance<br/>[production.py]"]
  node_capsule["Capsule bridge<br/>[capsule_cinema.py]"]
end

node_user(("Video requester"))
node_vision_service{{"Vision model"}}
node_capsule_service{{"Capsule Cinema"}}

node_user -->|"submits video"| node_cli
node_cli -->|"runs analysis"| node_pipeline
node_pipeline -->|"inspects media"| node_media
node_pipeline -->|"uses shot cuts"| node_shots
node_pipeline -->|"requests survey"| node_survey
node_pipeline -->|"analyzes audio"| node_audio
node_pipeline -->|"classifies shots"| node_classify
node_pipeline -->|"analyzes overlays"| node_packaging
node_pipeline -->|"selects model analysis"| node_vlm
node_pipeline -->|"finds moments"| node_moments
node_vlm -.->|"queries"| node_vision_service
node_review -->|"reviews findings"| node_classify
node_report -->|"uses classifications"| node_classify
node_report -->|"uses entity details"| node_entities
node_report -->|"includes moments"| node_moments
node_videomd -->|"reuses report data"| node_report
node_cli -->|"writes report"| node_report
node_cli -->|"writes breakdown"| node_videomd
node_report -.->|"exports PDF"| node_pdf
node_plan -->|"plans generations"| node_generation
node_production -->|"uses remake plan"| node_plan
node_capsule -->|"builds remake jobs"| node_generation
node_capsule -.->|"exports analysis"| node_capsule_service

click node_cli "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/cli.py"
click node_pipeline "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/pipeline.py"
click node_media "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/media.py"
click node_shots "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/shots.py"
click node_survey "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/survey.py"
click node_classify "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/classify.py"
click node_aspects "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/aspects/base.py"
click node_packaging "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/packaging.py"
click node_audio "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/audio.py"
click node_entities "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/entities.py"
click node_vlm "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/vlm.py"
click node_review "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/review.py"
click node_moments "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/moments.py"
click node_report "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/report.py"
click node_videomd "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/videomd.py"
click node_pdf "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/pdf.py"
click node_plan "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/plan.py"
click node_generation "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/generation.py"
click node_production "https://github.com/marcelinho4499/rea-video/blob/main/rea_video/production.py"
click node_capsule "https://github.com/marcelinho4499/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_shots,node_survey toneAmber
class node_classify,node_aspects,node_packaging,node_audio,node_entities,node_vlm,node_review,node_moments,node_user toneMint
class node_report,node_videomd,node_pdf toneRose
class node_plan,node_generation,node_production,node_capsule,node_vision_service,node_capsule_service toneIndigo
```

## Components

### Entry and orchestration

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

### Video analysis

- [Media inspection](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/media.py): `rea_video/media.py`
- [Shot detection](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/shots.py): `rea_video/shots.py`
- [Visual survey](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/survey.py): `rea_video/survey.py`

### Interpretation

- [Production classification](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/classify.py): `rea_video/classify.py`
- [Production aspects](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/aspects/base.py): `rea_video/aspects/base.py`
- [Text and overlays](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/packaging.py): `rea_video/packaging.py`
- [Audio analysis](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/audio.py): `rea_video/audio.py`
- [People and entities](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/entities.py): `rea_video/entities.py`
- [Vision model analysis](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/vlm.py): `rea_video/vlm.py`
- [Review answers](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/review.py): `rea_video/review.py`
- [Special moments](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/moments.py): `rea_video/moments.py`

### Breakdown outputs

- [HTML report](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/report.py): `rea_video/report.py`
- [VIDEO.md format](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/videomd.py): `rea_video/videomd.py`
- [PDF export](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/pdf.py): `rea_video/pdf.py`

### Remake and integrations

- [Remake plan](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/plan.py): `rea_video/plan.py`
- [Generation planning](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/generation.py): `rea_video/generation.py`
- [Production guidance](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/production.py): `rea_video/production.py`
- [Capsule bridge](https://github.com/marcelinho4499/rea-video/blob/main/rea_video/integrations/capsule_cinema.py): `rea_video/integrations/capsule_cinema.py`

### Other components

- **Video requester**
- **Vision model**
- **Capsule Cinema**

## Connections

- Video requester → CLI: submits video
- CLI → Analysis pipeline: runs analysis (evidence: `rea_video/cli.py`)
- Analysis pipeline → Media inspection: inspects media (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Shot detection: uses shot cuts (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Visual survey: requests survey (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Audio analysis: analyzes audio (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Production classification: classifies shots (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Text and overlays: analyzes overlays (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Vision model analysis: selects model analysis (evidence: `rea_video/pipeline.py`)
- Analysis pipeline → Special moments: finds moments (evidence: `rea_video/pipeline.py`)
- Vision model analysis → Vision model: queries
- Review answers → Production classification: reviews findings (evidence: `rea_video/review.py`)
- HTML report → Production classification: uses classifications (evidence: `rea_video/report.py`)
- HTML report → People and entities: uses entity details (evidence: `rea_video/report.py`)
- HTML report → Special moments: includes moments (evidence: `rea_video/report.py`)
- VIDEO.md format → HTML report: reuses report data (evidence: `rea_video/videomd.py`)
- CLI → HTML report: writes report (evidence: `rea_video/cli.py`)
- CLI → VIDEO.md format: writes breakdown (evidence: `rea_video/cli.py`)
- HTML report → PDF export: exports PDF
- Remake plan → Generation planning: plans generations (evidence: `rea_video/generation.py`)
- Production guidance → Remake plan: uses remake plan (evidence: `rea_video/production.py`)
- Capsule bridge → Generation planning: builds remake jobs (evidence: `rea_video/integrations/capsule_cinema.py`)
- Capsule bridge → Capsule Cinema: exports analysis
