# sahandghavidel/ai-video-editor architecture

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

- Interactive diagram: https://gitdiagram.com/sahandghavidel/ai-video-editor
- Repository: https://github.com/sahandghavidel/ai-video-editor

## Overview

Ultimate Video Editor is a self-hosted, scene-based AI video production workspace. Users configure a pipeline, work with source videos and scenes, generate or refine narration and media, then assemble and export publish-ready assets. The graph combines the supplied route excerpts with README-documented capabilities; unsampled subsystems are represented at the existing API directory level, and their internal wiring is not inferred.

Main entry points: [`src/app/api/generate-tts-omnivoice/route.ts`](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/generate-tts-omnivoice/route.ts) (Narration TTS), [`src/app/api/add-image-overlay/route.ts`](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/add-image-overlay/route.ts) (Image Overlays), [`src/app/api`](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api) (Production Dashboard), [`src/app/api/separate-scene/route.ts`](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/separate-scene/route.ts) (Separate Scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_dashboard["Production Dashboard"]
  node_pipeline["Pipeline Config<br/>[PipelineConfig.tsx]"]
  node_projects["Projects &amp; Scenes"]
end

subgraph group_scenes["Scene Production"]
  node_script["Script &amp; Prompts"]
  node_scene_gen["Generate Scenes<br/>[route.ts]"]
  node_scene_split["Separate Scene<br/>[route.ts]"]
  node_scene_media["Scene Media"]
end

subgraph group_speech["Speech &amp; Language"]
  node_tts["Narration TTS<br/>[route.ts]"]
  node_dub_en["English Dubbing<br/>[route.ts]"]
  node_dub_fa["Persian Dubbing<br/>[route.ts]"]
  node_subtitles["Subtitle Retrieval<br/>[route.ts]"]
end

subgraph group_media["Media &amp; Delivery"]
  node_video_edit["Video &amp; Audio Edit"]
  node_overlay["Image Overlays<br/>[route.ts]"]
  node_enhancer["Upscale &amp; Interpolate<br/>[RenderVideo.py]"]
  node_publish["Metadata &amp; Export"]
end

subgraph group_services["External Services"]
  node_baserow[("Baserow")]
  node_minio[("MinIO")]
  node_ffmpeg["FFmpeg"]
  node_ai_services["AI &amp; Speech Providers"]
  node_youtube["YouTube / yt-dlp"]
end

node_user(("Producer"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"configures"| node_pipeline
node_dashboard -->|"manages"| node_projects
node_pipeline -->|"enables steps"| node_script
node_projects -->|"provides project"| node_script
node_script -->|"creates scenes"| node_scene_gen
node_scene_gen -->|"reads and writes"| node_baserow
node_scene_split -->|"reads and updates"| node_baserow
node_scene_split -->|"probes duration"| node_ffmpeg
node_scene_media -->|"requests narration"| node_tts
node_tts -.->|"generates speech"| node_ai_services
node_tts -->|"uploads audio"| node_minio
node_tts -->|"reads scenes"| node_baserow
node_dub_en -->|"reads and updates"| node_baserow
node_dub_en -->|"uploads audio"| node_minio
node_dub_fa -->|"reads and updates"| node_baserow
node_dub_fa -->|"uploads assets"| node_minio
node_subtitles -->|"runs yt-dlp"| node_youtube
node_video_edit -->|"processes media"| node_ffmpeg
node_overlay -->|"renders overlay"| node_ffmpeg
node_overlay -->|"uploads video"| node_minio
node_overlay -->|"updates scene"| node_baserow
node_enhancer -->|"processes video"| node_ffmpeg
node_video_edit -.->|"optionally enhances"| node_enhancer
node_publish -->|"exports media"| node_minio

click node_dashboard "https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api"
click node_pipeline "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/components/PipelineConfig.tsx"
click node_projects "https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api"
click node_script "https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api"
click node_scene_gen "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/generate-scenes/route.ts"
click node_scene_split "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/separate-scene/route.ts"
click node_scene_media "https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api"
click node_tts "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/generate-tts-omnivoice/route.ts"
click node_dub_en "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/create-dubbed-en/route.ts"
click node_dub_fa "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/create-dubbed-fa/route.ts"
click node_subtitles "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/download-youtube-subtitles/route.ts"
click node_video_edit "https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api"
click node_overlay "https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/add-image-overlay/route.ts"
click node_enhancer "https://github.com/sahandghavidel/ai-video-editor/blob/main/REAL-Video-Enhancer/backend/src/RenderVideo.py"
click node_publish "https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api"

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_dashboard,node_pipeline,node_projects toneBlue
class node_script,node_scene_gen,node_scene_split,node_scene_media toneAmber
class node_tts,node_dub_en,node_dub_fa,node_subtitles toneMint
class node_video_edit,node_overlay,node_enhancer,node_publish toneRose
class node_baserow,node_minio,node_ffmpeg,node_ai_services,node_youtube,node_user toneIndigo
```

## Components

### Workspace

- [Production Dashboard](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api): `src/app/api`
- [Pipeline Config](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/components/PipelineConfig.tsx): `src/components/PipelineConfig.tsx`
- [Projects & Scenes](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api): `src/app/api`

### Scene Production

- [Script & Prompts](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api): `src/app/api`
- [Generate Scenes](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/generate-scenes/route.ts): `src/app/api/generate-scenes/route.ts`
- [Separate Scene](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/separate-scene/route.ts): `src/app/api/separate-scene/route.ts`
- [Scene Media](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api): `src/app/api`

### Speech & Language

- [Narration TTS](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/generate-tts-omnivoice/route.ts): `src/app/api/generate-tts-omnivoice/route.ts`
- [English Dubbing](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/create-dubbed-en/route.ts): `src/app/api/create-dubbed-en/route.ts`
- [Persian Dubbing](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/create-dubbed-fa/route.ts): `src/app/api/create-dubbed-fa/route.ts`
- [Subtitle Retrieval](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/download-youtube-subtitles/route.ts): `src/app/api/download-youtube-subtitles/route.ts`

### Media & Delivery

- [Video & Audio Edit](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api): `src/app/api`
- [Image Overlays](https://github.com/sahandghavidel/ai-video-editor/blob/main/src/app/api/add-image-overlay/route.ts): `src/app/api/add-image-overlay/route.ts`
- [Upscale & Interpolate](https://github.com/sahandghavidel/ai-video-editor/blob/main/REAL-Video-Enhancer/backend/src/RenderVideo.py): `REAL-Video-Enhancer/backend/src/RenderVideo.py`
- [Metadata & Export](https://github.com/sahandghavidel/ai-video-editor/tree/main/src/app/api): `src/app/api`

### External Services

- **Baserow**
- **MinIO**
- **FFmpeg**
- **AI & Speech Providers**
- **YouTube / yt-dlp**

### Other components

- **Producer**

## Connections

- Producer → Production Dashboard: uses
- Production Dashboard → Pipeline Config: configures
- Production Dashboard → Projects & Scenes: manages
- Pipeline Config → Script & Prompts: enables steps
- Projects & Scenes → Script & Prompts: provides project
- Script & Prompts → Generate Scenes: creates scenes
- Generate Scenes → Baserow: reads and writes
- Separate Scene → Baserow: reads and updates
- Separate Scene → FFmpeg: probes duration
- Scene Media → Narration TTS: requests narration
- Narration TTS → AI & Speech Providers: generates speech
- Narration TTS → MinIO: uploads audio
- Narration TTS → Baserow: reads scenes
- English Dubbing → Baserow: reads and updates
- English Dubbing → MinIO: uploads audio
- Persian Dubbing → Baserow: reads and updates
- Persian Dubbing → MinIO: uploads assets
- Subtitle Retrieval → YouTube / yt-dlp: runs yt-dlp
- Video & Audio Edit → FFmpeg: processes media
- Image Overlays → FFmpeg: renders overlay
- Image Overlays → MinIO: uploads video
- Image Overlays → Baserow: updates scene
- Upscale & Interpolate → FFmpeg: processes video
- Video & Audio Edit → Upscale & Interpolate: optionally enhances
- Metadata & Export → MinIO: exports media
