# e1z0/anotherrtsp architecture

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

- Interactive diagram: https://gitdiagram.com/e1z0/anotherrtsp
- Repository: https://github.com/e1z0/anotherrtsp

## Overview

AnotherRTSP is a Windows desktop RTSP camera monitor with configurable, movable camera windows, MQTT-triggered rules and alerts, scripting, and tray-based controls. The main flow is startup and settings loading, camera playback, and optional MQTT message handling that can invoke Lua scripts and alert actions. The README documents native player capabilities including recording and snapshots. Some UI and native implementation files were not sampled, so relationships involving them are omitted or marked unverified rather than inferred.

Main entry points: [`Src/Client/Scripting/LuaManager.cs`](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Scripting/LuaManager.cs) (Lua scripting), [`Src/Client/Services/MqttService.cs`](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Services/MqttService.cs) (MQTT service), [`Src/Client/Classes/Camera.cs`](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/Camera.cs) (Camera windows), [`Src/Client/Classes/YmlSettings.cs`](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/YmlSettings.cs) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_program["Application startup<br/>[Program.cs]"]
  node_settings["Settings<br/>[YmlSettings.cs]"]
  node_tray["Tray controls<br/>[TrayIconManager.cs]"]
  node_logger["Logging<br/>[Logger.cs]"]
  node_log_ui["Log window<br/>[LogForm.cs]"]
end

subgraph group_camera["Camera playback"]
  node_camera_config["Camera configuration<br/>[CameraItem.cs]"]
  node_camera["Camera windows<br/>[Camera.cs]"]
  node_sdk["Player SDK bridge<br/>[PlayerSdk.cs]"]
end

subgraph group_automation["MQTT and scripts"]
  node_mqtt_service["MQTT service<br/>[MqttService.cs]"]
  node_lua["Lua scripting<br/>[LuaManager.cs]"]
  node_script_ui["Script manager"]
  node_alerts["Sound and notifications<br/>[SoundManager.cs]"]
  node_led["LED state<br/>[LedStateManager.cs]"]
end

subgraph group_protocol["MQTT client"]
  node_mqtt_client["MQTT client<br/>[MqttClient.cs]"]
  node_mqtt_messages["MQTT messages<br/>[MqttMsgBase.cs]"]
end

subgraph group_native["Native player"]
  node_native_player["RTSP player engine<br/>[ChannelManager.cpp]"]
end

node_user(("Desktop user"))
node_broker(("MQTT broker"))

node_user -->|"uses"| node_tray
node_program -->|"loads"| node_settings
node_program -->|"starts and stops"| node_camera
node_program -->|"starts and stops"| node_mqtt_service
node_program -->|"initializes and shuts down"| node_lua
node_tray -->|"controls"| node_camera
node_camera -->|"uses"| node_camera_config
node_camera -->|"calls"| node_sdk
node_camera -->|"reads"| node_settings
node_mqtt_service -->|"reads broker config"| node_settings
node_mqtt_service -->|"connects and subscribes"| node_mqtt_client
node_mqtt_service -->|"forwards messages"| node_lua
node_mqtt_client -->|"handles"| node_mqtt_messages
node_mqtt_service -->|"exchanges messages"| node_broker
node_lua -->|"reads scripts and rules"| node_settings
node_script_ui -->|"manages scripts"| node_lua
node_lua -->|"controls cameras"| node_camera
node_lua -->|"invokes sound actions"| node_alerts
node_lua -->|"logs"| node_logger
node_mqtt_service -->|"logs"| node_logger
node_logger -->|"reads logging config"| node_settings
node_log_ui -->|"displays logs"| node_logger
node_sdk -.->|"bridges playback"| node_native_player
node_lua -.->|"may trigger"| node_led
node_mqtt_service -.->|"may trigger alerts"| node_alerts

click node_program "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Program.cs"
click node_settings "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/YmlSettings.cs"
click node_tray "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/TrayIconManager.cs"
click node_camera_config "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/CameraItem.cs"
click node_camera "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/Camera.cs"
click node_sdk "https://github.com/e1z0/anotherrtsp/blob/master/Src/EasyPlayerNetSDK/PlayerSdk.cs"
click node_native_player "https://github.com/e1z0/anotherrtsp/blob/master/Src/libEasyPlayer/ChannelManager.cpp"
click node_mqtt_service "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Services/MqttService.cs"
click node_mqtt_client "https://github.com/e1z0/anotherrtsp/blob/master/Src/M2Mqtt/MqttClient.cs"
click node_mqtt_messages "https://github.com/e1z0/anotherrtsp/blob/master/Src/M2Mqtt/Messages/MqttMsgBase.cs"
click node_lua "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Scripting/LuaManager.cs"
click node_script_ui "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Forms/ScriptManagerForm.cs"
click node_alerts "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/SoundManager.cs"
click node_led "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Services/LedStateManager.cs"
click node_logger "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/Logger.cs"
click node_log_ui "https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/LogForm.cs"

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_program,node_settings,node_tray,node_logger,node_log_ui,node_user toneBlue
class node_camera_config,node_camera,node_sdk toneAmber
class node_mqtt_service,node_lua,node_script_ui,node_alerts,node_led toneMint
class node_mqtt_client,node_mqtt_messages toneRose
class node_native_player,node_broker toneIndigo
```

## Components

### Desktop app

- [Application startup](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Program.cs): `Src/Client/Program.cs`
- [Settings](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/YmlSettings.cs): `Src/Client/Classes/YmlSettings.cs`
- [Tray controls](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/TrayIconManager.cs): `Src/Client/Classes/TrayIconManager.cs`
- [Logging](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/Logger.cs): `Src/Client/Classes/Logger.cs`
- [Log window](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/LogForm.cs): `Src/Client/LogForm.cs`

### Camera playback

- [Camera configuration](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/CameraItem.cs): `Src/Client/Classes/CameraItem.cs`
- [Camera windows](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/Camera.cs): `Src/Client/Classes/Camera.cs`
- [Player SDK bridge](https://github.com/e1z0/anotherrtsp/blob/master/Src/EasyPlayerNetSDK/PlayerSdk.cs): `Src/EasyPlayerNetSDK/PlayerSdk.cs`

### MQTT and scripts

- [MQTT service](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Services/MqttService.cs): `Src/Client/Services/MqttService.cs`
- [Lua scripting](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Scripting/LuaManager.cs): `Src/Client/Scripting/LuaManager.cs`
- [Script manager](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Forms/ScriptManagerForm.cs): `Src/Client/Forms/ScriptManagerForm.cs`
- [Sound and notifications](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Classes/SoundManager.cs): `Src/Client/Classes/SoundManager.cs`
- [LED state](https://github.com/e1z0/anotherrtsp/blob/master/Src/Client/Services/LedStateManager.cs): `Src/Client/Services/LedStateManager.cs`

### MQTT client

- [MQTT client](https://github.com/e1z0/anotherrtsp/blob/master/Src/M2Mqtt/MqttClient.cs): `Src/M2Mqtt/MqttClient.cs`
- [MQTT messages](https://github.com/e1z0/anotherrtsp/blob/master/Src/M2Mqtt/Messages/MqttMsgBase.cs): `Src/M2Mqtt/Messages/MqttMsgBase.cs`

### Native player

- [RTSP player engine](https://github.com/e1z0/anotherrtsp/blob/master/Src/libEasyPlayer/ChannelManager.cpp): `Src/libEasyPlayer/ChannelManager.cpp`

### Other components

- **Desktop user**
- **MQTT broker**

## Connections

- Desktop user → Tray controls: uses (evidence: `Src/Client/Classes/TrayIconManager.cs`)
- Application startup → Settings: loads (evidence: `Src/Client/Program.cs`)
- Application startup → Camera windows: starts and stops (evidence: `Src/Client/Program.cs`)
- Application startup → MQTT service: starts and stops (evidence: `Src/Client/Program.cs`)
- Application startup → Lua scripting: initializes and shuts down (evidence: `Src/Client/Program.cs`)
- Tray controls → Camera windows: controls (evidence: `Src/Client/Classes/TrayIconManager.cs`)
- Camera windows → Camera configuration: uses (evidence: `Src/Client/Classes/Camera.cs`)
- Camera windows → Player SDK bridge: calls (evidence: `Src/Client/Classes/Camera.cs`)
- Camera windows → Settings: reads (evidence: `Src/Client/Classes/Camera.cs`)
- MQTT service → Settings: reads broker config (evidence: `Src/Client/Services/MqttService.cs`)
- MQTT service → MQTT client: connects and subscribes (evidence: `Src/Client/Services/MqttService.cs`)
- MQTT service → Lua scripting: forwards messages (evidence: `Src/Client/Services/MqttService.cs`)
- MQTT client → MQTT messages: handles (evidence: `Src/M2Mqtt/MqttClient.cs`)
- MQTT service → MQTT broker: exchanges messages (evidence: `Src/Client/Services/MqttService.cs`)
- Lua scripting → Settings: reads scripts and rules (evidence: `Src/Client/Scripting/LuaManager.cs`)
- Script manager → Lua scripting: manages scripts (evidence: `Src/Client/Forms/ScriptManagerForm.cs`)
- Lua scripting → Camera windows: controls cameras (evidence: `Src/Client/Scripting/LuaManager.cs`)
- Lua scripting → Sound and notifications: invokes sound actions (evidence: `Src/Client/Scripting/LuaManager.cs`)
- Lua scripting → Logging: logs (evidence: `Src/Client/Scripting/LuaManager.cs`)
- MQTT service → Logging: logs (evidence: `Src/Client/Services/MqttService.cs`)
- Logging → Settings: reads logging config (evidence: `Src/Client/Classes/Logger.cs`)
- Log window → Logging: displays logs (evidence: `Src/Client/LogForm.cs`)
- Player SDK bridge → RTSP player engine: bridges playback
- Lua scripting → LED state: may trigger
- MQTT service → Sound and notifications: may trigger alerts
