# getopenscreen/openscreen architecture

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

- Interactive diagram: https://gitdiagram.com/getopenscreen/openscreen
- Repository: https://github.com/getopenscreen/openscreen

## Overview

OpenScreen is a cross-platform desktop screen recorder and video editor. The main workflow is to choose a screen or window and audio sources, record media, edit the resulting project—with timeline tools, captions, and optional AI assistance—and export a polished MP4 or GIF. The graph preserves those documented capabilities and distinguishes the Electron/UI layer from native capture and rendering. Some subsystem links are documented only at product level; unsampled implementation details are not inferred as direct calls.

Main entry points: [`crates/compositor/src/scene.rs`](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/scene.rs) (Native compositor), [`electron/ipc/handlers.ts`](https://github.com/getopenscreen/openscreen/blob/main/electron/ipc/handlers.ts) (IPC handlers), [`src/hooks/useScreenRecorder.ts`](https://github.com/getopenscreen/openscreen/blob/main/src/hooks/useScreenRecorder.ts) (Recording controller), [`src/lib/ai-edition/schema/index.ts`](https://github.com/getopenscreen/openscreen/blob/main/src/lib/ai-edition/schema/index.ts) (Project document)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_main["Electron main<br/>[main.ts]"]
  node_ipc["IPC handlers<br/>[handlers.ts]"]
end

subgraph group_capture["Recording and capture"]
  node_launch["Capture setup UI<br/>[LaunchWindow.tsx]"]
  node_recorder["Recording controller"]
  node_session["Recording session"]
end

subgraph group_editing["Editing and AI"]
  node_project["Project document<br/>[index.ts]"]
  node_timeline["Timeline editing<br/>[useTimeline.ts]"]
  node_preview["Editor preview<br/>[VirtualPreview.tsx]"]
  node_captions["On-device captions<br/>[index.ts]"]
  node_ai["AI editing agent<br/>[service.ts]"]
  node_exportui["Export interface<br/>[ExportDialog.tsx]"]
end

subgraph group_media["Media processing"]
  node_compositor["Native compositor<br/>[scene.rs]"]
  node_linuxexport["Linux export pipeline<br/>[pipeline_linux.rs]"]
  node_macexport["macOS export pipeline<br/>[pipeline_macos.rs]"]
  node_winexport["Windows export pipeline"]
  node_audio["Audio processing<br/>[audio.rs]"]
  node_gif["GIF export<br/>[gif_export.rs]"]
end

subgraph group_native["Native platform engines"]
  node_linuxcap["Linux capture<br/>[main.rs]"]
  node_wincap["Windows capture<br/>[main.cpp]"]
  node_macoscap["macOS capture"]
end

node_user(("Creator"))
node_output["MP4 or GIF"]

node_user -->|"chooses sources"| node_launch
node_app -->|"shows capture UI"| node_launch
node_launch -.->|"starts recording"| node_recorder
node_recorder -->|"manages session"| node_session
node_recorder -->|"requests capture"| node_ipc
node_ipc -.->|"starts native capture"| node_linuxcap
node_ipc -.->|"starts native capture"| node_wincap
node_ipc -.->|"starts native capture"| node_macoscap
node_session -.->|"creates project"| node_project
node_project -->|"defines edit state"| node_timeline
node_timeline -->|"drives preview"| node_preview
node_project -.->|"transcribes audio"| node_captions
node_user -->|"requests edit"| node_ai
node_ai -->|"applies edits"| node_timeline
node_user -->|"requests export"| node_exportui
node_exportui -.->|"requests render"| node_compositor
node_compositor -.->|"uses pipeline"| node_linuxexport
node_compositor -.->|"uses pipeline"| node_macexport
node_compositor -.->|"uses pipeline"| node_winexport
node_linuxexport -->|"processes audio"| node_audio
node_macexport -->|"processes audio"| node_audio
node_winexport -->|"processes audio"| node_audio
node_linuxexport -->|"encodes video"| node_output
node_macexport -.->|"renders export"| node_output
node_winexport -.->|"renders export"| node_output
node_compositor -.->|"supports GIF"| node_gif
node_gif -.->|"writes GIF"| node_output

click node_app "https://github.com/getopenscreen/openscreen/blob/main/src/App.tsx"
click node_main "https://github.com/getopenscreen/openscreen/blob/main/electron/main.ts"
click node_ipc "https://github.com/getopenscreen/openscreen/blob/main/electron/ipc/handlers.ts"
click node_launch "https://github.com/getopenscreen/openscreen/blob/main/src/components/launch/LaunchWindow.tsx"
click node_recorder "https://github.com/getopenscreen/openscreen/blob/main/src/hooks/useScreenRecorder.ts"
click node_session "https://github.com/getopenscreen/openscreen/blob/main/src/lib/recordingSession.ts"
click node_linuxcap "https://github.com/getopenscreen/openscreen/blob/main/electron/native/pipewire-capture/src/main.rs"
click node_wincap "https://github.com/getopenscreen/openscreen/blob/main/electron/native/wgc-capture/src/main.cpp"
click node_macoscap "https://github.com/getopenscreen/openscreen/blob/main/electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swift"
click node_project "https://github.com/getopenscreen/openscreen/blob/main/src/lib/ai-edition/schema/index.ts"
click node_timeline "https://github.com/getopenscreen/openscreen/blob/main/src/lib/ai-edition/store/useTimeline.ts"
click node_preview "https://github.com/getopenscreen/openscreen/blob/main/src/components/ai-edition/VirtualPreview.tsx"
click node_captions "https://github.com/getopenscreen/openscreen/blob/main/electron/stt/index.ts"
click node_ai "https://github.com/getopenscreen/openscreen/blob/main/electron/ai-edition/deep-agent/service.ts"
click node_exportui "https://github.com/getopenscreen/openscreen/blob/main/src/components/ai-edition/ExportDialog.tsx"
click node_compositor "https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/scene.rs"
click node_linuxexport "https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/pipeline_linux.rs"
click node_macexport "https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/pipeline_macos.rs"
click node_winexport "https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/pipeline_windows.rs"
click node_audio "https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/audio.rs"
click node_gif "https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/gif_export.rs"

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_app,node_main,node_ipc toneBlue
class node_launch,node_recorder,node_session toneAmber
class node_project,node_timeline,node_preview,node_captions,node_ai,node_exportui toneMint
class node_compositor,node_linuxexport,node_macexport,node_winexport,node_audio,node_gif toneRose
class node_linuxcap,node_wincap,node_macoscap,node_user,node_output toneIndigo
```

## Components

### Desktop experience

- [App shell](https://github.com/getopenscreen/openscreen/blob/main/src/App.tsx): `src/App.tsx`
- [Electron main](https://github.com/getopenscreen/openscreen/blob/main/electron/main.ts): `electron/main.ts`
- [IPC handlers](https://github.com/getopenscreen/openscreen/blob/main/electron/ipc/handlers.ts): `electron/ipc/handlers.ts`

### Recording and capture

- [Capture setup UI](https://github.com/getopenscreen/openscreen/blob/main/src/components/launch/LaunchWindow.tsx): `src/components/launch/LaunchWindow.tsx`
- [Recording controller](https://github.com/getopenscreen/openscreen/blob/main/src/hooks/useScreenRecorder.ts): `src/hooks/useScreenRecorder.ts`
- [Recording session](https://github.com/getopenscreen/openscreen/blob/main/src/lib/recordingSession.ts): `src/lib/recordingSession.ts`

### Editing and AI

- [Project document](https://github.com/getopenscreen/openscreen/blob/main/src/lib/ai-edition/schema/index.ts): `src/lib/ai-edition/schema/index.ts`
- [Timeline editing](https://github.com/getopenscreen/openscreen/blob/main/src/lib/ai-edition/store/useTimeline.ts): `src/lib/ai-edition/store/useTimeline.ts`
- [Editor preview](https://github.com/getopenscreen/openscreen/blob/main/src/components/ai-edition/VirtualPreview.tsx): `src/components/ai-edition/VirtualPreview.tsx`
- [On-device captions](https://github.com/getopenscreen/openscreen/blob/main/electron/stt/index.ts): `electron/stt/index.ts`
- [AI editing agent](https://github.com/getopenscreen/openscreen/blob/main/electron/ai-edition/deep-agent/service.ts): `electron/ai-edition/deep-agent/service.ts`
- [Export interface](https://github.com/getopenscreen/openscreen/blob/main/src/components/ai-edition/ExportDialog.tsx): `src/components/ai-edition/ExportDialog.tsx`

### Media processing

- [Native compositor](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/scene.rs): `crates/compositor/src/scene.rs`
- [Linux export pipeline](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/pipeline_linux.rs): `crates/compositor/src/pipeline_linux.rs`
- [macOS export pipeline](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/pipeline_macos.rs): `crates/compositor/src/pipeline_macos.rs`
- [Windows export pipeline](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/pipeline_windows.rs): `crates/compositor/src/pipeline_windows.rs`
- [Audio processing](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/audio.rs): `crates/compositor/src/audio.rs`
- [GIF export](https://github.com/getopenscreen/openscreen/blob/main/crates/compositor/src/gif_export.rs): `crates/compositor/src/gif_export.rs`

### Native platform engines

- [Linux capture](https://github.com/getopenscreen/openscreen/blob/main/electron/native/pipewire-capture/src/main.rs): `electron/native/pipewire-capture/src/main.rs`
- [Windows capture](https://github.com/getopenscreen/openscreen/blob/main/electron/native/wgc-capture/src/main.cpp): `electron/native/wgc-capture/src/main.cpp`
- [macOS capture](https://github.com/getopenscreen/openscreen/blob/main/electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swift): `electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swift`

### Other components

- **Creator**
- **MP4 or GIF**

## Connections

- Creator → Capture setup UI: chooses sources
- App shell → Capture setup UI: shows capture UI (evidence: `src/App.tsx`)
- Capture setup UI → Recording controller: starts recording
- Recording controller → Recording session: manages session (evidence: `src/hooks/useScreenRecorder.ts`)
- Recording controller → IPC handlers: requests capture (evidence: `electron/ipc/handlers.ts`)
- IPC handlers → Linux capture: starts native capture
- IPC handlers → Windows capture: starts native capture
- IPC handlers → macOS capture: starts native capture
- Recording session → Project document: creates project
- Project document → Timeline editing: defines edit state (evidence: `src/lib/ai-edition/store/useTimeline.ts`)
- Timeline editing → Editor preview: drives preview (evidence: `src/components/ai-edition/VirtualPreview.tsx`)
- Project document → On-device captions: transcribes audio
- Creator → AI editing agent: requests edit
- AI editing agent → Timeline editing: applies edits (evidence: `electron/ai-edition/deep-agent/service.ts`)
- Creator → Export interface: requests export
- Export interface → Native compositor: requests render
- Native compositor → Linux export pipeline: uses pipeline
- Native compositor → macOS export pipeline: uses pipeline
- Native compositor → Windows export pipeline: uses pipeline (evidence: `crates/compositor/src/pipeline_windows.rs`)
- Linux export pipeline → Audio processing: processes audio (evidence: `crates/compositor/src/pipeline_linux.rs`)
- macOS export pipeline → Audio processing: processes audio (evidence: `crates/compositor/src/pipeline_macos.rs`)
- Windows export pipeline → Audio processing: processes audio (evidence: `crates/compositor/src/pipeline_windows.rs`)
- Linux export pipeline → MP4 or GIF: encodes video (evidence: `crates/compositor/src/pipeline_linux.rs`)
- macOS export pipeline → MP4 or GIF: renders export
- Windows export pipeline → MP4 or GIF: renders export
- Native compositor → GIF export: supports GIF
- GIF export → MP4 or GIF: writes GIF
