Repository navigation
feat: opt-in Windows Graphics Capture backend for window stills (#113) - #146
Merged
Merged
Conversation
screenshot and find_text accept backend: "wgc" for window: targets, which captures the window's own surface by handle via FFmpeg 8's gfxcapture, even when covered. Recordings stay on gdigrab: gfxcapture only emits a frame on repaint, so a static-window recording stalls and ignores the graceful stop. Refs #113 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #113. This covers stills; recording is blocked (see below), so the issue stays open.
What
backend: "wgc"onscreenshotandfind_text(window targets): captures the window's own surface through FFmpeg 8'sgfxcapture, selected by window handle (hwnd=). There's no title regex to quote, and it can't match the wrong window. gdigrab stays the default.[int64]$h), carried onWindowBounds.wgcAvailable()probesffmpeg -h filter=gfxcaptureonce. Without it, a clear error and hint. A non-window target withwgcis rejected.captureStill()(utils/still.ts) so both tools pick the backend the same way. Results reportbackend.Measured (FFmpeg 8.1.1, Windows 11)
wgcmean RGB ≈ (2, 255, 0) (the window itself), gdigrab ≈ (255, 0, 255) (the cover). This is now a live-harness test.gfxcaptureemits a frame only when the window repaints. Recording a static window via-f lavfi -i gfxcapture…(with anfpsfill or a constant-clockoverlay) blocks waiting for input: ffmpeg ignores the graceful-stopqand the file comes out empty. That would breakstop_recording, sostart_recordingandwait_for_changestay on gdigrab. The README documents this. A real fix probably needs a capture source that repeats the last frame on a timer (a native helper or an upstreamgfxcaptureoption). I'll note it on Windows Graphics Capture backend via FFmpeg gfxcapture for true per-window capture #113.Tests
wgcon aregion:target errors clearly. While here, I made the wait_for_change and screen_diff: let agents wait for and verify on-screen changes #116wait_for_changelive test wait until its window is actually up (PowerShell + WinForms startup varies), which fixed one flaky run. Harness 14/14, three runs in a row.Version 0.20.0; README,
mcp-tools.json, CHANGELOG.🤖 Generated with Claude Code