https://github.com/priyanshuchawda/screen-recorder
Native Windows screen recorder in C++20 using Windows Graphics Capture, Media Foundation, and WASAPI with robust MP4 finalize/recovery handling.
https://github.com/priyanshuchawda/screen-recorder
audio-capture cmake cpp cpp20 d3d11 desktop-application directx github-actions h264 intel-quick-sync media-foundation mp4 native-windows screen-capture screen-recorder video-recording wasapi win32 windows windows-graphics-capture
Last synced: 24 days ago
JSON representation
Native Windows screen recorder in C++20 using Windows Graphics Capture, Media Foundation, and WASAPI with robust MP4 finalize/recovery handling.
- Host: GitHub
- URL: https://github.com/priyanshuchawda/screen-recorder
- Owner: priyanshuchawda
- License: mit
- Created: 2026-02-24T08:31:52.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-17T15:42:57.000Z (3 months ago)
- Last Synced: 2026-03-18T05:32:36.615Z (3 months ago)
- Topics: audio-capture, cmake, cpp, cpp20, d3d11, desktop-application, directx, github-actions, h264, intel-quick-sync, media-foundation, mp4, native-windows, screen-capture, screen-recorder, video-recording, wasapi, win32, windows, windows-graphics-capture
- Language: C++
- Homepage: https://github.com/priyanshuchawda/screen-recorder
- Size: 839 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ScreenRecorder
Lightweight native Windows screen recorder built with C++20, Win32, Windows Graphics Capture, Media Foundation, and WASAPI.





## Features
- Full-screen capture via Windows Graphics Capture (WGC)
- H.264 video + AAC audio muxed to MP4 using Media Foundation
- **System Audio Capture**: Record desktop/YouTube audio via WASAPI Loopback
- **Microphone Noise Gate**: RMS-based gating to eliminate background hiss
- **Camera Overlay**: Efficient default preview with an HQ 720p-capable profile
- **Anti-Ducking**: Opt-out from Windows auto-lowering volume during capture
- **High Quality Mode**: Optional 1080p-capable hardware profile with higher bitrate recording (8/10 Mbps) on AC or battery
- Pause/resume with monotonic timestamp rebasing
- Mute/unmute with silence injection
- Recovery flow for orphaned `.partial.mp4` files
- Low-disk auto-stop and output directory management
- Hardware-first H.264 encoder selection with graceful software fallback
## Build Requirements
- Windows 10/11 (x64)
- Visual Studio Build Tools / VS 2022 with C++ workload
- Windows SDK 10.0.26100+
- CMake 3.20+
## Build & Run
```powershell
# Configure
cmake -B build -G "Visual Studio 18 2026" -A x64
# Build (Debug)
cmake --build build --config Debug
# Run tests
ctest --test-dir build -C Debug --output-on-failure
# Run app
.\build\Debug\ScreenRecorder.exe
```
## Package (ZIP)
```powershell
# Configure once (if not already configured)
cmake -B build -G "Visual Studio 18 2026" -A x64
# Build release binary
cmake --build build --config Release
# Create distributable zip
cpack --config build\CPackConfig.cmake -C Release
```
Generated artifact:
- `ScreenRecorder-0.3.5-windows-x64.zip`
## Release
Use GitHub CLI to publish a tagged release with the package:
```powershell
git tag v0.3.5
git push origin v0.3.5
gh release create v0.3.5 ScreenRecorder-0.3.5-windows-x64.zip --title "v0.3.5" --notes "Release v0.3.5: version bump, high-quality mode battery overrides, camera mirroring fixes, and hardware profile tuning."
```
## Project Layout
```text
src/
app/ controller/ capture/ audio/ encoder/ storage/ sync/ utils/
tests/
unit/ integration/
```
## CI
GitHub Actions workflow: `.github/workflows/windows-ci.yml`
## Notes
- Use Visual Studio generator for reliable Windows builds.
- If finalize fails, output remains `.partial.mp4` and is not renamed to `.mp4`.
## License
MIT License. See `LICENSE`.