# raminkakvand748/screen-recorder architecture

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

- Interactive diagram: https://gitdiagram.com/raminkakvand748/screen-recorder
- Repository: https://github.com/raminkakvand748/screen-recorder

## Overview

This is a Windows desktop screen recorder. The user configures a monitor, audio sources, quality and format, then starts a session that captures video and selected audio, synchronizes the timeline, and saves an encoded recording; optional compression and failure recovery follow. The application is implemented in one substantial Python file, so distinct runtime responsibilities share its path. The README documents capabilities whose implementation was not sampled; those links are cited to the README rather than presented as inspected calls.

Main entry points: [`screen_recorder.py`](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py) (Recording session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_ui["Recorder UI<br/>[screen_recorder.py]"]
  node_monitor["Monitor selection<br/>[screen_recorder.py]"]
  node_options["Recording options<br/>[screen_recorder.py]"]
  node_preview["Live preview<br/>[screen_recorder.py]"]
end

subgraph group_capture["Capture and timing"]
  node_screen["Screen capture<br/>[screen_recorder.py]"]
  node_frames["Frame timeline<br/>[screen_recorder.py]"]
  node_audio["Audio capture<br/>[screen_recorder.py]"]
  node_sync["Audio synchronization<br/>[screen_recorder.py]"]
end

subgraph group_output["Encoding and saving"]
  node_encoder["Video encoding<br/>[screen_recorder.py]"]
  node_ffmpeg["FFmpeg"]
  node_recording["Recording file"]
  node_compression["Extra compression<br/>[screen_recorder.py]"]
end

subgraph group_support["Recording controls"]
  node_session["Recording session<br/>[screen_recorder.py]"]
  node_recovery["Save recovery<br/>[screen_recorder.py]"]
end

node_user(("User"))
node_devices["Capture devices"]

node_user -->|"configures and controls"| node_ui
node_ui -->|"starts"| node_session
node_ui -->|"selects display"| node_monitor
node_ui -->|"sets options"| node_options
node_monitor -->|"chooses preview display"| node_preview
node_session -->|"starts capture"| node_screen
node_session -->|"starts recording"| node_audio
node_session -->|"starts encoding"| node_encoder
node_screen -->|"captures display"| node_devices
node_audio -->|"captures audio"| node_devices
node_screen -->|"queues timestamped frames"| node_frames
node_frames -->|"supplies frames"| node_encoder
node_audio -->|"reconstructs audio timeline"| node_sync
node_sync -->|"synchronizes audio and video"| node_encoder
node_encoder -->|"invokes"| node_ffmpeg
node_encoder -->|"writes output"| node_recording
node_session -->|"offers failure recovery"| node_recovery
node_recording -.->|"optionally compresses"| node_compression

click node_ui "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_monitor "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_options "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_preview "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_session "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_screen "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_frames "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_audio "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_sync "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_encoder "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_compression "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py"
click node_recovery "https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.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_ui,node_monitor,node_options,node_preview,node_user toneBlue
class node_screen,node_frames,node_audio,node_sync toneAmber
class node_encoder,node_ffmpeg,node_recording,node_compression toneMint
class node_session,node_recovery toneRose
class node_devices toneIndigo
```

## Components

### Desktop interface

- [Recorder UI](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Monitor selection](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Recording options](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Live preview](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`

### Capture and timing

- [Screen capture](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Frame timeline](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Audio capture](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Audio synchronization](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`

### Encoding and saving

- [Video encoding](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- **FFmpeg**
- **Recording file**
- [Extra compression](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`

### Recording controls

- [Recording session](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`
- [Save recovery](https://github.com/raminkakvand748/screen-recorder/blob/main/screen_recorder.py): `screen_recorder.py`

### Other components

- **User**
- **Capture devices**

## Connections

- User → Recorder UI: configures and controls (evidence: `README.MD`)
- Recorder UI → Recording session: starts (evidence: `screen_recorder.py`)
- Recorder UI → Monitor selection: selects display (evidence: `README.MD`)
- Recorder UI → Recording options: sets options (evidence: `README.MD`)
- Monitor selection → Live preview: chooses preview display (evidence: `README.MD`)
- Recording session → Screen capture: starts capture (evidence: `screen_recorder.py`)
- Recording session → Audio capture: starts recording (evidence: `screen_recorder.py`)
- Recording session → Video encoding: starts encoding (evidence: `screen_recorder.py`)
- Screen capture → Capture devices: captures display (evidence: `README.MD`)
- Audio capture → Capture devices: captures audio (evidence: `README.MD`)
- Screen capture → Frame timeline: queues timestamped frames (evidence: `screen_recorder.py`)
- Frame timeline → Video encoding: supplies frames (evidence: `screen_recorder.py`)
- Audio capture → Audio synchronization: reconstructs audio timeline (evidence: `README.MD`)
- Audio synchronization → Video encoding: synchronizes audio and video (evidence: `README.MD`)
- Video encoding → FFmpeg: invokes (evidence: `screen_recorder.py`)
- Video encoding → Recording file: writes output (evidence: `README.MD`)
- Recording session → Save recovery: offers failure recovery (evidence: `README.MD`)
- Recording file → Extra compression: optionally compresses (evidence: `README.MD`)
