# hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12 architecture

> Architecture diagram of the GitHub repository hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12
- Repository: https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12

## Overview

NVR GUI VAAPI is a Qt5 viewer that loads camera definitions and presents up to four live feeds in a fullscreen grid. Its main workflow branches by source: HTTP(S) snapshots are fetched periodically, while other URLs are decoded through FFmpeg, with VAAPI hardware support, before frames reach the UI. Shell scripts and systemd units provide headless launch and host/service automation. The sampled C++ excerpt is incomplete, so decoder setup details and exact service-to-service wiring are not expanded.

Main entry points: [`nvr-gui-vaapi/src/main.cpp`](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp) (Qt Application), [`start-nvr-test.sh`](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/start-nvr-test.sh) (Headless Launcher), [`NVR Systemd Automation Stack/xorg.service`](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/xorg.service) (Xorg Service), [`nvr-gui-vaapi/build/config.json`](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/build/config.json) (Camera Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_viewer["Viewer"]
  node_config["Camera Config<br/>[config.json]"]
  node_app["Qt Application<br/>[main.cpp]"]
  node_grid["Fullscreen Grid<br/>[main.cpp]"]
  node_snapshot["HTTP Snapshots<br/>[main.cpp]"]
  node_rtsp["RTSP Workers<br/>[main.cpp]"]
  node_ffmpeg["FFmpeg Decode"]
end

subgraph group_runtime["Headless Runtime"]
  node_launcher["Headless Launcher<br/>[start-nvr-test.sh]"]
  node_terminator["Process Stopper<br/>[kill.sh]"]
end

subgraph group_automation["Host Automation"]
  node_xorg["Xorg Service<br/>[xorg.service]"]
  node_gui_service["GUI Service<br/>[nvr-gui.service]"]
  node_mount_service["Media Mount"]
  node_nas_service["NAS Monitor"]
  node_monitor_config["Monitor Setup<br/>[10-monitors.conf]"]
  node_nvr_only["NVR Mode Script<br/>[nvr-only.sh]"]
  node_nvr_kill["NVR Stop Script<br/>[kill-nvr.sh]"]
end

node_user(("Operator"))
node_camera(("Camera Sources"))
node_vaapi["VAAPI Device"]
node_display(("Local Display"))

node_user -->|"starts"| node_launcher
node_launcher -->|"launches"| node_app
node_app -->|"reads"| node_config
node_camera -->|"serves snapshots"| node_snapshot
node_camera -->|"streams video"| node_rtsp
node_app -->|"creates for HTTP"| node_snapshot
node_app -->|"starts workers"| node_rtsp
node_snapshot -->|"sets images"| node_grid
node_rtsp -->|"decodes frames"| node_ffmpeg
node_rtsp -.->|"uses hardware"| node_vaapi
node_rtsp -->|"pushes frames"| node_grid
node_app -->|"builds and shows"| node_grid
node_grid -->|"renders"| node_display
node_user -->|"stops processes"| node_terminator
node_user -->|"selects NVR mode"| node_nvr_only
node_xorg -->|"uses configuration"| node_monitor_config

click node_config "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/build/config.json"
click node_app "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp"
click node_grid "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp"
click node_snapshot "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp"
click node_rtsp "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp"
click node_launcher "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/start-nvr-test.sh"
click node_terminator "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/kill.sh"
click node_xorg "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/xorg.service"
click node_gui_service "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/nvr-gui.service"
click node_mount_service "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/mount-agentmedia.service"
click node_nas_service "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/nas-monitor.service"
click node_monitor_config "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/10-monitors.conf"
click node_nvr_only "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/nvr-only.sh"
click node_nvr_kill "https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/kill-nvr.sh"

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_config,node_app,node_grid,node_snapshot,node_rtsp,node_ffmpeg toneBlue
class node_launcher,node_terminator toneAmber
class node_xorg,node_gui_service,node_mount_service,node_nas_service,node_monitor_config,node_nvr_only,node_nvr_kill,node_vaapi toneMint
class node_user,node_camera,node_display toneIndigo
```

## Components

### Viewer

- [Camera Config](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/build/config.json): `nvr-gui-vaapi/build/config.json`
- [Qt Application](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp): `nvr-gui-vaapi/src/main.cpp`
- [Fullscreen Grid](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp): `nvr-gui-vaapi/src/main.cpp`
- [HTTP Snapshots](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp): `nvr-gui-vaapi/src/main.cpp`
- [RTSP Workers](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/nvr-gui-vaapi/src/main.cpp): `nvr-gui-vaapi/src/main.cpp`
- **FFmpeg Decode**

### Headless Runtime

- [Headless Launcher](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/start-nvr-test.sh): `start-nvr-test.sh`
- [Process Stopper](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/kill.sh): `kill.sh`

### Host Automation

- [Xorg Service](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/xorg.service): `NVR Systemd Automation Stack/xorg.service`
- [GUI Service](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/nvr-gui.service): `NVR Systemd Automation Stack/nvr-gui.service`
- [Media Mount](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/mount-agentmedia.service): `NVR Systemd Automation Stack/mount-agentmedia.service`
- [NAS Monitor](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/nas-monitor.service): `NVR Systemd Automation Stack/nas-monitor.service`
- [Monitor Setup](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/10-monitors.conf): `NVR Systemd Automation Stack/10-monitors.conf`
- [NVR Mode Script](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/nvr-only.sh): `NVR Systemd Automation Stack/nvr-only.sh`
- [NVR Stop Script](https://github.com/hashdashx/nvr-viewer-built-with-qt5-ffmpeg-vaapi-optimized-for-debian-12/blob/main/NVR%20Systemd%20Automation%20Stack/kill-nvr.sh): `NVR Systemd Automation Stack/kill-nvr.sh`

### Other components

- **Operator**
- **Camera Sources**
- **VAAPI Device**
- **Local Display**

## Connections

- Operator → Headless Launcher: starts
- Headless Launcher → Qt Application: launches
- Qt Application → Camera Config: reads
- Camera Sources → HTTP Snapshots: serves snapshots
- Camera Sources → RTSP Workers: streams video
- Qt Application → HTTP Snapshots: creates for HTTP
- Qt Application → RTSP Workers: starts workers
- HTTP Snapshots → Fullscreen Grid: sets images
- RTSP Workers → FFmpeg Decode: decodes frames
- RTSP Workers → VAAPI Device: uses hardware
- RTSP Workers → Fullscreen Grid: pushes frames
- Qt Application → Fullscreen Grid: builds and shows
- Fullscreen Grid → Local Display: renders
- Operator → Process Stopper: stops processes
- Operator → NVR Mode Script: selects NVR mode
- Xorg Service → Monitor Setup: uses configuration
