Game Capture: pin recording to the focused game window - #157
Game Capture: pin recording to the focused game window#157bryan-ovalle2 wants to merge 2 commits into
Conversation
|
This is the right approach and I want it. Going with this over #136, which I've closed. Pinning to a window id after a games.json match, rather than using GSR's Two corrections on your read of #136, since I checked before closing it: it doesn't touch games.json and doesn't delete any tests. It's branched off v2.5.0, so diffing its tip against main makes it look that way. The Four things before I merge:
Rebase on main when you get to it, 2.7.0 just went out and touches Adding Rematch and Gears of War: E-Day is fine, keep those in. |
|
Thanks! Sorry about that claim, shoulda realized. I'll let you know when I add your requests. I've honestly been looking for something like this for a while so I'm glad you released this! |
|
Had another look at this now that 2.7.1 is out, and I merged it locally against current main to check: no conflicts, and the full suite still passes with it applied. The codec work I just landed touches the same function as your capture changes but a different part of it, so you shouldn't have to rebase. The approach still looks right to me. Pinning to a window id instead of using GSR's Three things before I can take it:
One small style thing: no em-dashes in comments or log strings please, a comma or a full stop instead. My own fault for never writing that down anywhere. No rush on any of this. Ping me when you've pushed and I'll take another look. |
d410943 to
374c96b
Compare
|
@eklonofficial check these changes out:
I also rebased just to be safe. |
|
Heads up, there's CI on the repo now and I approved the run on this branch. It came back red, but none of it is yours: four CLI tests assumed the machine has a display, which is true on my desktop and not on a runner. That's fixed on main, so rebase or merge main in and it should go green. Still the same three things from before on my side: tests for the new window-matching, a slower poll interval, and a guard so this does nothing on the segment backends. No rush. |
374c96b to
c8ec2a7
Compare
|
@eklonofficial Sorry it took a while, been a busy couple of weeks. Here are the highlights from this recent commit:
I did notice that .home has a max-width of 1180px with no centering. Crazy people like me have 43" monitors so it's really apparent. It's not too bad though, and yea I understand that not many people have displays this big but maybe it's something to consider updating in the future. |
this is a WIP, wanted to get it up early for visibility/feedback rather than sit on it.
adds a "Game Capture" toggle that crops gpu-screen-recorder to just the game window instead of the whole display.
heads up — there's already an open PR (#136) for window capture. i looked into it before starting this one: it's a few commits behind main right now (not mergeable), and it has a real bug where picking "Focused window" with the default resolution will crash gpu-screen-recorder (
-sis required for-w focusedand it's never passed unless you also set a manual resolution —_detect_window_resolution()is defined but never called). it also bundles in some unrelated stuff — drops a big chunk of games.json, deletes a bunch of test coverage, removes the follow-my-mouse feature. figured i'd rather note it here than silently duplicate it.what this does differently:
-w focusedat all, since that tracks raw input focus — alt-tab to discord or a browser mid-game and it'd start recording that instead of the game. instead there's a background loop that checks the focused window against games.json (same list already used for discord rich presence / clip tagging) and only pins capture once it recognizes an actual game.also threw in Rematch and Gears of War: E-Day Multiplayer Beta to games.json since i had both open while testing this.
testing so far: verified manually against Gears of War: E-Day Multiplayer Beta and Rematch (real Steam/Proton games) — detects and pins within ~1s of the game gaining focus, stays pinned through alt-tabbing to Chrome, and cleanly releases the pin when the game window closes (no more crash-restart cycle in the logs). marking as draft since i haven't tested the wf-recorder/ffmpeg backends or non-X11 sessions yet.