How habuskid/recordly works
Purpose and Runtime
Recordly is an AGPL desktop screen-recording and video-editing application for macOS, Windows, and Linux. It combines capture, non-linear editing, motion/cursor composition, project persistence, and MP4/GIF export in an Electron application. The renderer is a React/Vite UI; the Electron main process owns OS integration, files, native helpers, and IPC.
Entry points: electron/main.ts, electron/preload.ts, src/main.tsx, and src/App.tsx.
Process and IPC Boundary
Electron main initializes windows, media serving, updater behavior, and IPC handlers. The preload layer exposes approved native capabilities to the renderer; renderer code should not directly invoke filesystem, capture binaries, or OS APIs. IPC registration is organized by domain, with shared state/types beneath it.
Paths: electron/main.ts, electron/preload.ts, electron/ipc/handlers.ts.
Recording and Platform Capture
The launch/HUD UI selects capture sources and audio options, then invokes recording IPC. Main-process recording coordinates FFmpeg and platform-specific capture behavior. macOS uses ScreenCaptureKit Swift helpers; supported Windows uses native WGC/WASAPI helpers with Electron fallbacks; Linux relies on Electron capture. Cursor monitoring/hiding is separate so the editor can render a polished cursor overlay.
Paths: src/components/launch/LaunchWindow.tsx, electron/ipc/register/recording.ts, electron/ipc/recording/ffmpeg.ts.
Project Lifecycle
A completed or imported recording becomes a project containing source-media references plus editor state. The project manager/session IPC layer persists and reopens .recordly projects, bridging renderer edits to local files. This is the durable boundary between capture and later editing/export.
Paths: electron/ipc/project/manager.ts, electron/ipc/project/session.ts, src/components/video-editor/projectPersistence.ts.
Editor and Timeline Model
VideoEditor is the renderer’s primary editing composition. Its timeline represents temporal regions for trims, zooms, speed changes, captions, annotations, and added audio. Playback applies cursor, webcam, crop, motion, and layout state to preview; PixiJS is the stated scene-composition runtime. Editor history/preferences and project-dirty behavior support interactive mutation and persistence.
Paths: src/components/video-editor/VideoEditor.tsx, src/components/video-editor/timeline/model/timelineModel.ts, src/components/video-editor/videoPlayback/cursorRenderer.ts.
Captions, Extensions, and Media Processing
Caption generation/parsing/segmentation runs behind Electron IPC and uses bundled Whisper tooling where available. Extensions are loaded and managed in the Electron process, while renderer extension-host/render-hook code integrates their UI and scene behavior. The marketplace is an external service at marketplace.recordly.dev.
Paths: electron/ipc/captions/whisper.ts, electron/extensions/extensionLoader.ts, src/lib/extensions/extensionHost.ts.
Export Pipeline
Renderer export logic derives an output plan from editor state and renders the same visual concepts used for preview: backgrounds, annotations, captions, webcam, cursor, and audio routing. It selects browser/renderer or native paths, then delegates file production to Electron IPC. Main process uses FFmpeg and can route supported Windows static-layout exports through GPU/CUDA-native executables. Outputs are MP4 or GIF and are written/revealed through native APIs.
Paths: src/lib/exporter/modernVideoExporter.ts, electron/ipc/register/export.ts, electron/ipc/export/native-video.ts.
Native Delivery Infrastructure
Packaged Electron builds include platform entitlements and native binaries. Native components are Swift on macOS and C++/CUDA/CMake on Windows; bundled executables include capture, cursor monitoring, GPU composition, and Whisper. GitHub Actions build/release workflows and electron-builder.json5 produce distributable artifacts, including Homebrew and Winget release flows.
Paths: electron/native/ScreenCaptureKitRecorder.swift, electron/native/wgc-capture/src/main.cpp, electron-builder.json5.
Main entry points: VideoEditor.tsx Video editor · handlers.ts IPC handlers · recording.ts Recording IPC · App.tsx Application shell
Components 22
Renderer UI
React/Vite application running in the Electron renderer.
- Renderer entry
src/main.tsx - Application shell
src/App.tsx - Launch and HUD · Selects capture sources and audio options.
src/components/launch/LaunchWindow.tsx
Electron Main
Privileged process that owns native integration and IPC.
- Preload bridge · Exposes approved IPC capabilities to renderer code.
electron/preload.ts - Electron main · Initializes windows, media serving, updater behavior, and IPC.
electron/main.ts - IPC handlers · Registers domain-specific main-process handlers.
electron/ipc/handlers.ts
Capture
Recording orchestration and platform capture backends.
- Recording IPC
electron/ipc/register/recording.ts - FFmpeg capture · Coordinates FFmpeg and platform capture behavior.
electron/ipc/recording/ffmpeg.ts
Project and Editing
Durable project state and non-linear editor model.
- Project manager · Persists and reopens .recordly projects and source-media references.
electron/ipc/project/manager.ts - Project session IPC · Bridges renderer edits to the durable project manager.
electron/ipc/project/session.ts - Renderer persistence
src/components/video-editor/projectPersistence.ts - Video editor · Primary editor for preview, mutation, history, and dirty state.
src/components/video-editor/VideoEditor.tsx - Timeline model · Represents trims, zooms, speed, captions, annotations, and audio regions.
src/components/video-editor/timeline/model/timelineModel.ts - Cursor renderer · Composes polished cursor playback overlays.
src/components/video-editor/videoPlayback/cursorRenderer.ts
Export and Extensions
Media output, captions, and extension integration.
- Export planner · Derives an output plan from editor state and visual layers.
src/lib/exporter/modernVideoExporter.ts - Export IPC
electron/ipc/register/export.ts - Native video export · Produces MP4/GIF and routes supported Windows layouts to native GPU paths.
electron/ipc/export/native-video.ts - Whisper captions · Generates, parses, and segments captions through IPC.
electron/ipc/captions/whisper.ts - Extension loader · Loads and manages extensions in Electron.
electron/extensions/extensionLoader.ts - Extension host · Integrates extension UI and scene hooks.
src/lib/extensions/extensionHost.ts
Native Delivery
Platform helpers packaged with desktop builds.
- Platform capture helpers · ScreenCaptureKit on macOS and WGC/WASAPI on Windows.
electron/native/ScreenCaptureKitRecorder.swift - Desktop packaging · Packages entitlements and native binaries into distributable builds.
electron-builder.json5
Connections 26
- Renderer entry → Application shell: mounts
- Application shell → Launch and HUD: shows
- Application shell → Video editor: hosts
- Renderer entry → Preload bridge: uses approved APIs
- Preload bridge → IPC handlers: invokes
- Electron main → IPC handlers: registers
- IPC handlers → Recording IPC: routes recording
- IPC handlers → Project session IPC: routes projects
- IPC handlers → Export IPC: routes export
- Launch and HUD → Recording IPC: starts capture
- Recording IPC → FFmpeg capture: coordinates
- FFmpeg capture → Platform capture helpers: uses when supported
- Recording IPC → Project manager: creates source project
- Renderer persistence → Project session IPC: saves and reopens
- Project session IPC → Project manager: persists
- Video editor → Timeline model: edits
- Video editor → Cursor renderer: composes preview
- Video editor → Renderer persistence: persists changes
- Video editor → Export planner: supplies editor state
- Export planner → Export IPC: delegates output
- Export IPC → Native video export: produces files
- Whisper captions → Timeline model: provides captions
- Extension loader → Extension host: loads extensions for
- Extension host → Video editor: adds UI and scene hooks
- Desktop packaging → Platform capture helpers: packages
- Desktop packaging → Native video export: packages binaries