# omrajnexus31173/nexus-cam-studio architecture

> Architecture diagram of the GitHub repository omrajnexus31173/nexus-cam-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omrajnexus31173/nexus-cam-studio
- Repository: https://github.com/omrajnexus31173/nexus-cam-studio

## Overview

Nexus Cam Studio is a native desktop screen, camera, and audio recorder. The main workflow is to choose sources, preview a shared composition, record with pause/resume, then finalize and save a video. Separate branches support Android camera/microphone streaming, background effects, device diagnostics, and persistent settings. The graph reflects the README and source-index references; unsampled implementations are represented only where documented, and uncertain connections are omitted.

Main entry points: [`app/ui/main_window.py`](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/main_window.py) (Main window), [`app/recorder/worker.py`](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/worker.py) (Recording worker), [`app/phone/server.py`](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/server.py) (Phone receiver), [`app/utils/frames.py`](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/frames.py) (Frame and scene state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workflow"]
  node_window["Main window<br/>[main_window.py]"]
  node_dialogs["Setup and settings<br/>[dialogs.py]"]
  node_settings[("Settings store<br/>[store.py]")]
  node_region["Region picker<br/>[region.py]"]
end

subgraph group_sources["Capture sources"]
  node_devices["Device discovery<br/>[devices.py]"]
  node_screen["Screen capture<br/>[capture.py]"]
  node_camera["Camera capture<br/>[capture.py]"]
  node_audio["PC audio capture<br/>[capture.py]"]
end

subgraph group_composition["Composition and preview"]
  node_frames["Frame and scene state<br/>[frames.py]"]
  node_effects["Background effects<br/>[background.py]"]
  node_compositor["Shared compositor<br/>[compositor.py]"]
  node_preview["Live preview<br/>[preview.py]"]
end

subgraph group_recording["Recording pipeline"]
  node_audio_session["Audio session<br/>[session.py]"]
  node_timeline["Pause timeline<br/>[timeline.py]"]
  node_worker["Recording worker<br/>[worker.py]"]
  node_ffmpeg["FFmpeg encoding<br/>[ffmpeg.py]"]
  node_paths["Output and resources<br/>[paths.py]"]
end

subgraph group_support["Phone and support"]
  node_phone["Phone receiver<br/>[server.py]"]
  node_phone_network["Phone networking<br/>[network.py]"]
  node_phone_certs["Local certificates<br/>[certificates.py]"]
  node_phone_audio["Phone audio conversion<br/>[audio.py]"]
  node_diagnostics["Diagnostics<br/>[diagnostics.py]"]
  node_qr["Pairing QR<br/>[qr.py]"]
end

node_user(("Operator"))
node_phone_actor(("Android phone"))
node_video_file["Saved recording"]

node_user -->|"operates"| node_window
node_window -->|"opens"| node_dialogs
node_window -->|"loads and saves"| node_settings
node_window -->|"refreshes"| node_devices
node_devices -->|"enumerates"| node_screen
node_devices -->|"enumerates"| node_camera
node_devices -->|"enumerates"| node_audio
node_window -->|"starts capture"| node_screen
node_window -->|"starts capture"| node_camera
node_window -->|"starts capture"| node_audio
node_screen -->|"stores frames"| node_frames
node_camera -->|"stores frames"| node_frames
node_window -->|"starts receiver"| node_phone
node_phone -->|"uses networking"| node_phone_network
node_phone -->|"uses certificates"| node_phone_certs
node_phone -->|"converts audio"| node_phone_audio
node_phone_actor -->|"streams audio and video"| node_phone
node_phone -->|"stores video frames"| node_frames
node_window -->|"selects effect"| node_effects
node_effects -->|"uses frame utilities"| node_frames
node_window -->|"configures composition"| node_compositor
node_window -->|"updates scene"| node_frames
node_preview -->|"renders composition"| node_compositor
node_window -->|"opens picker"| node_region
node_window -->|"shows preview"| node_preview
node_window -->|"starts recording"| node_worker
node_worker -->|"reads composition"| node_frames
node_worker -->|"collects audio"| node_audio_session
node_worker -->|"tracks recording time"| node_timeline
node_worker -->|"encodes and muxes"| node_ffmpeg
node_worker -->|"creates output"| node_paths
node_ffmpeg -->|"writes recording"| node_video_file
node_dialogs -->|"displays pairing QR"| node_qr
node_dialogs -->|"runs checks"| node_diagnostics
node_diagnostics -->|"checks encoder"| node_ffmpeg
node_diagnostics -->|"uses data paths"| node_paths

click node_window "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/main_window.py"
click node_dialogs "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/dialogs.py"
click node_settings "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/settings/store.py"
click node_devices "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/devices.py"
click node_screen "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/screen/capture.py"
click node_camera "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/camera/capture.py"
click node_audio "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/audio/capture.py"
click node_phone "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/server.py"
click node_phone_network "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/network.py"
click node_phone_certs "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/certificates.py"
click node_phone_audio "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/audio.py"
click node_frames "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/frames.py"
click node_effects "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/effects/background.py"
click node_compositor "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/compositor.py"
click node_preview "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/preview.py"
click node_region "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/region.py"
click node_audio_session "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/audio/session.py"
click node_timeline "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/timeline.py"
click node_worker "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/worker.py"
click node_ffmpeg "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/ffmpeg.py"
click node_diagnostics "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/diagnostics.py"
click node_paths "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/paths.py"
click node_qr "https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/qr.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_window,node_dialogs,node_settings,node_region toneBlue
class node_devices,node_screen,node_camera,node_audio toneAmber
class node_frames,node_effects,node_compositor,node_preview toneMint
class node_audio_session,node_timeline,node_worker,node_ffmpeg,node_paths toneRose
class node_phone,node_phone_network,node_phone_certs,node_phone_audio,node_diagnostics,node_qr,node_user,node_phone_actor,node_video_file toneIndigo
```

## Components

### Desktop workflow

- [Main window](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [Setup and settings](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/dialogs.py): `app/ui/dialogs.py`
- [Settings store](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/settings/store.py): `app/settings/store.py`
- [Region picker](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/region.py): `app/ui/region.py`

### Capture sources

- [Device discovery](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/devices.py): `app/utils/devices.py`
- [Screen capture](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/screen/capture.py): `app/screen/capture.py`
- [Camera capture](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/camera/capture.py): `app/camera/capture.py`
- [PC audio capture](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/audio/capture.py): `app/audio/capture.py`

### Composition and preview

- [Frame and scene state](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/frames.py): `app/utils/frames.py`
- [Background effects](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/effects/background.py): `app/effects/background.py`
- [Shared compositor](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/compositor.py): `app/recorder/compositor.py`
- [Live preview](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/ui/preview.py): `app/ui/preview.py`

### Recording pipeline

- [Audio session](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/audio/session.py): `app/audio/session.py`
- [Pause timeline](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/timeline.py): `app/recorder/timeline.py`
- [Recording worker](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/worker.py): `app/recorder/worker.py`
- [FFmpeg encoding](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/recorder/ffmpeg.py): `app/recorder/ffmpeg.py`
- [Output and resources](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/paths.py): `app/utils/paths.py`

### Phone and support

- [Phone receiver](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/server.py): `app/phone/server.py`
- [Phone networking](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/network.py): `app/phone/network.py`
- [Local certificates](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/certificates.py): `app/phone/certificates.py`
- [Phone audio conversion](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/phone/audio.py): `app/phone/audio.py`
- [Diagnostics](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/diagnostics.py): `app/utils/diagnostics.py`
- [Pairing QR](https://github.com/omrajnexus31173/nexus-cam-studio/blob/main/app/utils/qr.py): `app/utils/qr.py`

### Other components

- **Operator**
- **Android phone**
- **Saved recording**

## Connections

- Operator → Main window: operates (evidence: `README.md`)
- Main window → Setup and settings: opens (evidence: `app/ui/main_window.py`)
- Main window → Settings store: loads and saves (evidence: `app/ui/main_window.py`)
- Main window → Device discovery: refreshes (evidence: `app/ui/main_window.py`)
- Device discovery → Screen capture: enumerates (evidence: `app/utils/devices.py`)
- Device discovery → Camera capture: enumerates (evidence: `app/utils/devices.py`)
- Device discovery → PC audio capture: enumerates (evidence: `app/utils/devices.py`)
- Main window → Screen capture: starts capture (evidence: `app/ui/main_window.py`)
- Main window → Camera capture: starts capture (evidence: `app/ui/main_window.py`)
- Main window → PC audio capture: starts capture (evidence: `app/ui/main_window.py`)
- Screen capture → Frame and scene state: stores frames (evidence: `app/screen/capture.py`)
- Camera capture → Frame and scene state: stores frames (evidence: `app/camera/capture.py`)
- Main window → Phone receiver: starts receiver (evidence: `app/ui/main_window.py`)
- Phone receiver → Phone networking: uses networking (evidence: `app/phone/server.py`)
- Phone receiver → Local certificates: uses certificates (evidence: `app/phone/server.py`)
- Phone receiver → Phone audio conversion: converts audio (evidence: `app/phone/server.py`)
- Android phone → Phone receiver: streams audio and video (evidence: `README.md`)
- Phone receiver → Frame and scene state: stores video frames (evidence: `app/phone/server.py`)
- Main window → Background effects: selects effect (evidence: `app/ui/main_window.py`)
- Background effects → Frame and scene state: uses frame utilities (evidence: `app/effects/background.py`)
- Main window → Shared compositor: configures composition (evidence: `app/ui/main_window.py`)
- Main window → Frame and scene state: updates scene (evidence: `app/ui/main_window.py`)
- Live preview → Shared compositor: renders composition (evidence: `app/ui/preview.py`)
- Main window → Region picker: opens picker (evidence: `app/ui/main_window.py`)
- Main window → Live preview: shows preview (evidence: `app/ui/main_window.py`)
- Main window → Recording worker: starts recording (evidence: `app/ui/main_window.py`)
- Recording worker → Frame and scene state: reads composition (evidence: `app/recorder/worker.py`)
- Recording worker → Audio session: collects audio (evidence: `app/recorder/worker.py`)
- Recording worker → Pause timeline: tracks recording time (evidence: `app/recorder/worker.py`)
- Recording worker → FFmpeg encoding: encodes and muxes (evidence: `app/recorder/worker.py`)
- Recording worker → Output and resources: creates output (evidence: `app/recorder/worker.py`)
- FFmpeg encoding → Saved recording: writes recording (evidence: `README.md`)
- Setup and settings → Pairing QR: displays pairing QR (evidence: `app/ui/dialogs.py`)
- Setup and settings → Diagnostics: runs checks (evidence: `app/ui/dialogs.py`)
- Diagnostics → FFmpeg encoding: checks encoder (evidence: `app/utils/diagnostics.py`)
- Diagnostics → Output and resources: uses data paths (evidence: `app/utils/diagnostics.py`)
