# tomneilson2003/videotranslator architecture

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

- Interactive diagram: https://gitdiagram.com/tomneilson2003/videotranslator
- Repository: https://github.com/tomneilson2003/videotranslator

## Overview

This is a desktop video-translation application implemented in a single Python file. A user selects a video and target languages in the GUI; the translator extracts audio, transcribes speech, translates text, synthesizes replacement speech, and creates translated video output. The excerpt shows the GUI initializing the translator, the workflow invoking video creation, and temporary-file cleanup. Several stage-to-stage calls are in omitted portions, so those connections are shown as unverified rather than asserted as directly observed.

Main entry points: [`main.py`](https://github.com/tomneilson2003/videotranslator/blob/main/main.py) (Translation coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_gui["Video GUI<br/>[main.py]"]
end

subgraph group_workflow["Translation workflow"]
  node_workflow["Translation coordinator<br/>[main.py]"]
  node_config["Configuration and models<br/>[main.py]"]
  node_cleanup["Temporary-file cleanup<br/>[main.py]"]
end

subgraph group_speech["Speech processing"]
  node_extract["Audio extraction<br/>[main.py]"]
  node_transcribe["Speech transcription<br/>[main.py]"]
  node_translate["Text translation<br/>[main.py]"]
  node_glossary["Technical glossary<br/>[main.py]"]
  node_synthesize["Speech synthesis<br/>[main.py]"]
  node_assemble["Audio assembly<br/>[main.py]"]
end

subgraph group_video["Video output"]
  node_render["Translated video rendering<br/>[main.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_gui
node_gui -->|"starts processing"| node_workflow
node_gui -->|"initializes"| node_config
node_workflow -.->|"extracts audio"| node_extract
node_extract -.->|"provides audio"| node_transcribe
node_transcribe -.->|"provides segments"| node_translate
node_translate -.->|"preserves terms"| node_glossary
node_translate -.->|"provides translated text"| node_synthesize
node_synthesize -.->|"provides speech clips"| node_assemble
node_workflow -->|"creates video"| node_render
node_assemble -.->|"provides translated audio"| node_render
node_workflow -.->|"cleans temporary files"| node_cleanup

click node_gui "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_workflow "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_config "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_extract "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_transcribe "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_translate "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_glossary "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_synthesize "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_assemble "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_render "https://github.com/tomneilson2003/videotranslator/blob/main/main.py"
click node_cleanup "https://github.com/tomneilson2003/videotranslator/blob/main/main.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_gui,node_user toneBlue
class node_workflow,node_config,node_cleanup toneAmber
class node_extract,node_transcribe,node_translate,node_glossary,node_synthesize,node_assemble toneMint
class node_render toneRose
```

## Components

### Desktop interface

- [Video GUI](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`

### Translation workflow

- [Translation coordinator](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Configuration and models](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Temporary-file cleanup](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`

### Speech processing

- [Audio extraction](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Speech transcription](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Text translation](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Technical glossary](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Speech synthesis](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`
- [Audio assembly](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`

### Video output

- [Translated video rendering](https://github.com/tomneilson2003/videotranslator/blob/main/main.py): `main.py`

### Other components

- **User**

## Connections

- User → Video GUI: uses
- Video GUI → Translation coordinator: starts processing (evidence: `main.py`)
- Video GUI → Configuration and models: initializes (evidence: `main.py`)
- Translation coordinator → Audio extraction: extracts audio (evidence: `main.py`)
- Audio extraction → Speech transcription: provides audio (evidence: `main.py`)
- Speech transcription → Text translation: provides segments (evidence: `main.py`)
- Text translation → Technical glossary: preserves terms (evidence: `main.py`)
- Text translation → Speech synthesis: provides translated text (evidence: `main.py`)
- Speech synthesis → Audio assembly: provides speech clips (evidence: `main.py`)
- Translation coordinator → Translated video rendering: creates video (evidence: `main.py`)
- Audio assembly → Translated video rendering: provides translated audio (evidence: `main.py`)
- Translation coordinator → Temporary-file cleanup: cleans temporary files (evidence: `main.py`)
