Skip to content

Commit e40ecd7

Browse files
committed
docs: diagram encoder architecture
1 parent 7a376ef commit e40ecd7

1 file changed

Lines changed: 42 additions & 18 deletions

File tree

README.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,52 @@ The intended outcome is an appliance-like encoder that can be deployed on a Rasp
2828

2929
## Architecture
3030

31-
```text
32-
camera -> FFprobe -> FFmpeg -> reusable YouTube ingest
33-
| |
34-
| progress | stream health
35-
v v
36-
youtube-autoencoder supervisor
37-
|
38-
| bounded JSON commands
39-
v
40-
youtube-autoencoder-api
41-
|
42-
OAuth, reconciliation, transitions, privacy
43-
|
44-
v
45-
YouTube Data API v3
46-
|
47-
v
48-
one marked YouTube Live broadcast
31+
```mermaid
32+
flowchart LR
33+
subgraph ArchitectureInputs["Source and compatibility inputs"]
34+
Camera["RTSP camera"]
35+
ObsScene["Optional OBS scene"]
36+
ObsService["Optional OBS service profile"]
37+
end
38+
39+
subgraph ArchitectureHost["Encoder host"]
40+
Systemd["systemd service"]
41+
Supervisor["youtube-autoencoder supervisor"]
42+
Probe["FFprobe source validation"]
43+
Encoder["FFmpeg media pipeline"]
44+
Helper["youtube-autoencoder-api"]
45+
State["Durable state and locks"]
46+
OAuth["OAuth client and token"]
47+
end
48+
49+
subgraph ArchitectureYouTube["YouTube"]
50+
Ingest["Reusable liveStream ingest"]
51+
Api["YouTube Data API v3"]
52+
Broadcast["One marked liveBroadcast and watch page"]
53+
end
54+
55+
Systemd -->|"start and restart"| Supervisor
56+
ObsScene -->|"source discovery"| Supervisor
57+
ObsService -->|"ingest compatibility"| Supervisor
58+
Supervisor -->|"probe"| Probe
59+
Camera -->|"RTSP media"| Probe
60+
Probe -->|"source health"| Supervisor
61+
Supervisor -->|"spawn and supervise"| Encoder
62+
Camera -->|"video"| Encoder
63+
Encoder -->|"progress"| Supervisor
64+
Encoder -->|"RTMPS media"| Ingest
65+
Supervisor -->|"bounded JSON commands"| Helper
66+
Helper <-->|"read and write"| State
67+
OAuth -->|"authorization"| Helper
68+
Helper <-->|"lifecycle and health"| Api
69+
Ingest -->|"stream health"| Api
70+
Api <-->|"create, bind, transition, verify"| Broadcast
4971
```
5072

5173
The supervisor owns local process health, polling, backoff, and publication timing. The API helper owns OAuth, remote resource reconciliation, durable lifecycle state, and serialized mutations. YouTube remains authoritative; the local state file is a recovery cache and is revalidated before mutations.
5274

75+
For the detailed reconciliation algorithm, lifecycle states, and test strategy, see the [idempotent lifecycle recovery design](docs/superpowers/specs/2026-07-10-idempotent-youtube-lifecycle-design.md).
76+
5377
### Components
5478

5579
| Component | Path | Responsibility |

0 commit comments

Comments
 (0)