That is currently not possible, but I will look into adding this functionality.Does anyone know if there is a way to have a macro action reset a sequence inside of another macro to start back at the first macro in its list?
A build with the requested functionality will be available here in a few minutes:Does anyone know if there is a way to have a macro action reset a sequence inside of another macro to start back at the first macro in its list?
Nice! Arbitrary index, not just "reset to start". That'll be useful for other things too.A build with the requested functionality will be available here in a few minutes:
(You will have to be logged into GitHub to be able to download it)Sequence · WarmUpTill/SceneSwitcher@853bb96
An automation tool for OBS Studio. Contribute to WarmUpTill/SceneSwitcher development by creating an account on GitHub.github.com
While i don't expect any problems, I would recommend to backup your settings just in case before installing this build.
If you do run into any issues let me know! :)
View attachment 100688
That was actually just me messing around with it to see if any of the conditions were causing it but I forgot to change it back before sending bc I was frustrated after trying to fix it for a while lol, it was originally set up to start recording when the game starts like the one that was above it for rocket league.I can't reproduce the behaviour on my end when using your settings.
But one thing seemed a bit strange to me and might be related to the cursor issue.
What do you intend to achieve with this condition?
View attachment 100617
It will result in "valheim.exe" being started every 250 milliseconds which is probably not what you are trying to do.
This probably causes a lot of system load and could result in this cursor behavior.
From your screenshots, it appears that you've forgotten to remove some things that didn't work, and their presence is still causing you problems. Just because *you* aren't thinking of something at the moment, doesn't mean it doesn't still have an effect. Know what you have, and keep it clean.1. In normal times, scene “1” is shown and then
Is it possible to implement a macro where the scene "2" video appears briefly and then disappears only at "9 a.m." and "7 p.m." every day?
I'm not really sure what you mean by that, but all of what the plugin does is local to that machine and that instance of OBS. Nothing here requires internet directly.2. And will it work offline?
Glad to hear that you figured out a workaround! :)Is there a computational limitation when it comes to checking if media is playing?
I run a RIPPER of a PC.... 4090 gfx 14900 cpu
normally everything runs smooth as butter but i tried something interesting today...
i wanted to see if i could simplify how i handle hiding videos after playback
so instead of playing a video (waiting in streamdeck) then hiding a video
i used Adv SS and ran two macros
one for if media "any media source on (scene with 20 medias) state is playing do this
and one for if media "any media source on (scene with 20 medias) state is playing do this
they both work flawlessly...but im noticing OBS starts to hang a little every now and then now, and one of my macros that enables a media on scene change....now comes in 5 seconds later
i tried a few things like choosing run macro in parallel to other macros but same outcome.
I even raised the priority thread level to highest and still
I figured maybe checking the state of 20 videos is too much even though i dont see a rise in cpu usage or gpu usage
So i tried to prepend the conditions with a condition that first checks for scene item visibility matching a pattern...and left it on all
my thought process was ...maybe checking scene visibility will happen first...then if true...it will move to the "and" media playing
but got the same outcome again...perplexing
is this not a good idea?
(EDIT: I got creative and did a OCR condition for screen brightness on the scene containing all the videos.... which seems to work way better....if a video is playing the screen is bright....if not...its dark....one check to rule them all lol)
Unfortunately I don't think this will be possible.I'm trying to run a macro that's proving difficult. I do not know if it is because I don't understand or maybe the plugin might use another feature.
My problem is thus: I have a scroll text and on a colour source and grouped them together. I want the macro to run such that when I activate the group, the colour source slides up and the scrolling text starts 1 second after. And when I deactivate the group, the scrolling text disappears 1 second before the colour source deactivates.
Any workaround with this will be highly appreciated
The option to pause individual macros via hotkey is already available it is just not enabled by default.Looking forward to find PAUSE Button or function for Advanced Scene Switcher
1) this is important when programming time START/STOP function
2) no chance of automation if you already use STOP button (need manualy use START button)
3) PAUSE is for prevent actions but not functionality of all MACROS include macro which might control start/stop of Advanced Scene Switcher
finaly hotkey for PAUSE like TOGGLE would be great.
... any idea supporters? thanks
I would suggest to use a macro like this to handle the "menu" case:Hi I'm looking for help setting up scene switching based on what is on the screen. Basically I have three scenes based on if I'm player 1, player 2, or for everything else.
I'm using the video macro with exact pattern matching to switch to either the player 1 or player 2 scenes and those work fine. I have it looking for my in game player name so if it is on player 1 side it switches to player 1 scene and vice versa.
I can't for the life of me figure out which combination of settings to have it switch back to my "menus" scene after the matches end.
Attached are screenshots of my settings with the in game visuals for comparison.
Thanks and I appreciate any help.
This is for the player 1 switch which works
View attachment 100812
This is for the player 2 switch which works
View attachment 100813
This was my attempt to return to menu macro which does not work. My logic was that the source does not show my player name on both player 1 and player 2 sides it would switch to the menus scene.
View attachment 100814
Here is an in match screenshot for player 1 side
View attachment 100816
Hi Warmuptill,First of all - sorry about the delayed responses!
Glad to hear that you figured out a workaround! :)
Checking the media states of 20 source is a rather computationally "cheap" operation compared to performing OCR using the Video condition.
So I assume something else must have caused the observed delay.
If you still want to investigate the issue, can you please share an OBS log showing the delay with vebose logging enabled?
Unfortunately I don't think this will be possible.
The reason for this is that if you hide the group toggling the visibility of the group elements won't have any effect.
They will remain hidden regardless.
You could however instead try to set up a hotkey to achieve the same effect, if tying the functionality to the group visibility is not a strict requirement.
For example something like this could be used to set up a macro to first show the color source, wait one second, and then show the text source. (The same could be done to hide them)
View attachment 100850
The option to pause individual macros via hotkey is already available it is just not enabled by default.
You can enable it like this:
View attachment 100851
Is this what you had in mind?
I would suggest to use a macro like this to handle the "menu" case:
View attachment 100852
The condition type "Macro" is used here to check if the condition of "p2switch" are *not* true and the conditions of "p1switch" are also *not* true.
Hope that helps! :)
import obspython as obs
# pip install psutil pywin32
import win32gui
import win32process
import psutil
source_name = "Game Capture"
prev_window = ""
def create_title(pid_name, window_title):
# will format string as: '[application.exe]: window title string'
return f'[{pid_name}]: {str(window_title)}'
def get_active_window():
fg_window = win32gui.GetForegroundWindow()
fg_window_name = win32gui.GetWindowText(fg_window)
fg_pid = win32process.GetWindowThreadProcessId(fg_window)
fg_pid_name = psutil.Process(fg_pid[-1]).name()
title = create_title(fg_pid_name, fg_window_name)
return title
def change_source_settings(window_title):
source = obs.obs_get_source_by_name(source_name)
settings = obs.obs_data_create()
obs.obs_data_set_string(settings, "window", window_title)
obs.obs_source_update(source, settings)
# cleanup
obs.obs_data_release(settings)
obs.obs_source_release(source)
def window_changed(window, prev_window):
if window != prev_window:
prev_window = window
return True
return False
def main():
# get active Windows window
active_window = get_active_window()
# if the window changed, update source settings
if window_changed(active_window, prev_window):
change_source_settings(active_window)
def script_description():
return "Python script to update Window Capture based on active window"
obs.timer_add(main, 1000)
What is causing issues for you is that you are trying to set the "Window" setting to the string that is being displayed to you in the Window Capture source's properties menu, instead of the actually required "backend" value.Hello,
I'm trying to get OBS to behave like Xbox Game Capture or Nvidia Instant Replay, where it only records the last n seconds of whatever the current active window or game is. My idea is that I want to "set it and forget it" without having to touch OBS to update the source if I switch games or windows.
Using Adv Scene Switcher, I have a macro that, theoretically, should update my "Game Capture" source's window to the currently active window. I would like to think that I have everything setup correctly in the macro, but there's a good chance I'm misunderstanding or missing something.
I originally tried using vanilla OBS to do this using a Python script which also failed. Everything worked until it came to actually changing the source's settings and nothing seemed to change.
If you think like a programmer and want to see my script, I'll add it here:
Python:import obspython as obs # pip install psutil pywin32 import win32gui import win32process import psutil source_name = "Game Capture" prev_window = "" def create_title(pid_name, window_title): # will format string as: '[application.exe]: window title string' return f'[{pid_name}]: {str(window_title)}' def get_active_window(): fg_window = win32gui.GetForegroundWindow() fg_window_name = win32gui.GetWindowText(fg_window) fg_pid = win32process.GetWindowThreadProcessId(fg_window) fg_pid_name = psutil.Process(fg_pid[-1]).name() title = create_title(fg_pid_name, fg_window_name) return title def change_source_settings(window_title): source = obs.obs_get_source_by_name(source_name) settings = obs.obs_data_create() obs.obs_data_set_string(settings, "window", window_title) obs.obs_source_update(source, settings) # cleanup obs.obs_data_release(settings) obs.obs_source_release(source) def window_changed(window, prev_window): if window != prev_window: prev_window = window return True return False def main(): # get active Windows window active_window = get_active_window() # if the window changed, update source settings if window_changed(active_window, prev_window): change_source_settings(active_window) def script_description(): return "Python script to update Window Capture based on active window" obs.timer_add(main, 1000)
Otherwise, here is my macro:
View attachment 100864
I only have 1 scene with 1 source. Using the Macro visual settings, the macro fires off as intended every time I change the active window on my computer. It just doesn't seem to actually update the source.
Any ideas?
edit:
sorry if I'm using incorrect wording anywhere in here, I'm new to OBS and plugins. Feel free to correct me wherever
AAATMnic7Vhbb9s2FP4rBLGHrbM9y2vSzm+Z4WAGmsWI0/RhCAZaoiUiFCmQVOrO0H/f4UW0lMRZthZ5GPxgQDp3nu87pKkdLkmqpMbTP3ZYkJLiKT6rjURpQURO0WcmMvkZpaQyNUUbmdY6yPAAV6TW4LAhXFP7pgjnlEeBFDMXBE+NquFd37FqvqXpp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ugOgaL6X9AJ/iP7CSiJrw4PZorB5MaoNf3Nz40cRXzyzelgNwt/I+HdmlcrRwt3car/z27nJrRS3Ret+FHtxJNLkPbiH4htTcxAPP4iiePENf7nhw8/rXIdq/of/keNu51OFkNHk7mgxPkmF+erL+ZXNC3uPmb0mfhzM=
That should be doable by using a macro similar to this:The new twitch integration is amazing! Is there a way to get twitch speciffic identifiers like username of latest follower/subscriber/raider etc. (like special identifiers in the MixItUp Bot https://wiki.mixitupapp.com/en/special-identifiers) and store them as variables/save them to a txt file?
just curious, not asking for a feature, but is there a way to go to a previous source instead scene?