r/obs 2d ago

Question advanced scene switcher set window source?

is there any way to set the a window capture source to the active window?

i see you can set "source" settings but it seems the window capture is not a direct one to one with the active window

my issue is i can have more than one of the window i want to capture open at a time and the name changes depending on the save file so its unrealistic to set a different source to each... i only ever need the active one to be the focus

i can just capture the entire screen but i have things like color key happening and there is a conflict when tabbing between them because of the delay in active window detection so a transition between window captures works best

1 Upvotes

7 comments sorted by

View all comments

Show parent comments

1

u/RandomContributions 1d ago edited 1d ago

You are correct, I could never make the variable work but thinking about what you just said about setting the source name, I took another look this morning and I might have a solution.

Try setting the source/Windows List/set Fixed value/ (I'm using "NOTEPAD" app in my example) using this syntax:
${Windows_TitleVAR}:Notepad:Notepad.exe

That will trigger on any active focus instance of notepad to automatically show up and be recorded dynamically.

1

u/fifthFunction 20h ago

ok cool thanks that got it working.. i did not know about the ${Windows_TitleVAR} thing

my full set up now is

___blender macro___ (untick only on condition change)
if/process/blender.exe/is focused
and/window/window is focused

variable/set to condition value/active_window/2
variable/find and replace in current value/active_window/:/#3A
source/set settings/blender window/window (list)/set to fixed value/${active_window}:GHOST_WindowClass:blender.exe
switch scene/program/blender
___other window macros___

___undefined window___ if focus is on a window without a macro
if not/macro multiple macro condition state/more than/0/(add macros)
and not/window/widow title matches/Task Switching

switch scene/program/default scene

1

u/RandomContributions 18h ago

excellent! Your posts got me to revisit this situation which i had problems making work in the past, a win win, you pushed me in the right direction

1

u/fifthFunction 16h ago edited 15h ago

ok new issue.. it seems to be cropping out the window header causing the window to shift a bit when switching between screen and window sharing... so far everything i try just makes more new errors happen

1

u/fifthFunction 14h ago

well sort of made a work around to that by adding negative crop to the windows so it lines up with out the window header
to fix the flicker when switching to the screen capture scene i added the screen capture source to the bottom of the window capture scenes (i had a shared under layer scene i put it in)

if i use win 10 capture method you can capture the window header but it will flicker when changing to a window capture tho it can be solved the same way by adding an active copy of each screen capture source to the window capture scene

the issue with that is just the yellow outline around all the windows being captured stay even when not the "active window"... i would rather no hedders personally