WinVideo is a modern, high-performance Windows screen and window video capture engine by SINARYβ’, written in pure Rust, with native Python bindings (pyo3) and a standalone command-line executable.
It captures digital video frames at 60 to 120+ FPS from specific applications (e.g., Discord, Spotify, Chrome, games) or entire monitors directly from GPU memory using Windows Graphics Capture (WGC) and Direct3D 11 β without OBS, virtual display drivers, or GDI lag.
Note
Video-Only Engine (Visual Stream):
WinVideo is dedicated exclusively to ultra-fast, zero-copy visual capture (GPU frame extraction, screen recording, and lossless screenshots). The resulting .mp4 file contains a video stream only (no audio track).
To record internal application or desktop audio, pair WinVideo with our companion library WinAudio. See Audio + Video Recording below.
- π― Target Any Window or Application: Capture video by Process ID (
--pid), executable name (--name chrome.exe), window title substring (--window "YouTube"), or monitor index (--monitor 1). - β‘ Direct3D 11 Hardware Acceleration: Zero-copy GPU memory extraction delivers 60β120+ FPS with ~1% CPU usage.
- π² Dynamic Process Tree Resolution: Automatically discovers child rendering processes (such as
msedgewebview2.exein WebView2 apps orchrome.exeGPU workers) and maps them to their host window. - π Zero-Copy NumPy Pipeline for AI: Stream raw BGRA/RGBA frames directly into NumPy arrays for OpenCV, PyTorch, or Vision LLM agents (Claude Computer-Use, OpenAI Operator).
- π¬ Built-in Hardware MP4 Encoding: Record directly to
.mp4using Windows Media Foundation (MFT) hardware encoders (NVENC, Intel QuickSync, AMD AMF) with zero externalffmpegdependencies. - π« Yellow Border Suppression: Programmatically disables the Windows capture border (
BorderRequired = false). - π±οΈ Cursor Control: Optional capture of the mouse cursor (
--cursoror--no-cursor). - πΈ Instant Lossless Screenshots: Capture single-frame screenshots directly to PNG, JPEG, or BMP.
- π Perfect Companion to WinAudio: Pair with WinAudio for a 100% native, driverless desktop audio and video recording stack.
- π Built-in Runnable Cheatsheet: Run
winvideo commandsat any time to see every runnable command with copy-pasteable examples.
win_video/
βββ crates/
β βββ winvideo-core/ # Core WGC & Direct3D 11 engine, MFT hardware MP4 encoder
β βββ winvideo-cli/ # Standalone CLI binary (target/release/winvideo.exe)
β βββ winvideo-python/ # PyO3 C-extension module for Python (sinary-winvideo)
βββ python/ # Prebuilt Python extension (winvideo.pyd) & test scripts
βββ winvideo.cmd # Direct Windows CMD launcher wrapper
βββ winvideo.ps1 # Direct PowerShell launcher wrapper
βββ Cargo.toml # Root workspace manifest
βββ README.md
- Windows 10 Build 19041 (Version 2004) or newer (required for Windows Graphics Capture).
- Windows 11 (all builds supported).
- Direct3D 11 Capable GPU: NVIDIA, Intel, or AMD graphics (NVENC, QuickSync, or AMF for hardware MFT MP4 encoding).
- Rust Toolchain:
stable(1.75+ recommended). - Python: 3.8+ (for Python bindings).
Install the precompiled binary Python extension module (supports Python 3.8 to 3.13):
pip install sinary-winvideoInstall the standalone CLI binary:
cargo install winvideo-cliOr add the core Rust video capture engine to your project's Cargo.toml:
[dependencies]
winvideo-core = "0.1.0"Download the standalone winvideo.exe from the GitHub Releases page and place it in your PATH.
# Build optimized release binary
cargo build --release -p winvideo-cli
# The executable will be at:
# target\release\winvideo.exe# Build the cdylib
cargo build --release -p winvideo-python
# Copy the DLL to python/winvideo.pyd
Copy-Item target\release\winvideo.dll -Destination python\winvideo.pyd -Forcecargo test --workspaceYou can run commands using winvideo (via the included winvideo.cmd) or directly using .\target\release\winvideo.exe.
winvideo commands# List all capturable application windows and connected monitors
winvideo list
# List only physical display monitors
winvideo list --monitors# Record Chrome window live continuously (press Ctrl+C anytime to stop and save)
winvideo record --name chrome.exe
# Record for a specific duration (e.g. 10 seconds, 1 hour = 3600s)
winvideo record --name chrome.exe --duration 10 --out chrome.mp4
# Record specific application by Process ID
winvideo record --pid 15024 --out app.mp4
# Record window matching title substring
winvideo record --window "YouTube" --duration 15 --out video.mp4No Time Limits: WinVideo is not restricted by time. When
--durationis omitted, it records live continuously for 1 hour, 2 hours, or longer. PressCtrl + Cat any time to gracefully finalize and save your complete MP4 recording.
# Record primary display monitor at native 60 FPS
winvideo record --monitor 1 --out desktop.mp4
# Record secondary monitor at 120 FPS
winvideo record --monitor 2 --fps 120 --out gaming.mp4# Screenshot of Chrome window to screenshot.png
winvideo screenshot --name chrome.exe
# Screenshot of specific window title to custom file path
winvideo screenshot --window "Visual Studio Code" --out ide.png
# Screenshot of full primary display
winvideo screenshot --monitor 1 --out display.png# Hide mouse cursor in video
winvideo record --name game.exe --no-cursor
# Record at 30 FPS to reduce video file size
winvideo record --name app.exe --fps 30
# Show Windows yellow capture border (default: hidden)
winvideo record --name app.exe --borderImport winvideo directly into your Python scripts:
import winvideo
import cv2
# 1. Enumerate capturable application windows and monitors
for win in winvideo.list_windows():
print(f"[{win.pid}] {win.process_name} ({win.width}x{win.height}) - '{win.title}'")
for mon in winvideo.list_monitors():
print(f"[{mon.index}] {mon.name} - {mon.width}x{mon.height} @ {mon.refresh_rate}Hz")
# 2. Capture lossless screenshot
winvideo.screenshot("chrome_screenshot.png", name="chrome.exe")
# 3. Stream frames directly into OpenCV / PyTorch / AI vision agents (60 FPS, ~1% CPU)
with winvideo.Capture(name="game.exe", cursor=False) as cap:
for frame in cap.stream():
# frame is a zero-copy numpy array (Height, Width, 4) uint8 (BGRA)
cv2.imshow("DirectX Stream", frame)
if cv2.waitKey(1) == 27: # ESC to exit
break
# 4. Record application directly to MP4 (video stream only)
with winvideo.Capture(name="Discord.exe") as cap:
cap.record_to_mp4("meeting.mp4", duration_seconds=10.0)Add winvideo-core to your project's Cargo.toml:
[dependencies]
winvideo-core = "0.1.0"use std::time::Duration;
use winvideo_core::{capture_screenshot, list_windows, record_mp4, CaptureConfig, Target};
fn main() -> anyhow::Result<()> {
// 1. List capturable application windows
let windows = list_windows()?;
for w in windows {
println!("[{}] {} - '{}'", w.pid, w.process_name, w.title);
}
// 2. Take an instant lossless screenshot
capture_screenshot(&Target::ByName("chrome.exe".into()), "chrome.png")?;
// 3. Record application directly to hardware-encoded MP4
let config = CaptureConfig::default();
let stop_signal = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
record_mp4(
&Target::ByName("Spotify.exe".into()),
"spotify.mp4",
Some(Duration::from_secs(10)),
&config,
stop_signal,
)?;
println!("MP4 recording complete!");
Ok(())
}WinVideo records video; WinAudio records internal application audio. Because both use Windows hardware high-resolution timers (QueryPerformanceCounter), they run concurrently with zero conflict:
import threading
import winaudio
import winvideo
TARGET = "Spotify.exe"
# Record 10s of audio and video concurrently
t_audio = threading.Thread(target=lambda: winaudio.record(name=TARGET, out="audio.wav", duration=10))
t_video = threading.Thread(target=lambda: winvideo.record(name=TARGET, out="video.mp4", duration=10))
t_audio.start()
t_video.start()
t_audio.join()
t_video.join()
print("Recorded audio.wav and video.mp4 simultaneously!")Merge the MP4 video and WAV audio into a single finalized video without re-encoding:
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac final_recording.mp4 ββββββββββββββββββββββββββββββββββββββββββββββββ
β winvideo CLI / Python / Rust API β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
ββββββββββββββββββββββββΌββββββββββββββββββββββββ
β winvideo-core β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ€
β Target Resolver β Windows Graphics Cap β
β (Process Tree Walker)β(CreateForWindow/Item) β
ββββββββββββββββββββββββΌββββββββββββββββββββββββ€
β Direct3D 11 Engine β Hardware MFT Encoder β
β (Zero-Copy GPU VRAM) β (NVENC / QuickSync) β
ββββββββββββββββββββββββΌββββββββββββββββββββββββ€
β Border Suppression β Frame Dispatcher β
β(BorderRequired=false)β(Crossbeam & NumPy DMA)β
ββββββββββββββββββββββββ΄ββββββββββββ¬ββββββββββββ
β
βββββββββββββββββββΌββββββββββββ
β Windows Graphics Capture β
β + Direct3D 11 Device Engine β
βββββββββββββββββββ¬ββββββββββββ
β
βββββββββββββββββββΌββββββββββββ
β Desktop Window Manager(DWM) β
βββββββββββββββββββββββββββββββ
WinVideo adheres to a strict local-only, zero-telemetry policy:
- 100% Offline Execution: WinVideo contains zero network calls, tracking beacons, or analytics.
- Local Storage Only: Video files and screenshots are saved strictly to the paths you specify on your local drive.
- No Webcam Access: WinVideo does not access, activate, or record webcams or physical cameras.
- No Microphone or Audio Capture: WinVideo exclusively captures visual frames; sound is never recorded. For audio, see WinAudio.
See PRIVACY.md for full details.
Copyright Β© 2026 SINARYβ’. All rights reserved.
SINARYβ’ and the SINARY logo are trademarks of SINARY.
Dual-licensed under either:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.