Resource icon

Advanced Scene Switcher 1.25.5

Warmuptill

Active Member
There are no actions being performed that should trigger the cooldown, unless having a paused macro ('Mar 4th 2', as above) counts for some reasons as an action.
Can you share the rest of the log and the settings you are using?
In general I would suggest to avoid using this setting in combination with macros.
It is mostly left in there for backwards comparability reasons.

So the following appear to work so wondering if this will be reliable or only work part of the time.
So I want to have a macro execute when a source (in a certain area) matches a pattern for more than say 15 seconds and then changes

so I have the following
if - video - source(xxx) - matches pattern (xxx.png) - for at last (15.00 seconds) [perform check only in area]
and - video - source(xxx) - has changed [perform check only in area]
do - xxxx xxxx xxxx etc.

it appears to work but is it really how it should work or just luck and might not work all of the time?

or is there a way to do what I want?
That should work.
The "and video has changed" part is not needed, but I assume you added it for a reason.

If you did add it for a reason you might have to consider adding a "with the last" duration modifier, unless you want to only perform while the video output is currently changing.

VideoWithin.PNG


Just installed this plugin on Mac for the first time. Used to using Windows or Linux. OBS is 29.0.2. Latest version of the plugin. All I get is the windown below. No macro tab, nothing. Is this a bug or I am stupid?

As already mentioned the screenshot is of the built-in automatic scene switcher.

If the "advanced scene switcher" entry in the tools menu is missing, it could be that you have installed the wrong version of the plugin (x86 vs arm).
If so, can you share an OBS log?
That might give an indication what is going wrong.

Feature request: Subroutines

Long story short, I (finally!) got my church rig updated to where it'll run the current version of Adv. SS - it was hardware-stuck until now, on Lubuntu 20.04 and corresponding versions of OBS and Adv. SS - and so I'm working on the automation again.

This rig has a finished live feed from the FOH console, controlled remotely by the Broadcast Engineer, but it inherits the FOH mutes and live tweaks, plus a pre-recorded Welcome video that OBS plays itself. For the Welcome video, and at the end of the service, I want to fade down the live feed automatically, so that the FOH Engineer doesn't have to consider the Broadcast as much. I couldn't do that with OBS 25 and that version of Adv. SS, but now I can!

The catch though, is that I actually have 3 sources in OBS, as copies of the same input: Stereo to Broadcast, Mono to Headphones, and Stereo to Headphones. That's so a pair of hotkeys can switch the Headphones between mono and stereo without affecting the Broadcast, because most viewers have their speakers too close together to produce meaningful stereo, but some have headphones. To keep a decent rendition of what they hear, I need to fade all three together, always.

I can do that, by always using 3 actions like this:
View attachment 92164
but it would be a lot more convenient and maintainable to condense those three that are always together, into a single action. (What's actually shown here, is the same concept for a Noise Gate, to handle the analog cable noise when it's supposed to be silent, but sometimes I want to keep that noise because cutting in and out is even more distracting than having it constant.)

I've tried the trick where a macro has its condition to always run as fast as it can forever, but pauses itself at the end, and then another macro unpauses it. That technically works - turns it into a one-shot on demand - but the "subroutine" actually runs *after* the main macro finishes, when I really want the main one to wait in-place for the sub to finish. If they run in parallel, that's fine too; I'll just put a Wait action in the calling macro.
I've also tried setting a variable instead, so that the "subroutine" macro waits for that variable, does its thing, and then clears it. Same thing: the main macro finishes, and *then* the subroutine runs.

I tried setting the subroutines to "run in parallel", but that didn't change anything. I didn't think to try *everything* running in parallel. Would that make it run immediately? What other problems would it cause? I get the impression that that feature is supposed to be used sparingly.

If it does work, without causing other problems, it would be an okay workaround, but I'd really like to see a proper call / return structure. Arguments and return values would be awesome as well, but the present system of a bunch of global variables technically covers their basic use already. (now watch someone try to compute Ackermann's function on it!)

Continuing the concept of "function arguments", it would also be nice to have the volume level and fade time accept variables, so I could have just one "subroutine" for each concept - Volume, Gate, etc. - that takes the specifics as arguments - Level and Time, {En|Dis}able, etc. And since everyone else who wants to use arguments like that, will have a different action to do it on, you'd probably have to have *everything* take variables in addition to their constants. I hope that's not too much of a paradigm shift.



(This is really becoming a programming language, isn't it? You sure you don't want to just pawn it off to a Python interpreter? Make an API for everything that a plugin might possibly connect to, and the rest is standard Python, at an "add your code here" sort of level that "just works" when you don't mess with the rest of it. Maybe have a menu system, similar to what the macros have now, that insert the corresponding API calls.)

I think what you are looking for is the "Macro" action's "Run actions" option.
This will perfrom the actions of a given macro. (Regardless of the condition state)
Note though that the actions will not be performed if the macro is paused.

Run.PNG
 

AaronD

Active Member
I think what you are looking for is the "Macro" action's "Run actions" option.
This will perfrom the actions of a given macro. (Regardless of the condition state)
Note though that the actions will not be performed if the macro is paused.

View attachment 92184
Ah! Okay, why didn't I see that?

So I need to set the "subroutine" macros to never run (empty condition?), and then that action will run them inline like a traditional subroutine call/return? What happens if the subroutines end up being paused? NOP and continue? Does the caller hang there?

Thanks!
 

kdarroch

Member
So is there a way to have a default condition for the Advanced Scene Switcher when OBS starts?

I want certain macros paused and others active. will be different from when OBS was closed.

Like I said a so called default state for each macro when OBS starts

Kirk
 

AaronD

Active Member
So is there a way to have a default condition for the Advanced Scene Switcher when OBS starts?

I want certain macros paused and others active. will be different from when OBS was closed.

Like I said a so called default state for each macro when OBS starts

Kirk
In several rigs now, I have an "Init" macro with the condition of "plugin running", which is always true, and the "only on change" box checked. That makes it run once on startup and never again. Put your (un)pause and whatever other settings you want in there.

For a more complex rig with two copies of OBS, I have a Wait action to allow the other copy to start as well, and establish the connection between them, before init'ing things that also trigger that connection. (both copies are started from the same script, so the timing is predictable enough to make that work)
 

Warmuptill

Active Member
So is there a way to have a default condition for the Advanced Scene Switcher when OBS starts?

I want certain macros paused and others active. will be different from when OBS was closed.

Like I said a so called default state for each macro when OBS starts

Kirk
Maybe this condition type is what you are looking for:

PluginState.png


I am probably stating the obvious, but please note that all of those checks require the plugin to be active.
There is no "do something while the plugin is not yet active" option.

If you want to ensure a macro containing this type of check is the first macro executed on OBS startup / plugin startup move the macro to the very top of the macro list.
 

lextehrex

New Member
Can you share the rest of the log and the settings you are using?
In general I would suggest to avoid using this setting in combination with macros.
It is mostly left in there for backwards comparability reasons.
I'll just disable that setting then. Find the full log for that session attached as well as the adv-ss settings. Other than the macro, no other settings are changed, so should be defaults.
 

Attachments

  • 2023-03-05 15-43-58.txt
    680.4 KB · Views: 12
  • adv-ss-Main-2023.03.07.23.18.05.txt
    18.9 KB · Views: 14

AaronD

Active Member
If you want to ensure a macro containing this type of check is the first macro executed on OBS startup / plugin startup move the macro to the very top of the macro list.
Yeah, that too. :-) I arrange my macros in (rough) order of execution anyway - Init first, then normal operation, then shutdown / cleanup - so I've satisfied that point anyway. Good to mention though.

I'll probably end up with a group called "Subroutines" that never run on their own, above everything (kinda like a C program), but they probably don't count because they *don't* run on their own. So the first one that has a chance to run is still Init, and it does. Once.
 
Out of curiosity, are the other tabs (the ones hidden by when the "Hide tabs which can be represented via macros" checkbox is checked) going to be removed at some point? I've begun the process of moving all my stuff from other tabs to the Macro tab ahead of such an eventuality. It's not yet complete because I'm lazy on the network side and not into the notion of writing JSON for scene changes. That said, I know I should because I already see the benefits of doing so.

Thanks for any insights into the matter!

--Katt. =^.^=
 
I didn't think that was necessary. Is there more functionality available by directly modifying the settings file, than can be done with the GUI?

In the one case I'm describing that needs network support, I need to be able to tell another computer to change scenes when a scene is being set on the one doing most of the automation. The only way I can see in the Macros section is via WebSockets, which does use the JSON interface.

Thankfully, I've managed to figure much of it out by way of writing commands for SAMMI (though it's mainly for changing scenes in studio mode for one panel I use for working sources off-program while streaming). I need to use raw WebSocket calls there because there isn't any "studio-mode" support in SAMMI to speak of, so I have to improvise by sending JSON messages to set studio mode and to select scenes in studio mode (there is a separate command to select scenes in studio mode). But I digress.

Though I will confess, like I said previously, I'm lazy. Furthermore, JSON makes my head hurt a little, but I'll live. All I was wanting to know is when or if I can anticipate some of the support I've used in the past to possibly (if ever) go away.

--Katt. =^.^=
 

AaronD

Active Member
In the one case I'm describing that needs network support, I need to be able to tell another computer to change scenes when a scene is being set on the one doing most of the automation. The only way I can see in the Macros section is via WebSockets, which does use the JSON interface.

Thankfully, I've managed to figure much of it out by way of writing commands for SAMMI (though it's mainly for changing scenes in studio mode for one panel I use for working sources off-program while streaming). I need to use raw WebSocket calls there because there isn't any "studio-mode" support in SAMMI to speak of, so I have to improvise by sending JSON messages to set studio mode and to select scenes in studio mode (there is a separate command to select scenes in studio mode). But I digress.

Though I will confess, like I said previously, I'm lazy. Furthermore, JSON makes my head hurt a little, but I'll live. All I was wanting to know is when or if I can anticipate some of the support I've used in the past to possibly (if ever) go away.

--Katt. =^.^=
Okay. I see the need now. You must be doing far more than I am with my two synchronized copies of OBS. I've been able to boil everything down into 3 categories, with a regex on the scene name to select which category to use this time. So there are only 3 possible things that I could send through the WebSocket.

All of my logic is in OBS; the streaming platform, online meeting, recording, or whatever just take what they get. I googled SAMMI and found what I think is the website, but I don't see anything beyond superficial hype and a call to action. What does it do that OBS and Adv. SS don't?
 
Okay. I see the need now. You must be doing far more than I am with my two synchronized copies of OBS. I've been able to boil everything down into 3 categories, with a regex on the scene name to select which category to use this time. So there are only 3 possible things that I could send through the WebSocket.

All of my logic is in OBS; the streaming platform, online meeting, recording, or whatever just take what they get. I googled SAMMI and found what I think is the website, but I don't see anything beyond superficial hype and a call to action. What does it do that OBS and Adv. SS don't?

First of all, when I tell people about this plugin, I outright say that calling this by its name, "Advanced Scene Switcher", doesn't even do this plugin justice. It's downright INSANE what this plugin can do. I love this plugin so much. However, I haven't tried the regex support mainly because it uses Rust regexes and I'm far more familiar with Unix and Perl flavors of regexes.

As for SAMMI, which was formerly LioranBoard, I mainly use it since I can't afford or justify purchasing an Elgato Stream Deck at present. Some use the automation features it offers; I presently don't. I just use it along with a couple of Android tablets to organize my scenes into a layout I can use to select scenes as well as doing pre- and mid-stream setup. All that said, you may not have a usage case for SAMMI in your case, but that's okay. I'm just saying is that SAMMI forced me to learn some of the JSON messaging to communicate with WebSocket so I could use to not fumble with Studio Mode.

--Katt. =^.^=
 

rusty1

Member
I want to set my variable equal to the height of a media source. I planned to do this by setting the condition value from the 'Scene item transform'. It's listed in the overview as a supported condition type. But I get the error message "Getting variable values from Scene item transform condition is not supported!" I'm running on Intel Mac OBS 29.0.2.
 

Attachments

  • Screen Shot 2023-03-09 at 8.56.13 PM.png
    Screen Shot 2023-03-09 at 8.56.13 PM.png
    141.4 KB · Views: 40
  • Screen Shot 2023-03-09 at 8.48.40 PM.png
    Screen Shot 2023-03-09 at 8.48.40 PM.png
    192.2 KB · Views: 39

mg4k

New Member
Hello, Just wanted to check if I'm doing this right. I wanted a hotkey to trigger a scene change. Using the If > Hotkey command and then setting the hotkey in OBS does bring up the conflict warning (since I have a hotkey set for the action and then this hotkey) but works as intended. Is this fine or is there a better way of doing this?
 

AaronD

Active Member
Hello, Just wanted to check if I'm doing this right. I wanted a hotkey to trigger a scene change. Using the If > Hotkey command and then setting the hotkey in OBS does bring up the conflict warning (since I have a hotkey set for the action and then this hotkey) but works as intended. Is this fine or is there a better way of doing this?
A lot of serious programmers like to eliminate all warnings as well as errors. Warnings are there for a reason too, even though it technically works that way, so we either adjust the code to get rid of them, or temporarily turn specific ones off for a specific section of code where we know what we're doing and why. In your case, an easy way to get rid of the warning is to move the original direct action into the macro.

An advantage of doing it that way is that Adv. SS can appear to respond to the scene switch *before* it happens, because you've put the response actions first in the same macro.
 

Warmuptill

Active Member
Out of curiosity, are the other tabs (the ones hidden by when the "Hide tabs which can be represented via macros" checkbox is checked) going to be removed at some point?
Yes, at some point in the future I would like to remove the old tabs.
But that point in time is not decided nor near yet. :)
And I will of course make it clear once that will be the case.

In the one case I'm describing that needs network support, I need to be able to tell another computer to change scenes when a scene is being set on the one doing most of the automation. The only way I can see in the Macros section is via WebSockets, which does use the JSON interface.
I don't think you need to use json to do this unless you want to interact with the advanced scene switcher from external tools.

Something like this should do the trick:
  • OBS instance receiving the scene switch messages:
    Receive.PNG
  • OBS instance sending out the scene switch messages:
    Send.PNG
Let me know if you have any questions or run into any problems! :)

I want to set my variable equal to the height of a media source. I planned to do this by setting the condition value from the 'Scene item transform'. It's listed in the overview as a supported condition type. But I get the error message "Getting variable values from Scene item transform condition is not supported!" I'm running on Intel Mac OBS 29.0.2.
I apologize - that must have been a misunderstanding / mistake of mine.
The scene item transform condition does not support assigning its value to variables.
(The screenshot shows the available condition types in general not the ones support this specific variable functionality)

Nevertheless it is not much work enabling this so I went ahead and did it.

Transform.PNG


A build with this functionality will be available here in a few minutes:
(You will have to be logged into GitHub to be able to download it)

Let me know if you run into any issues!

Hello, Just wanted to check if I'm doing this right. I wanted a hotkey to trigger a scene change. Using the If > Hotkey command and then setting the hotkey in OBS does bring up the conflict warning (since I have a hotkey set for the action and then this hotkey) but works as intended. Is this fine or is there a better way of doing this?
As mentioned by @AaronD you can probably combine both hotkey assignments into a single macro to avoid the conflict.
But if your current setup works, that is of course not necessary. :)
 

rusty1

Member
Yes, at some point in the future I would like to remove the old tabs.
But that point in time is not decided nor near yet. :)
And I will of course make it clear once that will be the case.


I don't think you need to use json to do this unless you want to interact with the advanced scene switcher from external tools.

Something like this should do the trick:
Let me know if you have any questions or run into any problems! :)


I apologize - that must have been a misunderstanding / mistake of mine.
The scene item transform condition does not support assigning its value to variables.
(The screenshot shows the available condition types in general not the ones support this specific variable functionality)

Nevertheless it is not much work enabling this so I went ahead and did it.

View attachment 92325

A build with this functionality will be available here in a few minutes:
(You will have to be logged into GitHub to be able to download it)

Let me know if you run into any issues!


As mentioned by @AaronD you can probably combine both hotkey assignments into a single macro to avoid the conflict.
But if your current setup works, that is of course not necessary. :)
Thank you so much! It works! You're a legend.
 

rusty1

Member
Is there a way to write math, either in the 'set to fixed value' of a variable, or in the 'Set settings' text fields. I would love to calculate an aspect ratio by dividing one variable by another ${videoWidth} / ${videoHeight} .
There's no way to do that currently, is there?
 
Last edited:
Top