# notdjz/clip_recorder architecture

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

- Interactive diagram: https://gitdiagram.com/notdjz/clip_recorder
- Repository: https://github.com/notdjz/clip_recorder

## Overview

Clip Recorder is a Windows instant-replay screen recorder. Its documented user workflow is to capture screen and audio continuously, then use Ctrl+Alt+R to save a configurable recent interval as MP4. The README also documents GPU-accelerated DXGI capture, audio-device settings, and a portable installer. The tree shows a single application entry point and a separate setup entry point; their source was not sampled, so the internal components below represent documented responsibilities, not verified class boundaries or implementation details.

Main entry points: [`src/clip_recorder.pyw`](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw) (Recorder app), [`src/setup.pyw`](https://github.com/notdjz/clip_recorder/blob/master/src/setup.pyw) (Portable setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture"]
  node_screen["DXGI screen capture<br/>[clip_recorder.pyw]"]
  node_audio["System audio and mic<br/>[clip_recorder.pyw]"]
end

subgraph group_replay["Replay output"]
  node_replay_buffer["Replay interval<br/>[clip_recorder.pyw]"]
  node_ffmpeg["FFmpeg encoding<br/>[clip_recorder.pyw]"]
  node_mp4["MP4 replay"]
end

subgraph group_controls["Controls and setup"]
  node_hotkey["Replay hotkey<br/>[clip_recorder.pyw]"]
  node_app["Recorder app<br/>[clip_recorder.pyw]"]
  node_settings["Capture settings<br/>[clip_recorder.pyw]"]
  node_installer["Portable setup<br/>[setup.pyw]"]
end

node_user(("User"))
node_devices["Windows capture devices"]
node_windows(("Windows system"))

node_user -->|"presses Ctrl+Alt+R"| node_hotkey
node_hotkey -->|"triggers save"| node_app
node_app -->|"captures continuously"| node_screen
node_app -->|"captures continuously"| node_audio
node_screen -->|"reads screen"| node_devices
node_audio -->|"reads audio"| node_devices
node_user -->|"selects interval and devices"| node_settings
node_settings -->|"configures capture"| node_app
node_app -->|"retains recent capture"| node_replay_buffer
node_app -->|"selects recent interval"| node_replay_buffer
node_app -->|"requests MP4 encoding"| node_ffmpeg
node_ffmpeg -->|"writes"| node_mp4
node_user -->|"runs setup"| node_installer
node_installer -->|"installs portable app"| node_windows

click node_hotkey "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_app "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_settings "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_screen "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_audio "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_replay_buffer "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_ffmpeg "https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw"
click node_installer "https://github.com/notdjz/clip_recorder/blob/master/src/setup.pyw"

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_screen,node_audio,node_user toneBlue
class node_replay_buffer,node_ffmpeg,node_mp4 toneAmber
class node_hotkey,node_app,node_settings,node_installer toneMint
class node_devices,node_windows toneIndigo
```

## Components

### Capture

- [DXGI screen capture](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`
- [System audio and mic](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`

### Replay output

- [Replay interval](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`
- [FFmpeg encoding](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`
- **MP4 replay**

### Controls and setup

- [Replay hotkey](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`
- [Recorder app](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`
- [Capture settings](https://github.com/notdjz/clip_recorder/blob/master/src/clip_recorder.pyw): `src/clip_recorder.pyw`
- [Portable setup](https://github.com/notdjz/clip_recorder/blob/master/src/setup.pyw): `src/setup.pyw`

### Other components

- **User**
- **Windows capture devices**
- **Windows system**

## Connections

- User → Replay hotkey: presses Ctrl+Alt+R
- Replay hotkey → Recorder app: triggers save
- Recorder app → DXGI screen capture: captures continuously
- Recorder app → System audio and mic: captures continuously
- DXGI screen capture → Windows capture devices: reads screen
- System audio and mic → Windows capture devices: reads audio
- User → Capture settings: selects interval and devices
- Capture settings → Recorder app: configures capture
- Recorder app → Replay interval: retains recent capture
- Recorder app → Replay interval: selects recent interval
- Recorder app → FFmpeg encoding: requests MP4 encoding
- FFmpeg encoding → MP4 replay: writes
- User → Portable setup: runs setup
- Portable setup → Windows system: installs portable app
