Repository navigation
feat: record a window through Windows Graphics Capture (#113) - #165
Merged
Merged
Conversation
start_recording backend: "wgc" records a window's own surface, covered, moved, or in the background. A recorder process nudges the window with 1px repaints so gfxcapture keeps emitting frames, repeats the latest frame at a fixed rate, and stops on q like ffmpeg. Closes #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.
Closes #113: the recording half, which was blocked.
Why it was blocked, and what I measured (FFmpeg 8.1.1):
gfxcaptureemits a frame only when the window presents. A static window gave zero frames, by title or by HWND, and ffmpeg then ignored the graceful-stopq.RedrawWindowgives a first frame within ~30 ms.Design:
start_recording { backend: "wgc" }(window: targets, FFmpeg 8+) spawnsdist/wgcRecorder.jsinstead of ffmpeg:gfxcapture=hwnd=…into even-sized raw yuv420p on stdout, with-flush_packets 1.qon stdin, stdin closing (server gone), or the duration cap finalizes and exits 0; the window closing ends the recording cleanly.stop_recording,maxDurationSec, crash detection and the fragmented-mp4 safety are unchanged. On its first frame it prints an ffmpeg-stylestart:banner, sostart_recordingreturns once frames flow and the input event log aligns as with gdigrab.Tests
parseCaptureStart, the nudge script.wgc. Once recording, it moves and turns blue, then sits still. The output is 400×300 (client area), lime at the start and blue at the end (never magenta), and stops gracefully. The full harness passes 19/19.Bumps to 0.32.0.
🤖 Generated with Claude Code