# weifeng2333/videocaptioner architecture

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

- Interactive diagram: https://gitdiagram.com/weifeng2333/videocaptioner
- Repository: https://github.com/weifeng2333/videocaptioner

## Overview

VideoCaptioner is a desktop and command-line video-captioning application. Its principal workflow turns media into timed subtitles, splits and optimizes subtitle text, translates it, then renders subtitles into video; separate features download media and generate dubbed audio/video. The GUI pipeline thread explicitly sequences transcription, subtitle processing, and synthesis. README documents the broader workflow and supported capabilities; unsampled command handlers and core implementations limit certainty about their exact call wiring.

Main entry points: [`videocaptioner/cli/main.py`](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/main.py) (CLI dispatcher), [`videocaptioner/cli/commands/process.py`](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/process.py) (Process command), [`videocaptioner/ui/thread/subtitle_pipeline_thread.py`](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/ui/thread/subtitle_pipeline_thread.py) (GUI full pipeline), [`videocaptioner/core/translate`](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/translate) (Subtitle translation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI dispatcher<br/>[main.py]"]
  node_gui["Desktop app<br/>[main.py]"]
  node_pipeline_thread["GUI full pipeline"]
  node_transcribe_cmd["Transcribe command<br/>[transcribe.py]"]
  node_subtitle_cmd["Subtitle command<br/>[subtitle.py]"]
  node_process_cmd["Process command<br/>[process.py]"]
  node_synthesize_cmd["Synthesize command<br/>[synthesize.py]"]
  node_download_cmd["Download command<br/>[download.py]"]
  node_dub_cmd["Dub command<br/>[dub.py]"]
end

subgraph group_subtitle["Subtitle processing"]
  node_split["Subtitle splitting"]
  node_optimize["Subtitle optimization<br/>[optimize.py]"]
  node_translate["Subtitle translation"]
end

subgraph group_media["Media and speech"]
  node_asr["Speech recognition"]
  node_subtitle_render["Subtitle rendering"]
  node_dubbing["Dubbing pipeline<br/>[pipeline.py]"]
end

subgraph group_integrations["External integrations"]
  node_speech["Speech synthesis"]
  node_llm_client["LLM client<br/>[client.py]"]
  node_llm_service["LLM API"]
  node_translator_services["Translation services"]
  node_asr_services["ASR providers"]
  node_tts_services["TTS providers"]
  node_video_tools["Video tools"]
  node_download_service["Video platforms"]
end

subgraph group_settings["Configuration"]
  node_config["Application config<br/>[config.py]"]
end

node_cli_user(("CLI user"))
node_gui_user(("Desktop user"))

node_cli_user -->|"runs commands"| node_cli
node_gui_user -->|"opens app"| node_gui
node_cli -->|"dispatches"| node_transcribe_cmd
node_cli -->|"dispatches"| node_subtitle_cmd
node_cli -->|"dispatches"| node_process_cmd
node_cli -->|"dispatches"| node_synthesize_cmd
node_cli -->|"dispatches"| node_download_cmd
node_cli -->|"dispatches"| node_dub_cmd
node_gui -->|"starts workflow"| node_pipeline_thread
node_pipeline_thread -->|"transcribes media"| node_asr
node_pipeline_thread -->|"processes subtitles"| node_optimize
node_pipeline_thread -->|"synthesizes video"| node_subtitle_render
node_transcribe_cmd -->|"transcribes media"| node_asr
node_subtitle_cmd -->|"optimizes text"| node_optimize
node_subtitle_cmd -->|"translates text"| node_translate
node_process_cmd -->|"starts workflow"| node_asr
node_process_cmd -->|"processes subtitles"| node_optimize
node_process_cmd -->|"translates text"| node_translate
node_process_cmd -->|"synthesizes video"| node_subtitle_render
node_synthesize_cmd -->|"renders subtitles"| node_subtitle_render
node_download_cmd -->|"downloads media"| node_download_service
node_dub_cmd -->|"creates dub"| node_dubbing
node_asr -->|"requests recognition"| node_asr_services
node_split -->|"requests sentence splits"| node_llm_client
node_optimize -->|"requests optimization"| node_llm_client
node_translate -->|"selects translator"| node_translator_services
node_llm_client -->|"sends requests"| node_llm_service
node_dubbing -->|"synthesizes segments"| node_speech
node_speech -->|"requests speech"| node_tts_services
node_dubbing -->|"muxes dubbed video"| node_video_tools
node_subtitle_render -->|"renders video"| node_video_tools
node_cli -->|"reads options"| node_config
node_gui -->|"loads settings"| node_config
node_translate -.->|"requests LLM translation"| node_llm_client

click node_cli "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/main.py"
click node_gui "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/ui/main.py"
click node_pipeline_thread "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/ui/thread/subtitle_pipeline_thread.py"
click node_transcribe_cmd "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/transcribe.py"
click node_subtitle_cmd "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/subtitle.py"
click node_process_cmd "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/process.py"
click node_synthesize_cmd "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/synthesize.py"
click node_download_cmd "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/download.py"
click node_dub_cmd "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/dub.py"
click node_asr "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/asr"
click node_split "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/split"
click node_optimize "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/core/optimize/optimize.py"
click node_translate "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/translate"
click node_subtitle_render "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/subtitle"
click node_dubbing "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/core/dubbing/pipeline.py"
click node_speech "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/speech"
click node_llm_client "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/core/llm/client.py"
click node_translator_services "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/translate"
click node_asr_services "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/asr"
click node_tts_services "https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/tts"
click node_config "https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/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_cli,node_gui,node_pipeline_thread,node_transcribe_cmd,node_subtitle_cmd,node_process_cmd,node_synthesize_cmd,node_download_cmd,node_dub_cmd,node_cli_user,node_gui_user toneBlue
class node_split,node_optimize,node_translate toneAmber
class node_asr,node_subtitle_render,node_dubbing toneMint
class node_speech,node_llm_client,node_llm_service,node_translator_services,node_asr_services,node_tts_services,node_video_tools,node_download_service toneRose
class node_config toneIndigo
```

## Components

### User interfaces

- [CLI dispatcher](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/main.py): `videocaptioner/cli/main.py`
- [Desktop app](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/ui/main.py): `videocaptioner/ui/main.py`
- [GUI full pipeline](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/ui/thread/subtitle_pipeline_thread.py): `videocaptioner/ui/thread/subtitle_pipeline_thread.py`
- [Transcribe command](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/transcribe.py): `videocaptioner/cli/commands/transcribe.py`
- [Subtitle command](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/subtitle.py): `videocaptioner/cli/commands/subtitle.py`
- [Process command](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/process.py): `videocaptioner/cli/commands/process.py`
- [Synthesize command](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/synthesize.py): `videocaptioner/cli/commands/synthesize.py`
- [Download command](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/download.py): `videocaptioner/cli/commands/download.py`
- [Dub command](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/cli/commands/dub.py): `videocaptioner/cli/commands/dub.py`

### Subtitle processing

- [Subtitle splitting](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/split): `videocaptioner/core/split`
- [Subtitle optimization](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/core/optimize/optimize.py): `videocaptioner/core/optimize/optimize.py`
- [Subtitle translation](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/translate): `videocaptioner/core/translate`

### Media and speech

- [Speech recognition](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/asr): `videocaptioner/core/asr`
- [Subtitle rendering](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/subtitle): `videocaptioner/core/subtitle`
- [Dubbing pipeline](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/core/dubbing/pipeline.py): `videocaptioner/core/dubbing/pipeline.py`

### External integrations

- [Speech synthesis](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/speech): `videocaptioner/core/speech`
- [LLM client](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/core/llm/client.py): `videocaptioner/core/llm/client.py`
- **LLM API**
- [Translation services](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/translate): `videocaptioner/core/translate`
- [ASR providers](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/asr): `videocaptioner/core/asr`
- [TTS providers](https://github.com/weifeng2333/videocaptioner/tree/master/videocaptioner/core/tts): `videocaptioner/core/tts`
- **Video tools**
- **Video platforms**

### Configuration

- [Application config](https://github.com/weifeng2333/videocaptioner/blob/master/videocaptioner/config.py): `videocaptioner/config.py`

### Other components

- **CLI user**
- **Desktop user**

## Connections

- CLI user → CLI dispatcher: runs commands
- Desktop user → Desktop app: opens app
- CLI dispatcher → Transcribe command: dispatches
- CLI dispatcher → Subtitle command: dispatches
- CLI dispatcher → Process command: dispatches
- CLI dispatcher → Synthesize command: dispatches
- CLI dispatcher → Download command: dispatches
- CLI dispatcher → Dub command: dispatches
- Desktop app → GUI full pipeline: starts workflow
- GUI full pipeline → Speech recognition: transcribes media
- GUI full pipeline → Subtitle optimization: processes subtitles
- GUI full pipeline → Subtitle rendering: synthesizes video
- Transcribe command → Speech recognition: transcribes media
- Subtitle command → Subtitle optimization: optimizes text
- Subtitle command → Subtitle translation: translates text
- Process command → Speech recognition: starts workflow
- Process command → Subtitle optimization: processes subtitles
- Process command → Subtitle translation: translates text
- Process command → Subtitle rendering: synthesizes video
- Synthesize command → Subtitle rendering: renders subtitles
- Download command → Video platforms: downloads media
- Dub command → Dubbing pipeline: creates dub
- Speech recognition → ASR providers: requests recognition
- Subtitle splitting → LLM client: requests sentence splits
- Subtitle optimization → LLM client: requests optimization
- Subtitle translation → Translation services: selects translator
- LLM client → LLM API: sends requests
- Dubbing pipeline → Speech synthesis: synthesizes segments
- Speech synthesis → TTS providers: requests speech
- Dubbing pipeline → Video tools: muxes dubbed video
- Subtitle rendering → Video tools: renders video
- CLI dispatcher → Application config: reads options
- Desktop app → Application config: loads settings
- Subtitle translation → LLM client: requests LLM translation
