# jacobp-developer/camera-viewer-rtsp architecture

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

- Interactive diagram: https://gitdiagram.com/jacobp-developer/camera-viewer-rtsp
- Repository: https://github.com/jacobp-developer/camera-viewer-rtsp

## Overview

This is a Python RTSP camera viewer and diagnostic tool, with separate Linux and Termux/Android entry points. The user supplies a camera IP, the tool identifies the vendor and tests stream paths, then parses SDP and plays a selected stream. The README also documents audio/backchannel checks and interactive path/vendor controls. Both implementations are largely monolithic; the graph separates their responsibilities conceptually. Sampled excerpts support the probing and player details, while some documented feature wiring is not visible.

Main entry points: [`linux/connect.py`](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py) (Linux viewer), [`android/connect.py`](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/android/connect.py) (Android viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Discovery and controls"]
  node_linux_app["Linux viewer<br/>[connect.py]"]
  node_android_app["Android viewer<br/>[connect.py]"]
  node_vendor_detect["Vendor detection<br/>[connect.py]"]
  node_menu["Interactive controls<br/>[connect.py]"]
  node_path_probe["Path probing<br/>[connect.py]"]
  node_sdp["SDP analysis<br/>[connect.py]"]
  node_audio_check["Audio checks<br/>[connect.py]"]
end

subgraph group_linux["Linux runtime"]
  node_gst["GStreamer player"]
  node_gst_plugins["GStreamer plugins"]
end

subgraph group_android["Android runtime"]
  node_android_x11["Termux:X11"]
  node_mpv["mpv player"]
end

subgraph group_external["External systems"]
  node_camera["RTSP camera"]
  node_nmap["nmap scanner"]
end

node_user(("Operator"))
node_live_video(("Live video"))

node_user -->|"enters IP"| node_linux_app
node_user -->|"enters IP"| node_android_app
node_linux_app -->|"detects vendor"| node_vendor_detect
node_android_app -->|"detects vendor"| node_vendor_detect
node_vendor_detect -.->|"scans with"| node_nmap
node_vendor_detect -->|"reads RTSP banner"| node_camera
node_linux_app -->|"offers controls"| node_menu
node_android_app -->|"offers controls"| node_menu
node_linux_app -->|"probes paths"| node_path_probe
node_android_app -->|"probes paths"| node_path_probe
node_path_probe -->|"sends RTSP requests"| node_camera
node_path_probe -->|"passes SDP"| node_sdp
node_sdp -->|"returns stream details"| node_linux_app
node_sdp -->|"returns stream details"| node_android_app
node_linux_app -->|"checks audio"| node_audio_check
node_android_app -->|"checks audio"| node_audio_check
node_audio_check -->|"probes audio and ONVIF"| node_camera
node_linux_app -->|"checks elements"| node_gst_plugins
node_linux_app -->|"launches pipeline"| node_gst
node_android_app -->|"starts display"| node_android_x11
node_android_app -->|"launches playback"| node_mpv
node_gst -->|"opens selected stream"| node_camera
node_mpv -->|"opens selected stream"| node_camera
node_gst -->|"renders"| node_live_video
node_mpv -->|"renders"| node_live_video

click node_linux_app "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py"
click node_android_app "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/android/connect.py"
click node_vendor_detect "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py"
click node_menu "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py"
click node_path_probe "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py"
click node_sdp "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py"
click node_audio_check "https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.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_linux_app,node_android_app,node_vendor_detect,node_menu,node_path_probe,node_sdp,node_audio_check toneBlue
class node_gst,node_gst_plugins toneAmber
class node_android_x11,node_mpv toneMint
class node_camera,node_nmap toneRose
class node_user,node_live_video toneIndigo
```

## Components

### Discovery and controls

- [Linux viewer](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py): `linux/connect.py`
- [Android viewer](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/android/connect.py): `android/connect.py`
- [Vendor detection](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py): `linux/connect.py`
- [Interactive controls](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py): `linux/connect.py`
- [Path probing](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py): `linux/connect.py`
- [SDP analysis](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py): `linux/connect.py`
- [Audio checks](https://github.com/jacobp-developer/camera-viewer-rtsp/blob/main/linux/connect.py): `linux/connect.py`

### Linux runtime

- **GStreamer player**
- **GStreamer plugins**

### Android runtime

- **Termux:X11**
- **mpv player**

### External systems

- **RTSP camera**
- **nmap scanner**

### Other components

- **Operator**
- **Live video**

## Connections

- Operator → Linux viewer: enters IP
- Operator → Android viewer: enters IP
- Linux viewer → Vendor detection: detects vendor
- Android viewer → Vendor detection: detects vendor
- Vendor detection → nmap scanner: scans with
- Vendor detection → RTSP camera: reads RTSP banner
- Linux viewer → Interactive controls: offers controls
- Android viewer → Interactive controls: offers controls
- Linux viewer → Path probing: probes paths
- Android viewer → Path probing: probes paths
- Path probing → RTSP camera: sends RTSP requests
- Path probing → SDP analysis: passes SDP
- SDP analysis → Linux viewer: returns stream details
- SDP analysis → Android viewer: returns stream details
- Linux viewer → Audio checks: checks audio
- Android viewer → Audio checks: checks audio
- Audio checks → RTSP camera: probes audio and ONVIF
- Linux viewer → GStreamer plugins: checks elements
- Linux viewer → GStreamer player: launches pipeline
- Android viewer → Termux:X11: starts display
- Android viewer → mpv player: launches playback
- GStreamer player → RTSP camera: opens selected stream
- mpv player → RTSP camera: opens selected stream
- GStreamer player → Live video: renders
- mpv player → Live video: renders
