Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

camfix

New Member
Warmuptill, thank you for this invaluable tool you made!!
It works great and I'm really impressed by its ease of use.
I was banging my head on how to use a keyboard (and mouse) macro program for OBS when I found your excellent program!
With OBS's new features I am down to one last stop on automating our daily streams.

In case you have time and it's not implemented yet, could you please add an "End Boradcast" (similar to "End Stream") feature to the Macro section please?

I'm also trying to figure out how to automatically increment the date every day for creating the name of that day's stream, though that is not as important.
20211214_SouthCam (YYYY/mm/dd) needs to be named to 20211215_SouthCam for tomorrow's stream etc.
Thanks again for this jewel of swiss knifes!
 

AaronD

Active Member
could you please add an "End Boradcast" (similar to "End Stream") feature to the Macro section please?

I've got too many versions floating around to get a screenshot of it, but at least one of them has something on the General tab (I believe) to stop the stream/recording when a certain scene is active. I have nothing in that scene (blackout), and it's at the end of a sequence that I start when the live part is done. When it hits that last scene, it kicks us off air. This also gives me a transition to black just before cutting off, which I like.

I'm also trying to figure out how to automatically increment the date every day for creating the name of that day's stream, though that is not as important.
20211214_SouthCam (YYYY/mm/dd) needs to be named to 20211215_SouthCam for tomorrow's stream etc.

Is this what you're looking for?
It gives a filename of 2021-12-14_Tue_14-21-39.mkv for today, or 2021-12-15_Wed_14-21-39.mkv for tomorrow, etc., and of course you can make it say what you want.
1639512737314.png
 

camfix

New Member
The other thing that makes this all so great is the helping hand from people like you!
And I mean actual help.
Really nice community, very apprecated.
Thank you for your reply, will check the black screen out, tried the date thing, exactly what I was looking for.
Thanks guys and gals !!!
 

camfix

New Member
Unforunately the date issue doesn't work with the Macro. It seems the Macro takes it literally.
It might work on OBS directly, but the Macro feature is needed to automate the recording (and it's naming, accordingly).

Also, what is needed is to "End" the "Stream", the Macro can stop the stream/recording already, and that works reliably.
However YT keeps looping until "End Stream" is clicked on OBS or the stream is ended manually on YT.

Any other ideas?
 
Unfortunately not yet.

To be honest I am not familiar with how the stream deck functions.
Can you give an example of an OBS plugin that interacts with the stream deck?
That might help me getting started.

Thanks for the suggestion!

Apologies for never getting back to you. Forget aobut the Steam Deck, it's just an example. Ultimately I'm just trying to work out how to externally control whether the scene switcher is running or not, and also be able to get feedback as to whether it is.
Is there a way of maybe having a dummy source like an Empty Group, and then saying "If Empty Group = active, make scene switcher active, if source is disabled, disable the scene switcher" ?

Ultimately this would enable starting and stopping the scene switcher with websocket, midi... etc
 

AaronD

Active Member
Unforunately the date issue doesn't work with the Macro. It seems the Macro takes it literally.
It might work on OBS directly, but the Macro feature is needed to automate the recording (and it's naming, accordingly).

I've never had a problem with that. Use OBS's settings to start/stop recording along with the stream, and the filename is generated per the setting above.

Are you trying to control *YouTube's* metadata? I didn't think it would accept that. We set it manually on YT's dashboard before we start.

Also, what is needed is to "End" the "Stream", the Macro can stop the stream/recording already, and that works reliably.
However YT keeps looping until "End Stream" is clicked on OBS or the stream is ended manually on YT.

YT runs the throbber for a while, looking for data, and then gives up. Seems to work fine for us. I figured that was just "the way to do it": throw something at it to start, starve it to stop.

---

Seems to me like what you really want is to connect to YouTube's API and interact with *that*, not OBS. Is that right?
 

lindenkron

Member
Hey guys, quick question:

If I have something triggering for a specific scene - if I go to Studio Mode > Change Scene > Disable Studio Mode it will trigger the scene actions again; even though I technically didn't leave the scene (stream saw the first scene the entire time).

Any way to avoid this?

Thanks,
Happy Holidays
-Lind
 

Warmuptill

Active Member
First of all - sorry about the late reply.
I was cut off from the internet the last few days.

Hey Warmuptill! I have now tried the "Run Macro" action. I noticed that you can't actually run the same macro from within itself (infinite loop) as the macro would still be running. Which I think is reasonable, as it would otherwise result in recursion and potentially stack overflow. While for now I am fine with using the "Advanced scene switcher is running" for my infinite loop, maybe you should do something about this? Here are some ideas I have:
1. Remove the same macro from the choices.
2. Keep it, but when it executes the action, make it similar to a "continue" in a programming loop, so that further actions won't be executed, and it would run the macro from the top again. This needs a note that should show though, when the same macro is selected.
3. Keep it, but defer the execution till after all the actions are executed. (I personally don't like this option).
Thanks for the suggestion.
To be honest I had not tested this case.
My expectation would have been for the recursion using the "run macro" action to work as you expected.
I will look into this once I have find the time to.

I hope so :)

On a side note - I appear to have broken Adv-ss. Trying to move a macro below one of my other macros yield crash log attached.

Yes. I'm annoyingly good at breaking things, I know. Sorry.

Steps are repeatable, it's when trying to move it past a specific macro. I try to move anything past 'Camera 1 - Portal In' and OBS crashes with attached log.
View attachment 77973

Any tips?
-Lind
Thanks for the reporting the crash.
Can you share more details what these macros contain?
Also - as I have shared many different dev-builds with you - which version of the plugin are you using?

@Warmuptill Hey, I experienced something weird. As I've mentioned b4, I have a macro set to loop infinitely (just showing/hiding 2 text sources and wait actions, no scene transitions). It works with other macros now with the parallelization. However, when I put it at the top of the priority list (like the note said), it seems to block all Media switches. I don't know if it's an issue with the parallelization, or if it's a bug necessary to fix. If I keep Media higher than Macro, it works.
Hm, that seems very strange indeed.
Can you maybe share the settings you are using and a log file of the issue with verbose logging enabled (Option can be found on the General tab)?

Unforunately the date issue doesn't work with the Macro. It seems the Macro takes it literally.
It might work on OBS directly, but the Macro feature is needed to automate the recording (and it's naming, accordingly).

Also, what is needed is to "End" the "Stream", the Macro can stop the stream/recording already, and that works reliably.
However YT keeps looping until "End Stream" is clicked on OBS or the stream is ended manually on YT.

Any other ideas?
Oh interesting - I didn't know that Youtube had special handling regarding ending of a broadcast.
I will have to look into the OBS API if there is some Youtube specific function that needs to be executed.
Or are you looking to control Youtube's streaming API using this plugin, as suggested by @AaronD ?
If so then this is currently not supported by this plugin.

Apologies for never getting back to you. Forget aobut the Steam Deck, it's just an example. Ultimately I'm just trying to work out how to externally control whether the scene switcher is running or not, and also be able to get feedback as to whether it is.
Is there a way of maybe having a dummy source like an Empty Group, and then saying "If Empty Group = active, make scene switcher active, if source is disabled, disable the scene switcher" ?

Ultimately this would enable starting and stopping the scene switcher with websocket, midi... etc
I see. Thanks for the clarification!
Currently this is not supported, but I will look into it.

Hey guys, quick question:

If I have something triggering for a specific scene - if I go to Studio Mode > Change Scene > Disable Studio Mode it will trigger the scene actions again; even though I technically didn't leave the scene (stream saw the first scene the entire time).

Any way to avoid this?

Thanks,
Happy Holidays
-Lind
I could probably add a condition type to check whether or not studio mode is currently active.
I can't think of another solution for this at the moment unfortunately.
 

lindenkron

Member
Thanks for the reporting the crash.
Can you share more details what these macros contain?
Also - as I have shared many different dev-builds with you - which version of the plugin are you using?
I attached the whole export.
Move 'Going Live' upwards once crashes/hangs my entire OBS.

I could probably add a condition type to check whether or not studio mode is currently active.
I can't think of another solution for this at the moment unfortunately.
This would at the very least remedy the issues I run into. Issue is; if we're live and I need to go into Studio Mode to fix someone's camera or something; without switching the live scene - and I then unclick Studio Mode before going back to the scene we're live on, It'll trigger the scene we're live on's Adv-ss macros. Little scary :D
 

Attachments

  • Adv-ss.txt
    43.2 KB · Views: 19

AaronD

Active Member
Issue is; if we're live and I need to go into Studio Mode to fix someone's camera or something; without switching the live scene - and I then unclick Studio Mode before going back to the scene we're live on, It'll trigger the scene we're live on's Adv-ss macros. Little scary :D

Is there a reason to not stay in Studio Mode the whole time? That's where I live, and I like it better anyway. Seems to me like "not Studio Mode" simply takes things away without providing anything else, so I just stay in Studio Mode.
 

Warmuptill

Active Member
I attached the whole export.
Move 'Going Live' upwards once crashes/hangs my entire OBS.
Thanks!
I think I found the problem.
A build with a fix should be available here in a few minutes:
It would be great if you could quickly confirm whether or not the problem is resolved on your end as well.

I also added the option to check whether or not studio mode is currently active to this build.
StudioMode.PNG


@Warmuptill Hey, I experienced something weird. As I've mentioned b4, I have a macro set to loop infinitely (just showing/hiding 2 text sources and wait actions, no scene transitions). It works with other macros now with the parallelization. However, when I put it at the top of the priority list (like the note said), it seems to block all Media switches. I don't know if it's an issue with the parallelization, or if it's a bug necessary to fix. If I keep Media higher than Macro, it works.
Just to clarify - are you referring the media condition type in the Macro tab or the separate tab labeled "Media"?

In case of the latter this would actually be "expected behaviour" as the the way the priority system works is that checks are only performed until one functionality fulfils its conditions and a match is found.
So if the macro tab functionality is running in a continuous loop and thus a match is always found the other functionality like the media tab will not get a chance to run.

The easiest way to solve this would be to just transition your entries from the Media tab to the Macro tab so you can rely on the "run in parallel option".

But you are not the only user who stumbled upon this issue, so maybe I should adjust things.
The reason it was implemented in this way is that if a user configured automated scene switches via the macro tab and also the "old" tabs two scene switches could clash with one another and result rapidly flickering scene changes.
But maybe I can find a way to work around this.
 

CodeYan

Member
Thanks!
I think I found the problem.
A build with a fix should be available here in a few minutes:
It would be great if you could quickly confirm whether or not the problem is resolved on your end as well.

I also added the option to check whether or not studio mode is currently active to this build.
View attachment 78121


Just to clarify - are you referring the media condition type in the Macro tab or the separate tab labeled "Media"?

In case of the latter this would actually be "expected behaviour" as the the way the priority system works is that checks are only performed until one functionality fulfils its conditions and a match is found.
So if the macro tab functionality is running in a continuous loop and thus a match is always found the other functionality like the media tab will not get a chance to run.

The easiest way to solve this would be to just transition your entries from the Media tab to the Macro tab so you can rely on the "run in parallel option".

But you are not the only user who stumbled upon this issue, so maybe I should adjust things.
The reason it was implemented in this way is that if a user configured automated scene switches via the macro tab and also the "old" tabs two scene switches could clash with one another and result rapidly flickering scene changes.
But maybe I can find a way to work around this.
Yes, I was indeed talking about the Media tab. I expected the "run in parallel with other macros" to work with other tabs too, though I guess it is only confined to macros, just as the name says. I think I'll keep my Macro priority lower than the other tabs. I also noticed the Time tab didn't activate for me due to having Macro at the top. I am fine with keeping the priority low, but why do you suggest bring the Macro tab priority at the top? Also, do you still need the log file?

On an unrelated note, I have stumbled upon an issue that bugged me several times. Visually, it seemed to me like the scene-switching (tested with Macro tab and Media tab) seemed to "Cut" instead of "Fade", even if I switched the transition type several times. Manually transitioning works fine. Even pressing the "Run Macro" was fine. After a few hours of fiddling around, I think the issue was that the scene I was trying to switch to had a window capture, which seems to be delayed in capturing a window. It seems like if you actually try to move from a scene with a video, to a scene with a window capture, it just cuts (I tried it with two scenes both having videos, and the fade is actually smooth). I never noticed since when I manually switch scenes in studio mode, I get to switch my preview scene first, which results in the window capture already rendering before I transition, so the resulting transition actually fades properly. But please try this test case for yourself so I can confirm if I am still sane. It does seem unrelated to the plugin though and seems like an OBS limitation, as when I try to do it without studio mode, it still does cut instead of fade. Now my workaround for this will now be to actually move my Media tab switches to Macro tab, and add a "Switch preview scene" a few hundred milliseconds before performing the switch action.

While doing trying to fix my issue, I found that your "verbose logging" doesn't log the transition type or duration when logging "performed action" stuff. I think having the transition type in the log may be useful (though you're the one who looks at the logs so, I don't know if you need that detail). Also, I have no idea if this is an issue with the plugin, my hardware, OBS, or my other plugins, but when I enable verbose logging in adv-ss, and try to monitor my log file through OBS's "View Current Log", OBS freezes till I restart it.
 

AaronD

Active Member
On an unrelated note, I have stumbled upon an issue that bugged me several times. Visually, it seemed to me like the scene-switching (tested with Macro tab and Media tab) seemed to "Cut" instead of "Fade", even if I switched the transition type several times. Manually transitioning works fine. Even pressing the "Run Macro" was fine. After a few hours of fiddling around, I think the issue was that the scene I was trying to switch to had a window capture, which seems to be delayed in capturing a window. It seems like if you actually try to move from a scene with a video, to a scene with a window capture, it just cuts (I tried it with two scenes both having videos, and the fade is actually smooth). I never noticed since when I manually switch scenes in studio mode, I get to switch my preview scene first, which results in the window capture already rendering before I transition, so the resulting transition actually fades properly. But please try this test case for yourself so I can confirm if I am still sane. It does seem unrelated to the plugin though and seems like an OBS limitation, as when I try to do it without studio mode, it still does cut instead of fade. Now my workaround for this will now be to actually move my Media tab switches to Macro tab, and add a "Switch preview scene" a few hundred milliseconds before performing the switch action.

There's this setting in the Source Properties. How do you have it set?
1639844769992.png
 

Warmuptill

Active Member
I am fine with keeping the priority low, but why do you suggest bring the Macro tab priority at the top? Also, do you still need the log file?
Thanks for the clarification!

Usually the macro tab is used to create the most specific "rules".
The usual expectation would be for these rules to take precedence over more general ones and caused confusion for multiple users already. (E.g. when using the window tab entry would prevent all macros from being executed)
Having a macro that is always running is a special case in which using the highest priority for the macros functionality is problematic, but that is at least in my experience not a very common use case.

Thanks - I no longer need a log file.
scene-switching (tested with Macro tab and Media tab) seemed to "Cut" instead of "Fade", even if I switched the transition type several times.
That seems very strange indeed.
I usually encountered a similar unexpected cut transition behavior if I used some very long transition and switched to a different scene while the previous transition was still ongoing - but I am not sure if you are referring to this.
I will try to reproduce it on my end once I find the time to.

when I enable verbose logging in adv-ss, and try to monitor my log file through OBS's "View Current Log", OBS freezes till I restart it.
The "live" log viewer is not intended to be able to display this many logs - so unfortunately this is a known limitation from OBS.
 

CodeYan

Member
There's this setting in the Source Properties. How do you have it set?
View attachment 78153
That's only an option for Video Capture sources. I am using a Window Capture source, which seems to be unloaded by OBS when it is not viewed, and there is no option to not deactivate it.
Thanks for the clarification!

Usually the macro tab is used to create the most specific "rules".
The usual expectation would be for these rules to take precedence over more general ones and caused confusion for multiple users already. (E.g. when using the window tab entry would prevent all macros from being executed)
Having a macro that is always running is a special case in which using the highest priority for the macros functionality is problematic, but that is at least in my experience not a very common use case.

Thanks - I no longer need a log file.

That seems very strange indeed.
I usually encountered a similar unexpected cut transition behavior if I used some very long transition and switched to a different scene while the previous transition was still ongoing - but I am not sure if you are referring to this.
I will try to reproduce it on my end once I find the time to.


The "live" log viewer is not intended to be able to display this many logs - so unfortunately this is a known limitation from OBS.
Oh, okay, thanks for the clarifications!
 

CodeYan

Member
@Warmuptill, could you update the wiki about all possible options?

Okay, maybe that's too much ahhahaa. But I want to know more about these time constraints, as they are a bit vague to me. Like, "True, for at most 0.1 seconds", will that execute the actions if the condition check happened outside of that time frame (default checking interval for me is 300ms)? There's also the "For exactly". I am confused by these terms. While term-wise, I think they can't get any clearer, I at least want to see more details on them on the Wiki or Overview of the plugin.
 

Warmuptill

Active Member
@Warmuptill, could you update the wiki about all possible options?

Okay, maybe that's too much ahhahaa. But I want to know more about these time constraints, as they are a bit vague to me. Like, "True, for at most 0.1 seconds", will that execute the actions if the condition check happened outside of that time frame (default checking interval for me is 300ms)? There's also the "For exactly". I am confused by these terms. While term-wise, I think they can't get any clearer, I at least want to see more details on them on the Wiki or Overview of the plugin.
That is a topic I keep pushing to the side as it can be very daunting coming up with a description for all these options.
I thought about maybe adding a few examples to the wiki instead.

Regarding your question in particular concerning the time constraints.
A condition with a time constraint ...
  • "For at least X amount of time" will result in the condition to only return true if it was true for at least X amount of time.
    For example, assuming you just switched to scene "A", the following condition will return false for the first three seconds.
    Three seconds after the scene switch and as long as the current scene is "A" the condition will return true.
    AtLeast.PNG
  • "For exactly X amount of time" will result in the condition to only return true at the moment the underlying condition - ignoring the time constraint - was true for the specified amount of time.
    For example, assuming you just switched to scene "A", the following condition will return false for the first three seconds.
    Three seconds after switching to scene "A" the condition will return true.
    Afterwards it will once again return false.
    ForExactly.PNG

  • "For at most X amount of time" will result in the condition to only return true for at most X amount of time, after which it will return false.
    If the condition - ignoring the time constraint - will return false the time restriction will be reset.
    For example, assuming you just switched to scene "A", the following condition will return true for the first three seconds the scene is active.
    After three seconds have passed and the scene is still active the condition will then return false.
    If you should switch to a different scene and switch back to "A" the condition will once again return true for the first three seconds of "A" being the active scene.
    AtMost.PNG
Just for completeness:
A time constraint can be added to an existing condition by clicking the small clock icon next to the condition type selection.
AddTimeRestriction.PNG


Let me know if that was somewhat clear or if you have further questions! :)
 
Last edited:

KahikoHonu

New Member
I have what is no doubt a ridiculous question, but, I'm hoping someone here can help confirm something odd I'm seeing with the Advanced Scene Switcher.

Issue: Advanced Scene Switcher will not automatically switch between Scene Groups (version 1.16.5) seemingly when I'm using Apple Remote Desktop to control a remote machine running OBS.

When I run OBS and AdvSS on my Mac sitting in front of me (with keyboard/mouse/screen attached), it works as expected. Every 10 seconds, the Scene switches according to the defined list in the Scene Group tab.

However, on two separate Mac Mini systems, which are headless and operated purely by using ARD, the automatic switching does not happen. Other parts of AdvSS work just fine however - for example, I can set the "If nothing is happening, do Random" toggle, set some scenes and transitions in the Random tab, and it works.

Similarly, I was able to create a Macro so that whenever a certain scene was active, it would fade to another scene after a certain amount of time.

As far as I can tell, the only difference between the computer that works with the Scene Groups and those that do not is that the Do Not are all being operated remotely -- so I'm wondering if there's something inside of Advanced Scene Switcher that is a bit confused by this.

My goal is to automatically rotate through a series of scenes every X seconds, and Scene Groups were the fastest way to do this; doing it based upon the Random or Macro or other approaches would require a more complicated series of steps of listing each scene and the transition to the next scene...and, as I say, when I try this on my primary Mac, it works perfectly.

Thanks for any suggestions!
 

CodeYan

Member
That is a topic I keep pushing to the side as it can be very daunting coming up with a description for all these options.
I thought about maybe adding a few examples to the wiki instead.

Regarding your question in particular concerning the time constraints.
A condition with a time constraint ...
  • "For at least X amount of time" will result in the condition to only return true if it was true for at least X amount of time.
    For example, assuming you just switched to scene "A", the following condition will return false for the first three seconds.
    Three seconds after the scene switch and as long as the current scene is "A" the condition will return true.
    View attachment 78184
  • "For exactly X amount of time" will result in the condition to only return true at the moment the underlying condition - ignoring the time constraint - was true for the specified amount of time.
    For example, assuming you just switched to scene "A", the following condition will return false for the first three seconds.
    Three seconds after switching to scene "A" the condition will return true.
    Afterwards it will once again return false.
    View attachment 78185
  • "For at most X amount of time" will result in the condition to only return true for at most X amount of time, after which it will return false.
    If the condition - ignoring the time constraint - will return false the time restriction will be reset.
    For example, assuming you just switched to scene "A", the following condition will return true for the first three seconds the scene is active.
    After three seconds have passed and the scene is still active the condition will then return false.
    If you should switch to a different scene and switch back to "A" the condition will once again return true for the first three seconds of "A" being the active scene.
    View attachment 78191
Let me know if that was somewhat clear or if you have further questions! :)
That made it clearer, thanks, but how about when the specified time constraint is less than the condition-checking interval of adv-ss? My default is 300ms, but for simplicity, let's imagine the interval is 1 second. What if I set my macro condition to "For exactly 0.5 seconds"? Wouldn't adv-ss check AFTER the condition became true?
 
Top