# yorulmazsinan/couchsubs architecture

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

- Interactive diagram: https://gitdiagram.com/yorulmazsinan/couchsubs
- Repository: https://github.com/yorulmazsinan/couchsubs

## Overview

CouchSubs captures a console game stream for subtitle recognition, translates the recognized text, and sends subtitles to a TV overlay while the player continues using the TV’s normal HDMI input. The repository contains desktop, Android-phone, and TV-app implementations, plus game packs, translation choices, and TV installation support. The README documents the product workflow; sampled pipeline code confirms subtitle filtering and delivery. Some platform-specific wiring and pack internals were not sampled, so those relationships are omitted or marked unverified.

Main entry points: [`core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift`](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift) (Subtitle pipeline), [`windows/src/CouchSubs.Core/Translation.cs`](https://github.com/yorulmazsinan/couchsubs/blob/main/windows/src/CouchSubs.Core/Translation.cs) (Translation engines), [`core/Sources/CouchSubsCore/SubtitleServer.swift`](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/SubtitleServer.swift) (Subtitle server), [`couchsubs-android/app/src/main/java/com/couchsubs/mobile/packs/PackStore.kt`](https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/packs/PackStore.kt) (Game subtitle packs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and reading"]
  node_remoteplay["Remote Play"]
  node_framecapture["Frame capture<br/>[FrameSource.kt]"]
  node_ocr["Subtitle OCR<br/>[VisionReader.swift]"]
  node_reading["Reading model<br/>[Reading.swift]"]
end

subgraph group_translate["Subtitle translation"]
  node_pipeline["Subtitle pipeline"]
  node_translation["Translation engines<br/>[Translation.cs]"]
  node_localengine["Local translator<br/>[Ct2MarianEngine.cs]"]
  node_cloudtranslation["Online translators<br/>[Translator.swift]"]
end

subgraph group_delivery["TV subtitle delivery"]
  node_subtitleprotocol["Subtitle server"]
  node_tvapp["TV overlay app<br/>[app.js]"]
  node_androidtv["Android TV overlay"]
end

subgraph group_devices["Device setup"]
  node_tvsetup["TV discovery and install<br/>[TvDiscovery.kt]"]
  node_consolelink["Console accounts<br/>[PsnAccount.kt]"]
end

subgraph group_content["Packs and history"]
  node_packs["Game subtitle packs<br/>[PackStore.kt]"]
  node_packserver["Pack service<br/>[index.ts]"]
  node_history[("Subtitle history")]
end

node_player(("Player"))
node_console["Game console"]
node_tv["Television"]

node_player -->|"plays on"| node_console
node_console -->|"streams gameplay"| node_remoteplay
node_remoteplay -.->|"provides frames"| node_framecapture
node_framecapture -.->|"supplies frames"| node_ocr
node_ocr -.->|"recognizes text"| node_pipeline
node_pipeline -->|"processes readings"| node_reading
node_pipeline -.->|"requests translation"| node_translation
node_translation -.->|"uses local engine"| node_localengine
node_translation -.->|"may use online"| node_cloudtranslation
node_pipeline -->|"sends subtitles"| node_subtitleprotocol
node_subtitleprotocol -->|"serves overlay"| node_tvapp
node_subtitleprotocol -.->|"serves overlay"| node_androidtv
node_tvapp -->|"displays over HDMI"| node_tv
node_androidtv -.->|"displays overlay"| node_tv
node_tvsetup -->|"installs TV app"| node_tv
node_consolelink -->|"connects account"| node_console
node_packs -.->|"provides translations"| node_pipeline
node_packs -.->|"updates packs"| node_packserver
node_pipeline -.->|"records subtitles"| node_history

click node_remoteplay "https://github.com/yorulmazsinan/couchsubs/blob/main/remoteplay/Sources/RemotePlay/StreamSession.swift"
click node_framecapture "https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/remoteplay/FrameSource.kt"
click node_ocr "https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/VisionReader.swift"
click node_reading "https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Reading.swift"
click node_pipeline "https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift"
click node_translation "https://github.com/yorulmazsinan/couchsubs/blob/main/windows/src/CouchSubs.Core/Translation.cs"
click node_localengine "https://github.com/yorulmazsinan/couchsubs/blob/main/windows/src/CouchSubs.Translation/Ct2MarianEngine.cs"
click node_cloudtranslation "https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/Translator.swift"
click node_subtitleprotocol "https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/SubtitleServer.swift"
click node_tvapp "https://github.com/yorulmazsinan/couchsubs/blob/main/tv-webos/app.js"
click node_androidtv "https://github.com/yorulmazsinan/couchsubs/blob/main/tv-android/app/src/main/java/com/couchsubs/tv/OverlayService.java"
click node_tvsetup "https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/tv/TvDiscovery.kt"
click node_consolelink "https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/remoteplay/PsnAccount.kt"
click node_packs "https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/packs/PackStore.kt"
click node_packserver "https://github.com/yorulmazsinan/couchsubs/blob/main/server/packs/src/index.ts"
click node_history "https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/SubtitleHistory.swift"

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_remoteplay,node_framecapture,node_ocr,node_reading toneBlue
class node_pipeline,node_translation,node_localengine,node_cloudtranslation toneAmber
class node_subtitleprotocol,node_tvapp,node_androidtv toneMint
class node_tvsetup,node_consolelink toneRose
class node_packs,node_packserver,node_history,node_player,node_console,node_tv toneIndigo
```

## Components

### Capture and reading

- [Remote Play](https://github.com/yorulmazsinan/couchsubs/blob/main/remoteplay/Sources/RemotePlay/StreamSession.swift): `remoteplay/Sources/RemotePlay/StreamSession.swift`
- [Frame capture](https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/remoteplay/FrameSource.kt): `couchsubs-android/app/src/main/java/com/couchsubs/mobile/remoteplay/FrameSource.kt`
- [Subtitle OCR](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/VisionReader.swift): `core/Sources/CouchSubsCore/Pipeline/VisionReader.swift`
- [Reading model](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Reading.swift): `core/Sources/CouchSubsCore/Reading.swift`

### Subtitle translation

- [Subtitle pipeline](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift): `core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift`
- [Translation engines](https://github.com/yorulmazsinan/couchsubs/blob/main/windows/src/CouchSubs.Core/Translation.cs): `windows/src/CouchSubs.Core/Translation.cs`
- [Local translator](https://github.com/yorulmazsinan/couchsubs/blob/main/windows/src/CouchSubs.Translation/Ct2MarianEngine.cs): `windows/src/CouchSubs.Translation/Ct2MarianEngine.cs`
- [Online translators](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/Pipeline/Translator.swift): `core/Sources/CouchSubsCore/Pipeline/Translator.swift`

### TV subtitle delivery

- [Subtitle server](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/SubtitleServer.swift): `core/Sources/CouchSubsCore/SubtitleServer.swift`
- [TV overlay app](https://github.com/yorulmazsinan/couchsubs/blob/main/tv-webos/app.js): `tv-webos/app.js`
- [Android TV overlay](https://github.com/yorulmazsinan/couchsubs/blob/main/tv-android/app/src/main/java/com/couchsubs/tv/OverlayService.java): `tv-android/app/src/main/java/com/couchsubs/tv/OverlayService.java`

### Device setup

- [TV discovery and install](https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/tv/TvDiscovery.kt): `couchsubs-android/app/src/main/java/com/couchsubs/mobile/tv/TvDiscovery.kt`
- [Console accounts](https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/remoteplay/PsnAccount.kt): `couchsubs-android/app/src/main/java/com/couchsubs/mobile/remoteplay/PsnAccount.kt`

### Packs and history

- [Game subtitle packs](https://github.com/yorulmazsinan/couchsubs/blob/main/couchsubs-android/app/src/main/java/com/couchsubs/mobile/packs/PackStore.kt): `couchsubs-android/app/src/main/java/com/couchsubs/mobile/packs/PackStore.kt`
- [Pack service](https://github.com/yorulmazsinan/couchsubs/blob/main/server/packs/src/index.ts): `server/packs/src/index.ts`
- [Subtitle history](https://github.com/yorulmazsinan/couchsubs/blob/main/core/Sources/CouchSubsCore/SubtitleHistory.swift): `core/Sources/CouchSubsCore/SubtitleHistory.swift`

### Other components

- **Player**
- **Game console**
- **Television**

## Connections

- Player → Game console: plays on (evidence: `README.md`)
- Game console → Remote Play: streams gameplay (evidence: `README.md`)
- Remote Play → Frame capture: provides frames
- Frame capture → Subtitle OCR: supplies frames
- Subtitle OCR → Subtitle pipeline: recognizes text
- Subtitle pipeline → Reading model: processes readings (evidence: `core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift`)
- Subtitle pipeline → Translation engines: requests translation
- Translation engines → Local translator: uses local engine (evidence: `windows/src/CouchSubs.Translation/Ct2MarianEngine.cs`)
- Translation engines → Online translators: may use online
- Subtitle pipeline → Subtitle server: sends subtitles (evidence: `core/Sources/CouchSubsCore/Pipeline/SubtitlePipeline.swift`)
- Subtitle server → TV overlay app: serves overlay (evidence: `README.md`)
- Subtitle server → Android TV overlay: serves overlay
- TV overlay app → Television: displays over HDMI (evidence: `README.md`)
- Android TV overlay → Television: displays overlay
- TV discovery and install → Television: installs TV app (evidence: `README.md`)
- Console accounts → Game console: connects account (evidence: `README.md`)
- Game subtitle packs → Subtitle pipeline: provides translations
- Game subtitle packs → Pack service: updates packs
- Subtitle pipeline → Subtitle history: records subtitles
