Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

UnreakWaifu

New Member
You will have to use a macro similar to this one to get the current system time.

View attachment 97421

If you want to import the example macro you can use this code:
Code:
{"macros":[{"name":"Get Date","pause":false,"parallel":false,"onChange":false,"skipExecOnStart":false,"group":false,"dockSettings":{"register":false,"hasRunButton":true,"hasPauseButton":true,"hasStatusLabel":false,"highlightIfConditionsTrue":false,"runButtonText":"Run","pauseButtonText":"Pause","unpauseButtonText":"Unpause","conditionsTrueStatusText":"Conditions are true.","conditionsFalseStatusText":"Conditions are false."},"registerHotkeys":false,"pauseHotkey":[],"unpauseHotkey":[],"togglePauseHotkey":[],"conditions":[{"collapsed":false,"id":"date","logic":0,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"dayOfWeek":0,"condition":0,"dateTime":"Thu Sep 7 19:56:14 2023","dateTime2":"Thu Sep 7 19:56:14 2023","ignoreDate":false,"ignoreTime":true,"repeat":false,"updateOnRepeat":true,"duration":{"value":{"value":0.0,"type":0},"unit":0,"version":1},"dayOfWeekCheck":true,"pattern":".... .. .. .. .. .."}],"actions":[{"collapsed":false,"id":"variable","enabled":true,"variableName":"Variable name here","variable2Name":"Invalid varialbe selection","strValue":"","numValue":0.0,"condition":5,"segmentIdx":0,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":"Text to find","replaceStr":"Text to replace with","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:","useInputPlaceholder":false,"inputPlaceholder":"--enter text--","environmentVariableName":"USERPROFILE"}]}],"version":"c375daa"}

You can reference the variable in your "File" action which you use to write the log entry using this syntax:
${Variable name here}

So an example action could look like this:
View attachment 97422
And will produce output similar to this:
[Thu Sep 7 20:00:49 2023] new log entry

Hope that helps!
Hi, I'm using this to change screenshot filenames on Custom location to have Date on it. One problem I'm having is you're not supposed to have ":" in filename so by far I haven't succeeded in doing what I want. Can I ask if there's any way I can replace ":" in the Variable to dash "-" or anything else?
 

Warmuptill

Active Member
I'm finally getting around to reporting this. Not a huge deal, but the docks are still being replicated on the other screen.
View attachment 99012
3x 1920x1080, side-by-side. The docks on the left screen are duplicates of where they are on the center screen. As before, mousing over either copy highlights both.
Thanks - I will try to reproduce it and have a look.

We have a church live stream that starts at 9:25am every Sunday. The problem is we would get busy with other setup tasks and not start the stream when we were supposed to, so we could miss a few minutes of the service. I then found Advanced Scene Switcher, which solved many of our problems. Fast forward to a couple of months ago and YouTube changed something that broke our web page which in turn broke this automation. I was able to get it to work but now we are using the Manage Broadcast functionality and we would really like to see a small expansion to the Streaming functionality. In the screen shot below, our automation is able to click on the Start Streaming button, but when we do that, the Manage Broadcast button changes to say Go Live! Would it be possible to have the ability to click the Go Live! button after the Start Streaming button is clicked within a running automation? I'm not sure how feature requests work here so let me know if it needs to be done somewhere else.

View attachment 99176
Last time I checked I don't think that was possible, unfortunately, as there was no API call to click the "Go Live!" button.
But I will try to check again if I find the time to.

Hi, I'm using this to change screenshot filenames on Custom location to have Date on it. One problem I'm having is you're not supposed to have ":" in filename so by far I haven't succeeded in doing what I want. Can I ask if there's any way I can replace ":" in the Variable to dash "-" or anything else?
Something like this should do the trick:
1699900072372.png
 

Bairespm

Member
Hello, every time I restart my PC... my midi devices usually change ports, could a function be added so that adss checks if it is the correct midi device in each macro? And if not, assign it... this way if you change ports you don't have to reconfigure all the macros. Thank you
 

AaronD

Active Member
We have a church live stream that starts at 9:25am every Sunday. The problem is we would get busy with other setup tasks and not start the stream when we were supposed to, so we could miss a few minutes of the service. I then found Advanced Scene Switcher, which solved many of our problems. Fast forward to a couple of months ago and YouTube changed something that broke our web page which in turn broke this automation. I was able to get it to work but now we are using the Manage Broadcast functionality and we would really like to see a small expansion to the Streaming functionality. In the screen shot below, our automation is able to click on the Start Streaming button, but when we do that, the Manage Broadcast button changes to say Go Live! Would it be possible to have the ability to click the Go Live! button after the Start Streaming button is clicked within a running automation? I'm not sure how feature requests work here so let me know if it needs to be done somewhere else.

View attachment 99176
We don't have that problem. For us, the "Start Streaming" action is all we need, and it "just works".

Do you have OBS logged into your YouTube account? We don't. We use a stream key. That might be the difference.

And, YouTube has a persistent stream ready to receive data. We don't set up a new one every time; we only change the details of the persistent one. Start throwing data at the server's URL and key, and YT starts the stream for us. Stop the data, and it times out and ends the stream. The DVR function makes a video to watch later, with the details that the stream had when it timed out and stopped. (we still record locally too, just in case the network goes nuts between us and YT)
 

rafdee

New Member
Thanks for such a great plugin.

One thing I would love to see is the option (if possible) to - switch - the opened Full Screen Projector between Preview and Program depending on the Scene. I use the Projected Preview Screen to display a different scene (at times) in studio, than the Program Screen which goes to live stream. (Confidence Monitor).

The other is the ability to close opened Fullscreen Projector windows.
 
Last edited:

normen

New Member
Hey,

first of all thanks for the plugin, its awesome.

I was trying to replace some text using variables but it seems the variables are only picked up the the "replace with" field, when I am using variables in the "replace" field they don't seem to be picked up? Specifically, I am trying to replace a text that I previously searched in some source settings via regex with partials.

Something like:
- get settings of source via source condition
- store in MySettings variable
- search "setting":"[^"]*" in MySettings with partial regex and store result in VariableA
- replace ${VariableA} with "setting":"${NewSetting}"

The last step is where it fails, ${VariableA} isn't picked up. It works when I replace ${VariableA} with the actual text thats currently in the settings but I want to regex that so I can replace dynamically, no matter the current setting.

Any ideas?
 

Destroy666

Member
The last step is where it fails, ${VariableA} isn't picked up. It works when I replace ${VariableA} with the actual text thats currently in the settings but I want to regex that so I can replace dynamically, no matter the current setting.

I'd recommend a feature request on GH to change these current fields to variable supporting ones, as not all fields are supporting them as of now.

You can see which fields support them in the beta/dev version BTW - I added a tooltip that says you can use vars in a field. If you don't want to install dev version then that feature will be coming in the next version released for OBS 30.
 

Warmuptill

Active Member
Hey,

first of all thanks for the plugin, its awesome.

I was trying to replace some text using variables but it seems the variables are only picked up the the "replace with" field, when I am using variables in the "replace" field they don't seem to be picked up? Specifically, I am trying to replace a text that I previously searched in some source settings via regex with partials.

Something like:
- get settings of source via source condition
- store in MySettings variable
- search "setting":"[^"]*" in MySettings with partial regex and store result in VariableA
- replace ${VariableA} with "setting":"${NewSetting}"

The last step is where it fails, ${VariableA} isn't picked up. It works when I replace ${VariableA} with the actual text thats currently in the settings but I want to regex that so I can replace dynamically, no matter the current setting.

Any ideas?
A build with this functionality will be available here in a few minutes:
1700057278604.png

Note that you have to be logged into GitHub to be able to download it.
Let me know if that should be an issue.

Please back up your settings before trying it just in case something broke.
If you should encounter any problems please do let me know about them! :)
 

normen

New Member
A build with this functionality will be available here in a few minutes:
View attachment 99219
Note that you have to be logged into GitHub to be able to download it.
Let me know if that should be an issue.

Please back up your settings before trying it just in case something broke.
If you should encounter any problems please do let me know about them! :)

Wow, thats great, I will try that tomorrow. Thank you for all your work.

Now if that build also has a way to get the "name of scene item number x" I'd feel all-powerful! :)
 

normen

New Member
I will try to think of something to solve this issue.


I will add it to the todo list, but I can't promise that I will get around to it soon.
The variables seem to pick up just fine in the nightly build, thanks for that!

About the name, I created some "Player" macros which allow playing items from a "Playlist" which is just a scene with a bunch of items which are hidden/shown in succession. For that I am grabbing the settings of the items and try to extract the name of the playlist item (i.e. the file of the player) so I can display it to know what I am playing next. That works fine when I am naming the sources from 1 ... 10 in plain numbers. It would be even more elegant if I could get a hold of the name of the item so I can grab the settings via that.

For now it looks like this and works very well for my purposes (live shows). The fact that its single sources makes it easy to allow for cross-fades by simply adding hide/show fade overrides for the single sources - or to edit the volume for each separately etc.

Have a look what you made possible :) ❤️

Bildschirmfoto 2023-11-16 um 13.40.32.png
 

Riddicrash

New Member
Hi there. This may have been answered but a tertiary search doesn't reveal it to me. I hope someone can help me with this. Here is my problem.

I have 10 scenes in my OBS.

Game
No Game
Be Right Back
Stream Over
Starting Soon No Timer
Starting Soon Timer
Multicam Game
Multicam No Game
Effects
Credits

And I have 3 transitions, we will call them.

Transition X
Transition Y
Luma Wipe

I want it to do something like this:

If Current Scene is 'Game' > And Next Scene is 'No Game' > Use 'Transition X'
Or If Current Scene 'No Game' > Next Scene is 'Game' > Use 'Transition Y'
Else Use 'Luma Wipe'

The problem I am having is when I am in for example, 'Be Right Back' and going into 'No Game', I want it to play 'Luma Wipe', but it keeps playing 'Transition X'.

I imagine if I make every permutation of combinations I can make it work, but surely something like the above is possible without making a million combinations?
 

Warmuptill

Active Member
Hi there. This may have been answered but a tertiary search doesn't reveal it to me. I hope someone can help me with this. Here is my problem.

I have 10 scenes in my OBS.

Game
No Game
Be Right Back
Stream Over
Starting Soon No Timer
Starting Soon Timer
Multicam Game
Multicam No Game
Effects
Credits

And I have 3 transitions, we will call them.

Transition X
Transition Y
Luma Wipe

I want it to do something like this:

If Current Scene is 'Game' > And Next Scene is 'No Game' > Use 'Transition X'
Or If Current Scene 'No Game' > Next Scene is 'Game' > Use 'Transition Y'
Else Use 'Luma Wipe'

The problem I am having is when I am in for example, 'Be Right Back' and going into 'No Game', I want it to play 'Luma Wipe', but it keeps playing 'Transition X'.

I imagine if I make every permutation of combinations I can make it work, but surely something like the above is possible without making a million combinations?
While you can set this up using the advanced scene switcher I would recommend using "transition table" for this purpose:

If you must set it up using the advanced scene switcher, because you have some other dependencies to those macros, I would suggest to wait for the next update which introduces "else actions", which should make this a lot easier to set up.

If you want to test it right now you can use this build:
Unfortunately you will have to log into GitHub to be able to download it.

Just set the active transition to "Luma Wipe" and create two macros setting the transition overrides for the "Game" and "No Game" scenes respectively.

1700248145689.png

1700248186068.png
 

Riddicrash

New Member
While you can set this up using the advanced scene switcher I would recommend using "transition table" for this purpose:

If you must set it up using the advanced scene switcher, because you have some other dependencies to those macros, I would suggest to wait for the next update which introduces "else actions", which should make this a lot easier to set up.

If you want to test it right now you can use this build:
Unfortunately you will have to log into GitHub to be able to download it.

Just set the active transition to "Luma Wipe" and create two macros setting the transition overrides for the "Game" and "No Game" scenes respectively.

View attachment 99325
View attachment 99326
Thank you for your quick response. You have been a great help. What youve suggested has worked great.
 

komusics

New Member
Need a button to cancel all running macros.

When i use many condition exm.
IF midi ( condition...........)
-switch to scenes.......
- wait 30 sec
- switch to scenes.......
- wait 20 sec
- switch to scenes......
.
.
.
.
.
.
.
(last) switch to scene.

And i press " run macro" buttom for test this macro .Yes, it can work properly if i wait for all macro to complete ,but If i press " run macro" buttom again .There will be a warning window "Macro is running " and If i try to close advanced-scene-switcher and OBS , OBS is stop working. then i need some buttom for cancel all macro before i go to test next macro . Otherwise I would have to wait until all the macros have finished running. which in some cases takes many minutes

thank you
 

Warmuptill

Active Member
Need a button to cancel all running macros.

When i use many condition exm.
IF midi ( condition...........)
-switch to scenes.......
- wait 30 sec
- switch to scenes.......
- wait 20 sec
- switch to scenes......
.
.
.
.
.
.
.
(last) switch to scene.

And i press " run macro" buttom for test this macro .Yes, it can work properly if i wait for all macro to complete ,but If i press " run macro" buttom again .There will be a warning window "Macro is running " and If i try to close advanced-scene-switcher and OBS , OBS is stop working. then i need some buttom for cancel all macro before i go to test next macro . Otherwise I would have to wait until all the macros have finished running. which in some cases takes many minutes

thank you
You can set up a macro like this:
1700328174475.png


And create a dock which you can then use to stop the given macros.

1700328278404.png


1700328381557.png


But I agree that maybe some global "kill switch" might be of use.
I will add it to the todo list, but I can't promise that I will get around to it soon.
 

AaronD

Active Member
Need a button to cancel all running macros.

When i use many condition exm.
IF midi ( condition...........)
-switch to scenes.......
- wait 30 sec
- switch to scenes.......
- wait 20 sec
- switch to scenes......
.
.
.
.
.
.
.
(last) switch to scene.

And i press " run macro" buttom for test this macro .Yes, it can work properly if i wait for all macro to complete ,but If i press " run macro" buttom again .There will be a warning window "Macro is running " and If i try to close advanced-scene-switcher and OBS , OBS is stop working. then i need some buttom for cancel all macro before i go to test next macro . Otherwise I would have to wait until all the macros have finished running. which in some cases takes many minutes

thank you
I would convert that single long macro into a bunch of short macros. Each looks for one scene being active for X time, and switches to the next scene. Nothing more. No Wait actions at all, replaced by the condition timers.

To start that sequence, just end up on any of its component scenes, "somehow", and it'll run the sequence from there. That "somehow" could be manual or another macro......

To escape that sequence, just switch to something that's not included. Then the condition timer won't finish, and the switch-to-next macro won't run.
 

4Stories

New Member
I am using OBS 20.1.3 on a PC and Win11 with Loupedeck to change scenes manually while speaking with a guest (difficult).
I just read about this plugin and tried to make it automatically change scenes for me but it is not working.
Audio tab says to use the macros.
I have a stereo audio AD input with me on left mic and guest on right mic.
I have one webcam with OBS used to make 3 scenes: see both, see me, see guest.
I would like to pretend I have a human switching cameras automatically:
Left audio stays x db above Right channel for x sec THEN show scene for just me.
Right audio stays x db above Left channel for x sec THEN show scene for just guest.
x seconds of silence or both L/R channels above x THEN show scene for both of us.

Can you please help me if this is possible with my setup. Or do I need separate AD units for L/R?
Thank You!
 

AaronD

Active Member
I am using OBS 20.1.3
Oww! How old is that?! I hope it's a typo. I wonder if Adv. SS even existed then.

Anyway, assuming it's a typo and that you're using at least a semi-current version:
I have a stereo audio AD input with me on left mic and guest on right mic.
That's a problem already, even with no plugins, because OBS insists that every device in its entirety must be a single source. You can't separate a device into individual sources.

For the specific case of two mics feeding a stereo interface, there's a hack:
  • Set OBS to stereo, at the top of Settings -> Audio, even if your output is effectively going to be mono. This prevents it from downmixing the raw stereo input to mono, and *then* giving you that mess to play with.
  • Make two copies of that stereo source.
  • In the Advanced Audio Properties, set both copies to mono, and pan them hard left and hard right.
Now you have separate control of each mic, but you can't pan them away from center. That works because the mono button is *after* the panner, which is backwards from the pro standard, but (perhaps accidentally) makes up for another shortcoming in OBS's audio, which is not choosing specific channels of a device.

It should also work then, to use Adv. SS's Audio condition to watch each of those sources separately.

Or do I need separate AD units for L/R?
That would certainly make it easier!

Left audio stays x db above Right channel for x sec THEN show scene for just me.
Right audio stays x db above Left channel for x sec THEN show scene for just guest.
x seconds of silence or both L/R channels above x THEN show scene for both of us.
I don't know that it does comparisons directly. What you might do though, is have one macro for each, that looks at its own being higher than some constant threshold and the other being lower than some constant threshold (different thresholds for stability), and then a third macro that looks at the first two not being true. That would also cover the case of both of you talking over each other, should it ever happen.

1700591453642.png

1700591461228.png

1700591476845.png
 
Top