Skip to content

Latest commit

 

History

74 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClipRecorder

Lightweight Windows background recorder — captures your screen and audio into a ring buffer, then saves the last N seconds as an MP4 file at the press of a hotkey. Think Instant Replay / ShadowPlay but minimal, open-source, and built on Windows Media Foundation + DirectX 11.

На русском / Russian


Features

  • Hardware H.264 encoding via GPU MFT — near-zero CPU impact
  • System audio + microphone — mixed and recorded simultaneously
  • Configurable duration, resolution & frame rate — 30s–10min, 720p–2K, 30/60/120 FPS
  • Global hotkey — save the last N seconds from any app (default: Alt+X)
  • Low background CPU — ~0.5% on 12-thread CPU in tray mode
  • Minimal UI — ImGui settings panel, hides to system tray
  • Dark & light themes — toggle in the header bar
  • Russian / English UI — switch language on the fly
  • Ring buffer architecture — no disk writes until you hit save

Download

Grab the latest ready-to-run ClipRecorder.exe from the Releases page — it's a single self-contained file, no dependencies or extra files needed. Just download and launch.


Requirements

Component Requirement
OS Windows 10 20H1+ or Windows 11
GPU GPU with H.264 hardware encoder (AMD, NVIDIA, or Intel)

Any modern GPU with an H.264 hardware MFT encoder works — the app uses generic Media Foundation enumeration (MFTEnumEx), not a vendor-specific SDK.


Build Instructions

Component Requirement
Build tools Visual Studio 2022 with Desktop development with C++ workload
CMake 3.20+

1. Clone and prepare

git clone https://github.com/By183/ClipRecorder.git
cd ClipRecorder

2. Configure with CMake

Debug (full debug symbols, larger binary):

cmake --preset "x64-Debug"

Release (optimised, shipping binary):

cmake --preset "x64-Release"

3. Build

# Debug
cmake --build out\build\x64-Debug --config Debug

# Release
cmake --build out\build\x64-Release --config Release

The executable lands in out\build\x64-<config>\Release\ClipRecorder.exe.

Visual Studio

Open the folder in Visual Studio and use the built-in CMake integration — it will automatically detect the CMakePresets.json and show Debug/Release configurations.


Usage

  1. Launch ClipRecorder.exe — recording starts automatically on startup
  2. Configure via the UI window: save folder, hotkey, resolution, duration, mic on/off
  3. Minimise to tray (title bar button) — recording continues in background
  4. Press your hotkey (default: Alt+X) to save the last N seconds as Clip_YYYY-MM-DD_HH-MM-SS.mp4 to the configured save folder
  5. Exit via tray context menu (right-click the tray icon) or close window

Project Structure

ClipRecorder/
├── src/               # Application source code
│   ├── main.cpp       # Entry point, window loop, hotkey registration
│   ├── recorder.cpp   # WGC capture → NV12 → H.264 encode → ring buffer → MP4 save
│   ├── recorder.h     # Recorder class, MediaParams, ring buffer types
│   ├── ui.cpp         # ImGui settings window, config management
│   ├── ui.h           # UIState, RenderUI, hotkey capture
│   ├── tray.cpp       # System tray icon + context menu
│   ├── tray.h         # TrayAdd/TrayRemove/context menu IDs
│   ├── config.cpp     # JSON config load/save
│   ├── config.h       # AppConfig struct
│   ├── localize.cpp   # RU/EN string tables
│   ├── localize.h     # StringId enum, T() lookup
│   └── app.rc         # Windows resource script (app icon)
├── assets/            # Application resources
│   └── app.ico        # Multi-resolution app icon (16px–256px)
├── imgui/             # Dear ImGui library (subdirectory)
├── json/              # nlohmann_json library (subdirectory)
├── CMakeLists.txt     # CMake build definition
├── CMakePresets.json  # CMake presets (Debug, Release, Ninja)
└── .gitignore

Architecture (Brief)

Desktop (DXR)  --WGC-->  WGC Pool (4x tex)  --NV12-->  H.264 Encoder (MFT/hw)
                                                          |
                                                          v
Loopback + Mic --WASAPI--> Audio Buffer (48kHz f32) --mix--> AAC Encoder (MFT async)
                                                          |
                                                          v
                                               Ring Buffer (AVC/AnnexB)
                                                          |
                                                          v Alt+X
                                               MP4 Mux (SinkWriter)

License

This project is unlicensed — all rights reserved by the author.


Built using C++20, DirectX 11, Windows Media Foundation, and Dear ImGui.

About

Lightweight Windows background recorder — screen + system audio, hardware H.264 encoding, ring buffer, one-hotkey MP4 save. 720p–2K @ 30/60/120 FPS.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages