# Media (/docs/reference/media)





OpenNOW captures screenshots and recordings from the renderer video stream and stores them locally. Media is managed through the preload API and surfaced in the app UI. Native external rendering uses a separate surface, so renderer canvas/MediaRecorder capture behavior applies to the web/embedded video path.

## Storage locations [#storage-locations]

<LocalDataLocationsTable variant="media" />

## Screenshots [#screenshots]

* Triggered by the screenshot shortcut (default `F11`) or the stream overlay button.
* In the web/embedded renderer path, the renderer captures the current video frame as a data URL and sends it to the main process.
* The main process writes the image to the screenshots directory with a timestamped filename.
* Limited to the newest **60** entries.
* Screenshots can be exported to a user-selected location via a save dialog.

## Recordings [#recordings]

* Triggered by the recording shortcut (default `F12`) or the stream overlay button.
* In the web/embedded renderer path, the renderer uses `MediaRecorder` to capture the stream.
* Recording bitrate is configurable in Settings. `Auto` leaves bitrate selection to `MediaRecorder`; custom values are rounded and clamped to **1–200 Mbps** before being passed as `videoBitsPerSecond`.
* Chunks are streamed to the main process, which writes to a temp file.
* On finish, the file is renamed with duration and game title metadata.
* Limited to the newest **20** entries.
* Format depends on browser codec support — MP4 (preferred when available) or WebM.

## Media listing [#media-listing]

* Screenshots and recordings can be listed together via `listMediaByGame()`, optionally filtered by game title.
* Thumbnails are generated on demand: video thumbnails use a companion `-thumb.jpg` file when present, or fall back to `ffmpeg` extraction.
* Media can be revealed in the system file manager or deleted from the app.

## Capture flow [#capture-flow]

```text
Renderer                         Main process
   │                                  │
   ├─ saveScreenshot(dataUrl) ───────►│── write PNG to disk
   │◄─── ScreenshotEntry ────────────┤
   │                                  │
   ├─ beginRecording(mimeType) ──────►│── create temp file
   ├─ sendRecordingChunk(data) ──────►│── append to temp file
   ├─ finishRecording(duration) ─────►│── rename + save metadata
   │◄─── RecordingEntry ─────────────┤
```

## Source files [#source-files]

* `opennow-stable/src/main/ipc/mediaHandlers.ts` — screenshot, recording, and media gallery IPC handlers
* `opennow-stable/src/main/media/screenshots.ts` — screenshot persistence and listing
* `opennow-stable/src/main/media/recordings.ts` — recording temp/final file lifecycle
* `opennow-stable/src/main/media/thumbnails.ts` — thumbnail reads and regeneration
* `opennow-stable/src/main/media/mediaFiles.ts` — filename and data URL validation helpers
* `opennow-stable/src/main/mediaPaths.ts` — trusted OpenNOW media paths and playback URLs
* `opennow-stable/src/preload/index.ts` — media API bridge
* `opennow-stable/src/shared/gfn/` — `ScreenshotEntry`, `RecordingEntry`, `MediaListingResult` types
* `opennow-stable/src/renderer/src/components/StreamView.tsx` — capture UI controls
