Skip to content

didvc/simple-desktop-replay

simple-desktop-replay

A lightweight, always-on rolling replay buffer for the Windows desktop. It works like a DVR, continuously keeping the last few minutes of your screen in RAM so you can save a moment after it has already happened, without the overhead of a full screen recorder.

Frames live only in a bounded in-memory ring. Nothing is written to disk until you press Save, and the whole thing is built to run all day at a fraction of an OBS-style capture's cost.

The viewer showing a live preview of the rolling buffer

The password gate that fronts the viewer

The password gate that fronts the viewer

Why

Screen recorders answer "record from now." This one answers "I just saw something and want the last few minutes," the oops-moment case, while sitting quietly in the background the rest of the time.

Build & run

Requires a Rust MSVC toolchain on Windows.

cargo build --release --workspace
cargo run --release --bin sdr           # opens the viewer window

Config flags take any subset of --fps N --width W --height H --window-secs S --max-mb M --monitor I. Defaults are 1 fps, 1280x720, a 5-minute window, and a 256 MiB cap on monitor 0.

sdr                                              # defaults
sdr --fps 10 --width 1920 --height 1080          # 10 fps, 1080p
sdr --window-secs 600 --max-mb 512 --monitor 1   # 10-min buffer, 512 MiB, second monitor

The viewer opens unlocked unless SDR_PASSWORD is set. There is no default password. SDR_DURESS sets a duress password that wipes the buffer and shows an empty viewer, and SDR_BURN_AFTER=N wipes it after N wrong attempts. Set these before launching (PowerShell shown):

$env:SDR_PASSWORD="hunter2"; sdr
$env:SDR_PASSWORD="real"; $env:SDR_DURESS="fake"; $env:SDR_BURN_AFTER="5"; sdr

A headless mode helps with CI and non-interactive runs. SDR_TEST_SECS=<n> prints ring health for n seconds instead of opening the window, and SDR_DUMP=<path> writes the final buffer as a raw Annex-B H.264 stream, playable with ffplay and inspectable with ffprobe.

$env:SDR_TEST_SECS="60"; $env:SDR_DUMP="C:\tmp\replay.h264"; sdr
ffprobe C:\tmp\replay.h264
Running on a GPU-less VM (Hyper-V / RDP)

Capture must run in the interactive desktop session. A session-0 service login gets DXGI_ERROR_NOT_CURRENTLY_AVAILABLE. On a synthetic GPU with no OpenGL 2+, the egui viewer needs a software OpenGL, so drop Mesa's opengl32.dll and libgallium_wgl.dll (llvmpipe) next to the executable and set GALLIUM_DRIVER=llvmpipe. This is only needed on GPU-less hosts. A real GPU renders natively.

Architecture

Internals, the capture, encode, ring buffer, and viewer pipeline, plus the crate layout, live in architecture.md.

Status

The engine is done and tested end to end, from the ring and capture loop through config to the gate. DXGI desktop capture, H.264 encode and decode, and the native viewer all work. The viewer gives you a live preview, a timeline scrubber, Save/Burn/Lock buttons, plus the password gate.

Still planned: a tray icon, a global "save last N minutes" hotkey, config persistence, an optional camera source, and a zero-copy GPU capture to hardware-encoder path. The current build does a CPU readback and software encode, which is fine at low frame rates but not the endgame.

Disclaimer

Provided as-is, with no warranty (see the licenses). The password and burn feature is only a convenience gate against someone sitting at your unlocked machine. It is not a security boundary. Anyone with administrative or debugging access can read the frames straight from process memory. There is intentionally no in-RAM encryption, because the encoding key would have to live in the same process and so would not help. Avoid this tool anywhere the loss or exposure of on-screen content would cause you harm.

License

Apache-2.0 (LICENSE-APACHE) and MIT (LICENSE). Each source file carries its own SPDX identifier stating which applies.

About

Always-on rolling replay buffer for the Windows desktop: a low-overhead RAM DVR that keeps the last few minutes of screen so you can save the moment after it happens.

Topics

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors