# gulshan-singh-gs/video-generator-by-code architecture

> Architecture diagram of the GitHub repository gulshan-singh-gs/video-generator-by-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gulshan-singh-gs/video-generator-by-code
- Repository: https://github.com/gulshan-singh-gs/video-generator-by-code

## Overview

This repository contains two related but distinct video-production systems: the Obsidian Procedural Video Engine (OPVE), which turns scripts into narrated, timed, illustrated and reviewed video projects, and a motion-graphics subsystem that plans, validates, renders and composites overlays. The OPVE CLI is the visible orchestration point; its modules cover script planning, voice, alignment, characters, music, compositing, frame rendering and critique. Motion graphics has a separate director/provider and rendering path. Several stage links are supported by the CLI’s references, but unsampled implementation details and stage ordering are not inferred.

Main entry points: [`IDEs/Qwen/johananimation/src/cli.py`](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/cli.py) (Project CLI), [`IDEs/Qwen/johananimation/motion_graphics/renderer.py`](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/renderer.py) (Overlay renderer), [`IDEs/Qwen/johananimation/motion_graphics/schemas.py`](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/schemas.py) (Storyboard schemas), [`IDEs/Qwen/johananimation/motion_graphics/director.py`](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/director.py) (Story director)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_opve["OPVE production"]
  node_opve_cli["Project CLI<br/>[cli.py]"]
  node_models["Project models<br/>[models.py]"]
  node_script["Script planner"]
  node_voice["Voice synthesis"]
  node_align["Caption alignment"]
  node_characters["Character generation"]
  node_music_index["Music indexing"]
  node_music_score["Music scoring"]
  node_compositor_shell["Compositor shell"]
  node_frame_renderer["Frame renderer"]
  node_critic["Artistic critic"]
end

subgraph group_motion["Motion graphics"]
  node_motion_cli["Motion CLI<br/>[cli.py]"]
  node_planner["Overlay planner<br/>[planner.py]"]
  node_director["Story director<br/>[director.py]"]
  node_schemas["Storyboard schemas<br/>[schemas.py]"]
  node_validator["Plan validator<br/>[validator.py]"]
end

subgraph group_providers["AI providers"]
  node_provider_factory["Provider factory<br/>[__init__.py]"]
  node_adapter_base["Provider protocol<br/>[base.py]"]
  node_gemini["Gemini adapter<br/>[gemini_adapter.py]"]
end

subgraph group_rendering["Overlay rendering"]
  node_registry["Template registry<br/>[registry.py]"]
  node_renderer["Overlay renderer<br/>[renderer.py]"]
  node_templates["Template drawing<br/>[engine.py]"]
  node_compositor["Video compositor<br/>[compositor.py]"]
end

node_user(("Producer"))
node_gemini_service{{"Gemini API"}}
node_ffmpeg{{"FFmpeg tools"}}

node_user -->|"runs project commands"| node_opve_cli
node_opve_cli -->|"invokes planning"| node_script
node_opve_cli -->|"invokes voice"| node_voice
node_opve_cli -->|"invokes alignment"| node_align
node_opve_cli -->|"invokes generation"| node_characters
node_opve_cli -->|"invokes indexing"| node_music_index
node_opve_cli -->|"invokes scoring"| node_music_score
node_opve_cli -->|"invokes compositing"| node_compositor_shell
node_opve_cli -->|"invokes rendering"| node_frame_renderer
node_opve_cli -->|"invokes review"| node_critic
node_script -->|"uses data models"| node_models
node_align -->|"produces timestamps"| node_models
node_user -.->|"runs overlay commands"| node_motion_cli
node_director -->|"creates provider"| node_provider_factory
node_director -->|"builds storyboard"| node_schemas
node_director -->|"validates output"| node_validator
node_validator -->|"checks templates"| node_registry
node_validator -->|"validates structures"| node_schemas
node_renderer -->|"uses render settings"| node_registry
node_renderer -->|"renders overlays"| node_schemas
node_renderer -->|"draws templates"| node_templates
node_compositor -->|"renders overlay assets"| node_renderer
node_compositor -->|"reads overlay data"| node_schemas
node_provider_factory -->|"returns adapter"| node_adapter_base
node_provider_factory -->|"selects adapter"| node_gemini
node_gemini -->|"requests completion"| node_gemini_service
node_compositor -->|"composes video"| node_ffmpeg

click node_opve_cli "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/cli.py"
click node_models "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/models.py"
click node_script "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m01_script_planner.py"
click node_voice "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m02_voiceover_aistudio.py"
click node_align "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m03_align_captions.py"
click node_characters "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m04_character_gen.py"
click node_music_index "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m05_music_indexer.py"
click node_music_score "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m05_music_scorer.py"
click node_compositor_shell "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m06_compositor_shell.py"
click node_frame_renderer "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m07_frame_renderer.py"
click node_critic "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m08_artistic_critic.py"
click node_motion_cli "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/cli.py"
click node_planner "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/planner.py"
click node_director "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/director.py"
click node_schemas "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/schemas.py"
click node_validator "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/validator.py"
click node_registry "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/registry.py"
click node_renderer "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/renderer.py"
click node_templates "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/templates/engine.py"
click node_compositor "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/compositor.py"
click node_provider_factory "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/providers/__init__.py"
click node_adapter_base "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/adapters/base.py"
click node_gemini "https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/adapters/gemini_adapter.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_opve_cli,node_models,node_script,node_voice,node_align,node_characters,node_music_index,node_music_score,node_compositor_shell,node_frame_renderer,node_critic toneBlue
class node_motion_cli,node_planner,node_director,node_schemas,node_validator toneAmber
class node_provider_factory,node_adapter_base,node_gemini,node_gemini_service toneMint
class node_registry,node_renderer,node_templates,node_compositor toneRose
class node_user,node_ffmpeg toneIndigo
```

## Components

### OPVE production

- [Project CLI](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/cli.py): `IDEs/Qwen/johananimation/src/cli.py`
- [Project models](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/models.py): `IDEs/Qwen/johananimation/src/models.py`
- [Script planner](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m01_script_planner.py): `IDEs/Qwen/johananimation/src/m01_script_planner.py`
- [Voice synthesis](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m02_voiceover_aistudio.py): `IDEs/Qwen/johananimation/src/m02_voiceover_aistudio.py`
- [Caption alignment](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m03_align_captions.py): `IDEs/Qwen/johananimation/src/m03_align_captions.py`
- [Character generation](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m04_character_gen.py): `IDEs/Qwen/johananimation/src/m04_character_gen.py`
- [Music indexing](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m05_music_indexer.py): `IDEs/Qwen/johananimation/src/m05_music_indexer.py`
- [Music scoring](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m05_music_scorer.py): `IDEs/Qwen/johananimation/src/m05_music_scorer.py`
- [Compositor shell](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m06_compositor_shell.py): `IDEs/Qwen/johananimation/src/m06_compositor_shell.py`
- [Frame renderer](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m07_frame_renderer.py): `IDEs/Qwen/johananimation/src/m07_frame_renderer.py`
- [Artistic critic](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/src/m08_artistic_critic.py): `IDEs/Qwen/johananimation/src/m08_artistic_critic.py`

### Motion graphics

- [Motion CLI](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/cli.py): `IDEs/Qwen/johananimation/motion_graphics/cli.py`
- [Overlay planner](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/planner.py): `IDEs/Qwen/johananimation/motion_graphics/planner.py`
- [Story director](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/director.py): `IDEs/Qwen/johananimation/motion_graphics/director.py`
- [Storyboard schemas](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/schemas.py): `IDEs/Qwen/johananimation/motion_graphics/schemas.py`
- [Plan validator](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/validator.py): `IDEs/Qwen/johananimation/motion_graphics/validator.py`

### AI providers

- [Provider factory](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/providers/__init__.py): `IDEs/Qwen/johananimation/motion_graphics/providers/__init__.py`
- [Provider protocol](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/adapters/base.py): `IDEs/Qwen/johananimation/motion_graphics/adapters/base.py`
- [Gemini adapter](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/adapters/gemini_adapter.py): `IDEs/Qwen/johananimation/motion_graphics/adapters/gemini_adapter.py`

### Overlay rendering

- [Template registry](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/registry.py): `IDEs/Qwen/johananimation/motion_graphics/registry.py`
- [Overlay renderer](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/renderer.py): `IDEs/Qwen/johananimation/motion_graphics/renderer.py`
- [Template drawing](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/templates/engine.py): `IDEs/Qwen/johananimation/motion_graphics/templates/engine.py`
- [Video compositor](https://github.com/gulshan-singh-gs/video-generator-by-code/blob/main/IDEs/Qwen/johananimation/motion_graphics/compositor.py): `IDEs/Qwen/johananimation/motion_graphics/compositor.py`

### Other components

- **Producer**
- **Gemini API**
- **FFmpeg tools**

## Connections

- Producer → Project CLI: runs project commands (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Script planner: invokes planning (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Voice synthesis: invokes voice (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Caption alignment: invokes alignment (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Character generation: invokes generation (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Music indexing: invokes indexing (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Music scoring: invokes scoring (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Compositor shell: invokes compositing (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Frame renderer: invokes rendering (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Project CLI → Artistic critic: invokes review (evidence: `IDEs/Qwen/johananimation/src/cli.py`)
- Script planner → Project models: uses data models (evidence: `IDEs/Qwen/johananimation/src/m01_script_planner.py`)
- Caption alignment → Project models: produces timestamps (evidence: `IDEs/Qwen/johananimation/src/m03_align_captions.py`)
- Producer → Motion CLI: runs overlay commands
- Story director → Provider factory: creates provider (evidence: `IDEs/Qwen/johananimation/motion_graphics/director.py`)
- Story director → Storyboard schemas: builds storyboard (evidence: `IDEs/Qwen/johananimation/motion_graphics/director.py`)
- Story director → Plan validator: validates output (evidence: `IDEs/Qwen/johananimation/motion_graphics/director.py`)
- Plan validator → Template registry: checks templates (evidence: `IDEs/Qwen/johananimation/motion_graphics/validator.py`)
- Plan validator → Storyboard schemas: validates structures (evidence: `IDEs/Qwen/johananimation/motion_graphics/validator.py`)
- Overlay renderer → Template registry: uses render settings (evidence: `IDEs/Qwen/johananimation/motion_graphics/renderer.py`)
- Overlay renderer → Storyboard schemas: renders overlays (evidence: `IDEs/Qwen/johananimation/motion_graphics/renderer.py`)
- Overlay renderer → Template drawing: draws templates (evidence: `IDEs/Qwen/johananimation/motion_graphics/renderer.py`)
- Video compositor → Overlay renderer: renders overlay assets (evidence: `IDEs/Qwen/johananimation/motion_graphics/compositor.py`)
- Video compositor → Storyboard schemas: reads overlay data (evidence: `IDEs/Qwen/johananimation/motion_graphics/compositor.py`)
- Provider factory → Provider protocol: returns adapter (evidence: `IDEs/Qwen/johananimation/motion_graphics/providers/__init__.py`)
- Provider factory → Gemini adapter: selects adapter (evidence: `IDEs/Qwen/johananimation/motion_graphics/providers/__init__.py`)
- Gemini adapter → Gemini API: requests completion (evidence: `IDEs/Qwen/johananimation/motion_graphics/adapters/gemini_adapter.py`)
- Video compositor → FFmpeg tools: composes video (evidence: `IDEs/Qwen/johananimation/motion_graphics/compositor.py`)
