-
Notifications
You must be signed in to change notification settings - Fork 81
Change capture window of Window Capture source
This example will provide you with a macro which automatically changes the settings of a Window Capture source to capture the focus window.
This will only work on Windows.
The Window Capture source stores the information about which window to capture based on a combination of the title of the window to capture, the process name, and also the window class.
So for example, this [powershell.exe]: Window PowerShell
value in the settings dialog of the Window capture source ...
... is represented by the string Windows PowerShell:ConsoleWindowClass:powershell.exe
in the settings.
You can test this by clicking the "Get current settings" button in the "Source" source while a Window Capture source is currently capturing a window:
So you will have to create a macro, which has a Window and Process condition, to get the window title, window class, and process name.
Those values will have to be assigned to variables and combined to match the format expected by the Window Capture source.
Finally you can set the setting named Window
to the constructed string using the "Source" action.
As OBS uses the '
and #
characters internally to separate those values, you will have to perform some additional "find and replace" operations if your window title can contains those characters.
If you want to import the example you can use this code to do so:
AAAiYHic7VnbbuM2EP0VgulDu7VT2wm2G78lXgc1kGzcOJs+dBcFQ40lIjIpkJTXqeF/Ly8SJfmSTVo0bVMHCGAPORedOXMoS0s8I1QKhfu/LjEnM8B9fJprgWhCeAzoC+OR+IIoyXQOaCporgobbuFYijzD/SlJFbRwRnIFEzKHM0jInAmJ+53CWtsjSZpCGgyCD1wi3NcyN9/VPcuGC6BXfKKJ1GGf0iI7pZoJrkbTD0K/F7yKavMmQuoBkzRnejgnaU7s3vqOQW5izAaCR8wuDRKg9yOuQZrdYR99dNMS28hQ+9A57J2s/bWwfsjs0sqk5Uw7FOYglauna6yRoPcT0JrxWNlYEmKmTI5QRULUdc7Pcq2tiwfG2MYWyg2rwUnn6oLc1VBNWJyk5l+PpuFa1I3MK8hkGf8GFqZEbPLholkNu8uJ7ZVsrn30NrNKG0l8RcWmKj8iEpAt+7DhcW4LeszFVWx9LG6jyBL0/e1k0n4yTRvgO7p7JoU8kyxl2jRgLBTztDHDkNmh6B7/uGqVnzvdt6vPRYShqclH2e188u44OHesZ9non4S+hwfVnBxvNN6fA9p1kxZxnMJ43Vzh6PIqiGfAdZ1dVKQpyRREJWfCLDQ5Q+s2fP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W58LPd1x52nw7BDls+ivOYYXaD/nkEOBUYAedw977w67ePUH9TmrPg==
- Show webcam only when speaking
- Twitch Category Changer
- Show text source with latest Twitch follower
- Detect elements on screen and hide them automatically
- Motion detection
- Start other programs when starting OBS
- Crossfading audio during scene changes
- Switch scenes randomly
- Re-shuffle VLC source
- Automatically switch scene if a game capture's target window no longer exists
- Audio based scene switching in podcast setting
- Switching scenes based on portrait or landscape mode resolution of a window capture source
- Set up a hotkey to start and stop recording with a fade from and to black
- Automatically cycle through a list of scenes
- Toggle visibility of scene items on a timer
- Advance through a list of scenes by hotkey
- Performing actions only when transitioning from A to B
- Media playlist with commercial interruptions
- Split recording of stream into chunks
- Switching scenes for Aitum Vertical plugin
- Using MIDI devices
- Change capture window of Window Capture source
- Show URLs in clipboard in browser source
- General tab overview
- Starting and stopping the plugin
- Macros explained
- Creating a macro
- Pausing macros
- Macro duration modifiers
- Exporting and importing individual macros
- Audio condition
- Cursor condition
- Date condition
- Hotkey condition
- Media condition
- Process condition
- Scene item transform condition
- Slide Show condition
- Video condition
- Audio action
- Http action
- Hotkey action
- Random action
- Scene item visibility
- Sequence action
- Action Queue example
- Variables
- Websockets
- Scripting
- Troubleshooting
- Saving and loading settings