# lee-dongwook/video-auto-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/lee-dongwook/video-auto-analyzer
- Repository: https://github.com/lee-dongwook/video-auto-analyzer

## Overview

This repository is an AI video analysis API with a separate title-generation capability. The main workflow accepts a video, exposes metadata and scene detection, analyzes scene visuals and audio, then combines those results into video intelligence. Title generation is an independent content workflow. The excerpts establish the API routing, service orchestration, and Ollama-backed model setup; some analyzer internals were not shown, so their connections are limited to relationships listed in the SOURCE INDEX.

Main entry points: [`backend/app/domains/video/service.py`](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/service.py) (Video service), [`backend/app/infrastructure/llm/factory.py`](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/factory.py) (LLM factory), [`backend/app/infrastructure/llm/ollama.py`](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/ollama.py) (Ollama chat provider), [`backend/app/api/v1/router.py`](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/api/v1/router.py) (API router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surface"]
  node_api_router["API router<br/>[router.py]"]
  node_video_router["Video endpoints<br/>[router.py]"]
  node_content_router["Content endpoint<br/>[router.py]"]
end

subgraph group_video["Video analysis"]
  node_video_service["Video service<br/>[service.py]"]
  node_video_schemas["Video response schemas<br/>[schemas.py]"]
  node_video_storage[("Video files")]
  node_scene_detector["Scene detection<br/>[scene_detector.py]"]
  node_visual_analyzer["Visual analysis<br/>[visual_analyzer.py]"]
  node_audio_extractor["Audio extraction<br/>[audio_extractor.py]"]
  node_audio_transcriber["Audio transcription"]
  node_context_builder["Context building<br/>[context_builder.py]"]
  node_intelligence_analyzer["Video intelligence"]
end

subgraph group_content["Content generation"]
  node_content_schemas["Title schemas<br/>[schemas.py]"]
  node_content_service["Title generation<br/>[service.py]"]
end

subgraph group_models["Model infrastructure"]
  node_llm_factory["LLM factory<br/>[factory.py]"]
  node_llm_base["LLM interface<br/>[base.py]"]
  node_ollama_llm["Ollama chat provider<br/>[ollama.py]"]
  node_vision_ollama["Ollama vision provider<br/>[ollama.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

node_user(("API caller"))
node_ollama(("Ollama service"))

node_user -->|"sends requests"| node_api_router
node_api_router -->|"routes video"| node_video_router
node_api_router -->|"routes content"| node_content_router
node_video_router -->|"dispatches"| node_video_service
node_video_router -->|"validates responses"| node_video_schemas
node_content_router -->|"dispatches"| node_content_service
node_content_router -->|"validates request"| node_content_schemas
node_video_service -->|"stores uploads"| node_video_storage
node_video_service -->|"detects scenes"| node_scene_detector
node_video_service -->|"analyzes frames"| node_visual_analyzer
node_video_service -->|"extracts audio"| node_audio_extractor
node_video_service -->|"transcribes audio"| node_audio_transcriber
node_video_service -->|"builds context"| node_context_builder
node_video_service -->|"analyzes context"| node_intelligence_analyzer
node_content_service -->|"gets chat model"| node_llm_factory
node_content_service -->|"returns titles"| node_content_schemas
node_intelligence_analyzer -->|"gets chat model"| node_llm_factory
node_visual_analyzer -->|"analyzes images"| node_vision_ollama
node_llm_factory -->|"reads provider config"| node_settings
node_llm_factory -->|"uses interface"| node_llm_base
node_llm_factory -->|"selects provider"| node_ollama_llm
node_ollama_llm -->|"reads model config"| node_settings
node_ollama_llm -->|"implements interface"| node_llm_base
node_vision_ollama -->|"reads model config"| node_settings
node_vision_ollama -->|"sends image prompts"| node_ollama
node_ollama_llm -->|"requests chat model"| node_ollama

click node_api_router "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/api/v1/router.py"
click node_video_router "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/router.py"
click node_content_router "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/content/router.py"
click node_video_service "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/service.py"
click node_video_schemas "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/schemas.py"
click node_video_storage "https://github.com/lee-dongwook/video-auto-analyzer/tree/main/backend/storage/videos"
click node_scene_detector "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/scene_detector.py"
click node_visual_analyzer "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/visual_analyzer.py"
click node_audio_extractor "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/audio_extractor.py"
click node_audio_transcriber "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/audio_transcriber.py"
click node_context_builder "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/context_builder.py"
click node_intelligence_analyzer "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/intelligence_analyzer.py"
click node_content_schemas "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/content/schemas.py"
click node_content_service "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/content/service.py"
click node_llm_factory "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/factory.py"
click node_llm_base "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/base.py"
click node_ollama_llm "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/ollama.py"
click node_vision_ollama "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/vision/ollama.py"
click node_settings "https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/core/config.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_api_router,node_video_router,node_content_router toneBlue
class node_video_service,node_video_schemas,node_video_storage,node_scene_detector,node_visual_analyzer,node_audio_extractor,node_audio_transcriber,node_context_builder,node_intelligence_analyzer toneAmber
class node_content_schemas,node_content_service,node_user toneMint
class node_llm_factory,node_llm_base,node_ollama_llm,node_vision_ollama,node_settings toneRose
class node_ollama toneIndigo
```

## Components

### API surface

- [API router](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Video endpoints](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/router.py): `backend/app/domains/video/router.py`
- [Content endpoint](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/content/router.py): `backend/app/domains/content/router.py`

### Video analysis

- [Video service](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/service.py): `backend/app/domains/video/service.py`
- [Video response schemas](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/schemas.py): `backend/app/domains/video/schemas.py`
- [Video files](https://github.com/lee-dongwook/video-auto-analyzer/tree/main/backend/storage/videos): `backend/storage/videos`
- [Scene detection](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/scene_detector.py): `backend/app/domains/video/scene_detector.py`
- [Visual analysis](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/visual_analyzer.py): `backend/app/domains/video/visual_analyzer.py`
- [Audio extraction](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/audio_extractor.py): `backend/app/domains/video/audio_extractor.py`
- [Audio transcription](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/audio_transcriber.py): `backend/app/domains/video/audio_transcriber.py`
- [Context building](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/context_builder.py): `backend/app/domains/video/context_builder.py`
- [Video intelligence](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/video/intelligence_analyzer.py): `backend/app/domains/video/intelligence_analyzer.py`

### Content generation

- [Title schemas](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/content/schemas.py): `backend/app/domains/content/schemas.py`
- [Title generation](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/domains/content/service.py): `backend/app/domains/content/service.py`

### Model infrastructure

- [LLM factory](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/factory.py): `backend/app/infrastructure/llm/factory.py`
- [LLM interface](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/base.py): `backend/app/infrastructure/llm/base.py`
- [Ollama chat provider](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/llm/ollama.py): `backend/app/infrastructure/llm/ollama.py`
- [Ollama vision provider](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/infrastructure/vision/ollama.py): `backend/app/infrastructure/vision/ollama.py`
- [Runtime settings](https://github.com/lee-dongwook/video-auto-analyzer/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Other components

- **API caller**
- **Ollama service**

## Connections

- API caller → API router: sends requests
- API router → Video endpoints: routes video (evidence: `backend/app/api/v1/router.py`)
- API router → Content endpoint: routes content (evidence: `backend/app/api/v1/router.py`)
- Video endpoints → Video service: dispatches (evidence: `backend/app/domains/video/router.py`)
- Video endpoints → Video response schemas: validates responses (evidence: `backend/app/domains/video/router.py`)
- Content endpoint → Title generation: dispatches (evidence: `backend/app/domains/content/router.py`)
- Content endpoint → Title schemas: validates request (evidence: `backend/app/domains/content/router.py`)
- Video service → Video files: stores uploads (evidence: `backend/app/domains/video/service.py`)
- Video service → Scene detection: detects scenes (evidence: `backend/app/domains/video/service.py`)
- Video service → Visual analysis: analyzes frames (evidence: `backend/app/domains/video/service.py`)
- Video service → Audio extraction: extracts audio (evidence: `backend/app/domains/video/service.py`)
- Video service → Audio transcription: transcribes audio (evidence: `backend/app/domains/video/service.py`)
- Video service → Context building: builds context (evidence: `backend/app/domains/video/service.py`)
- Video service → Video intelligence: analyzes context (evidence: `backend/app/domains/video/service.py`)
- Title generation → LLM factory: gets chat model (evidence: `backend/app/domains/content/service.py`)
- Title generation → Title schemas: returns titles (evidence: `backend/app/domains/content/service.py`)
- Video intelligence → LLM factory: gets chat model (evidence: `backend/app/domains/video/intelligence_analyzer.py`)
- Visual analysis → Ollama vision provider: analyzes images (evidence: `backend/app/domains/video/visual_analyzer.py`)
- LLM factory → Runtime settings: reads provider config (evidence: `backend/app/infrastructure/llm/factory.py`)
- LLM factory → LLM interface: uses interface (evidence: `backend/app/infrastructure/llm/factory.py`)
- LLM factory → Ollama chat provider: selects provider (evidence: `backend/app/infrastructure/llm/factory.py`)
- Ollama chat provider → Runtime settings: reads model config (evidence: `backend/app/infrastructure/llm/ollama.py`)
- Ollama chat provider → LLM interface: implements interface (evidence: `backend/app/infrastructure/llm/ollama.py`)
- Ollama vision provider → Runtime settings: reads model config (evidence: `backend/app/infrastructure/vision/ollama.py`)
- Ollama vision provider → Ollama service: sends image prompts (evidence: `backend/app/infrastructure/vision/ollama.py`)
- Ollama chat provider → Ollama service: requests chat model (evidence: `backend/app/infrastructure/llm/ollama.py`)
