Advanced Scene Switcher

Advanced Scene Switcher 1.37.2

I don't know why, OBS immediately performs all the ACTIONS, even though one of them is WAIT FOR THE FILM TO END:
Film Google
As far as I can tell - can only check on my phone atm - , the media source in question seems to be paused.
In that case the “wait” of the media action will not block, as the media source is not currently being played back.

I can try to look into adding an option to more precisely configure what is being considered as a “paying” state, but I can promise any concrete timeline.
I tried to use the projector in fullscreen instead of in a window, this allowing me to target my secondary screen, but then the problem is I can't close it, because it's not a window that can be targetted by your plugin.
You should also be able to close full screen projector windows using the “Projector“ action type.
If not then that is a bug I will look into.

I am not sure at the moment if your other requests are possible.
I will look into it when I can.

Hi,
here are the timestamps:
10:26:30 Macro 'ACW_P04>P00' via 'run macro'
10:26:45 Macro 'ACW_P05>P00' via 'run macro'
10:27:00 Macro 'ACW_P04>P00' via 'run macro'
10:27:15 Macro 'ACW_P05>P00' executed with condition (visibility of source)
10:27:40 Macro 'ACW_P05>P00' via 'run macro'

I hope that is what you need.
To be honest the setup is a bit too complex for me to fully understand at the moment.

I can see that the scene item visibility condition is true at 10:27:16.203.

The actions are then executed less than a millisecond later over the span of a few seconds.

Can you elaborate a bit on what exactly is not working? (What action / set of actions)
Or even better, but probably not possible:
Can you provide a minimal example of the setup that is not willing as expected?

Sorry for not really being able to help! ☹️
 
Last edited:
Hi,
I am trying to build a controller that works all the time.
MULTIMEDIA Background Film "Tlo1" is a spinning basic movie, also it has to be visible as a playing movie.

Evidently in my case, the function; Wait until the entire video is played and perform..., is the most important

I don't know, maybe I started wrong, because I activate the one time playback of FILM1, FILM2, FILM3 via the VISIBILITY in the Multimedia list in one scene.
Maybe I should trigger the conditions with keys? I don't know how to make a macro that would listen.

I want it to work like this when streaming:
1. **Background 1** plays all the time in a loop, that is, it repeats indefinitely as if it were the basic background.
2. I have the option to turn on **Scene 2** (or any other, e.g. Scene 3), press the scene change button at any time, then: **Scene 1** must first fully end. IMPORTANT: so that the programme does not interrupt it in the middle - and wait until it has played all the way through, and only then does the streamer turn on **Scene 2**.
3. after **Scene 2** has finished, we automatically go straight back to **Scene 1**, which plays in a loop again.
-----

maybe use buttons ? Then maybe it would work
 
Last edited:
simple macro dont work:
Film Google


1747291522825.png
 
1> How can I parse the following JSON output to individual variables?
{"Clock":"5:03","Home Goals":"8","Away Goals":"1"}

2> Is there a way for me to display variables in an OBS scene that updates faster than the way I currently do it, writing the variable to a TXT file and have OBS read that file in. Is there a better, faster trick?
 
I found an error with the ‘Advenced Scene Switcher’ and the operation of the ‘Wait for playback to stop’ function and the ‘Source->Film->State matches->Ended’ function.
As you can see in the video, in the first part of the video it runs OBS, Macro with ‘Wait for playback to stop’ and ‘Hotkey’ ‘J’ works - it waited for the video to finish.
In the second part of the movie, in the meantime I added any field in the plugin ‘Advenced Scene Switcher’ it doesn't detect MEDIANS, which caused the lack of MEDIANS detection, and as if this condition ‘Wait for playback to stop’ wasn't there, it goes on - in our case it immediately shows the next movie.

This is a bug in the ‘Advenced Scene Switcher’, which I hope will be corrected in future versions.
Video: Video Google
 
1> How can I parse the following JSON output to individual variables?
{"Clock":"5:03","Home Goals":"8","Away Goals":"1"}

2> Is there a way for me to display variables in an OBS scene that updates faster than the way I currently do it, writing the variable to a TXT file and have OBS read that file in. Is there a better, faster trick?

1 - Since the JSON is basic, use Variable Extract JSON field with name and enter e.g. `Clock`. Otherwise you can use Query JSON action, but it's unnecessary here and for now it returns an array, I might submit a change to flatten it with checkbox whenever I find time.

2 - Simply use Source Set settings action and track Variable changes in condition. Sometihng like:
1747589676668.png
 
Hi all - having issues with the "and not" operator - it seems to be ignored entirely.

I'm trying to set things up to where the switcher checks if the processes are running and, if not, it will fire it up. If they are, then it ignores it and moves on.

But this does not work, every time the macro runs I always get this error:

1747618382168.png


Here's my macro setup


1747618360011.png


What am I doing wrong/what can I fix to make this work?
 
but nevertheless ASS is unfortunately very unstable in the ‘MEDIA’ configuration.
Short films, uncomplicated MACRO, and yet the second time the MACRO is executed, it stops performing parts of the ACTION.
Maybe with the next new version these two errors above will be fixed?

Film Google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IeSrcdQfORjcDkdY7943D7Bj+on7Z1Um+f5PUneAY5dQIdRzFpB9W3DhzUwRvGSXp0gn08WoGl2J1fAb0batg=

setting for the BACKGROUND that is repeated in the LOOP:
AAAL93ic7Vbfb9owEP5XkJ9JBaUMylvLOg1p3dhge5mqyjhHsHDsyD9QEer/Pp8TTFLaTlqndQ+thOpcvrv7fN+d4x3JKdPKkNHPHZE0BzIic6FaU7CCkjbJtHIFGS2pMNAmBXUGZnQDl7CiG640GXUqaw2jqRAgyMhq55/ZCth6rGTKLVfSTOQ0AioPJccrKjPYe5g1L67ugH2RM0u1jThjVXHByijLz8q+V/KQFomtlLZjrpnj9mpDhaOIrSPGzsfII5kxUptIC9qjI449C9oRjAy1RefktNP867aJ3Rb46t6nldyGMm1Am8Cn662pYusZWMtlZjCWhowbnyOyWFHzzclLZy26lIXxtinW+sjq62Sd+UQXtaqueLYS/mcny0P159odSqb38edw5ykSn49UajbsISfBnRy/+17a/FvWSFIyqkCH/C2qoYW0TxoeH5DQcy6BMfpg3SapB9B0Y0wSmjdBY3LWH8CiP1wkcM4GydlwkCa0k54np91ztqRp52y4GJAHKgT3sqViwlkhuPVKTJXhZf/4yShwQnrDwX07rvv3N1WAK8+tDPKMb78XfTvouRf8o7Jr2JrmiJVG730Tq143WZVlAqYPzYd6hrwGshykrXcZU0LQwkB6PBTN5mF1G7netkRYtglIuhDoX/Zeo5ocdckh5XhwCJVxFvo+dToM4rVK+ZJji++I5Tncer7GasplOR8GcAPm8RHr/G6kvNkop1lwq6Dt2onWJYhgIGEGAlipzjGSxDjz/ZtwgMUn47vUr96hgp49ryL1Dvv8ww00HryalP0rKSvg01rSapNBpKp4sSAv3rYBWE/BV1xamtW9+w/cA53Z3xIZURML+eNInt7Na+vyv0cHb5zk152uvSLDN0X+M0V6b4q8siKB9e2GG77g/nO8JU9vt/eiTe6LGY9HPLYhXgZM+VXmsnD2B9UcaQcbwjY1Q7x4+xuQvF1ykTvk7K/ZF1XkbnuvN8HXXbwIwZI64QOXZnL4ZHx14KBKHqtDuic93yrJAiz1pH8BQtoPkQ==

Paweł
 
I found an error with the ‘Advenced Scene Switcher’ and the operation of the ‘Wait for playback to stop’ function and the ‘Source->Film->State matches->Ended’ function.
As you can see in the video, in the first part of the video it runs OBS, Macro with ‘Wait for playback to stop’ and ‘Hotkey’ ‘J’ works - it waited for the video to finish.
In the second part of the movie, in the meantime I added any field in the plugin ‘Advenced Scene Switcher’ it doesn't detect MEDIANS, which caused the lack of MEDIANS detection, and as if this condition ‘Wait for playback to stop’ wasn't there, it goes on - in our case it immediately shows the next movie.

This is a bug in the ‘Advenced Scene Switcher’, which I hope will be corrected in future versions. Video:
Film Google
 
Hi all - having issues with the "and not" operator - it seems to be ignored entirely.

I'm trying to set things up to where the switcher checks if the processes are running and, if not, it will fire it up. If they are, then it ignores it and moves on.

But this does not work, every time the macro runs I always get this error:

View attachment 113524

Here's my macro setup


View attachment 113522

What am I doing wrong/what can I fix to make this work?

Did you check if the process that keeps running is in fact the same executable? Did you check if it works as regular if condition?
 
Hi all - having issues with the "and not" operator - it seems to be ignored entirely.

I'm trying to set things up to where the switcher checks if the processes are running and, if not, it will fire it up. If they are, then it ignores it and moves on.

But this does not work, every time the macro runs I always get this error:

View attachment 113524

Here's my macro setup


View attachment 113522

What am I doing wrong/what can I fix to make this work?
I can't spot any obvious issues in your setup and this works just fine on my end.
Do you maybe have any other macros, which are running the action of the shown macro or any other macros also trying to launch the same process?

As suggested by @Destroy666 you can maybe check if the process has a different name for some reason.
Or alternatively you can first test with another application like notepad / calculator.
 
Last edited:
1> How can I parse the following JSON output to individual variables?
{"Clock":"5:03","Home Goals":"8","Away Goals":"1"}
If you have complex JSON objects you can do something like this:
1747681101199.png


If they are as simple as your example you can use this instead:
1747681128332.png


2> Is there a way for me to display variables in an OBS scene that updates faster than the way I currently do it, writing the variable to a TXT file and have OBS read that file in. Is there a better, faster trick?
You can also see variable values in the Variable tab:
1747681207218.png


I found an error with the ‘Advenced Scene Switcher’ and the operation of the ‘Wait for playback to stop’ function and the ‘Source->Film->State matches->Ended’ function.
As you can see in the video, in the first part of the video it runs OBS, Macro with ‘Wait for playback to stop’ and ‘Hotkey’ ‘J’ works - it waited for the video to finish.
In the second part of the movie, in the meantime I added any field in the plugin ‘Advenced Scene Switcher’ it doesn't detect MEDIANS, which caused the lack of MEDIANS detection, and as if this condition ‘Wait for playback to stop’ wasn't there, it goes on - in our case it immediately shows the next movie.

This is a bug in the ‘Advenced Scene Switcher’, which I hope will be corrected in future versions. Video:
Film Google
Thanks for reporting the issue.
I will look into it as soon as I can.
Sorry for taking so long!

Update:
On first glance this seems like a possible race condition in the Media Source type on OBS side.
But I will keep investigating.
 
Last edited:
@Warmuptill --

Is it possible to have a Cursor option that is "Near Source"?

As you may recall, you helped work out a way to zoom into the screen at multiple incremental levels -- like, from 100%, then to 150%, then 200%, and so on, then back out again, from 300%, then to 200%, and so on.
And, I have a overlay graphics on screen that stay in place on the left edge, or lower-left corner.

So, I currently use the Cursor "In Region" option to define a region where the overlay graphics are on the screen, and when the cursor gets in the pre-defined region on the left, for instance, the overlay graphics fade away, and then fade in on the opposite side.

This allows the user that is demonstrating something on their screen to not have to even think about whether or not the overlay graphics are still in view, on top of what they are demonstrating -- which works fantastico, but only at a zoom level of 100%.

However, when zoomed in at all, the region is still based on a full sreen size (in my case 1920x1080).... but the overlay graphics are fixed -- as in, they are not part of the zoom operation.

The result is that the region I define for the lower left corner, for example is not the correct location for the overlay graphcs that are on-screen in the lower left corner. Instead, the defined region is further to the left, which means the cursor has to move onto, and even passed the overlyat graphics, to get into the predefined region, which means the overlay graphics do not move to the opposite side when they should.

Further, the more the screen is zoomed in, the worse the 'offset' is, between the pre-defined region, and the actual overlay graphics.

1747831345941.png
 
If you have complex JSON objects you can do something like this:
View attachment 113536

If they are as simple as your example you can use this instead:
View attachment 113537


You can also see variable values in the Variable tab:
View attachment 113538


Thanks for reporting the issue.
I will look into it as soon as I can.
Sorry for taking so long!

Update:
On first glance this seems like a possible race condition in the Media Source type on OBS side.
But I will keep investigating.
Sorry, some more clarification on my part:
If I want to display a variable in a scene, is there any alternative to writing the file to a variable and then reading that variable? I suspect the answer is no, just wondering if there was a feature available to skip the disk process.

1747834095201.png
 
I found an error with the ‘Advenced Scene Switcher’ and the operation of the ‘Wait for playback to stop’ function and the ‘Source->Film->State matches->Ended’ function.
As you can see in the video, in the first part of the video it runs OBS, Macro with ‘Wait for playback to stop’ and ‘Hotkey’ ‘J’ works - it waited for the video to finish.
In the second part of the movie, in the meantime I added any field in the plugin ‘Advenced Scene Switcher’ it doesn't detect MEDIANS, which caused the lack of MEDIANS detection, and as if this condition ‘Wait for playback to stop’ wasn't there, it goes on - in our case it immediately shows the next movie.

This is a bug in the ‘Advenced Scene Switcher’, which I hope will be corrected in future versions. Video:
Film Google
This seems like a problem of the "Media Source" behavior on OBS side and is outside of the control of the Advanced Scene Switcher.

Pausing a media source, then immediately stopping it before triggering a restart seems to result in that behavior.
If this specific sequence of steps is performed the source will always report the status "stopped".
This is also the reason why the media source controls seem to misbehave (the timeline / progress bar will no longer move, because it too "thinks" that the media source is stopped)

So this will have to be fixed on OBS side.
I will try to submit a PR myself, if I can find an easy fix / find the time to.

However, what you can do to avoid this situation is simply remove the redundant "Stop" action, as it won't have any effect if you restart the media source right after anyway.

1747837970259.png


@Warmuptill --

Is it possible to have a Cursor option that is "Near Source"?

As you may recall, you helped work out a way to zoom into the screen at multiple incremental levels -- like, from 100%, then to 150%, then 200%, and so on, then back out again, from 300%, then to 200%, and so on.
And, I have a overlay graphics on screen that stay in place on the left edge, or lower-left corner.

So, I currently use the Cursor "In Region" option to define a region where the overlay graphics are on the screen, and when the cursor gets in the pre-defined region on the left, for instance, the overlay graphics fade away, and then fade in on the opposite side.

This allows the user that is demonstrating something on their screen to not have to even think about whether or not the overlay graphics are still in view, on top of what they are demonstrating -- which works fantastico, but only at a zoom level of 100%.

However, when zoomed in at all, the region is still based on a full sreen size (in my case 1920x1080).... but the overlay graphics are fixed -- as in, they are not part of the zoom operation.

The result is that the region I define for the lower left corner, for example is not the correct location for the overlay graphcs that are on-screen in the lower left corner. Instead, the defined region is further to the left, which means the cursor has to move onto, and even passed the overlyat graphics, to get into the predefined region, which means the overlay graphics do not move to the opposite side when they should.

Further, the more the screen is zoomed in, the worse the 'offset' is, between the pre-defined region, and the actual overlay graphics.

View attachment 113580
Thanks for the suggestion!

Unfortunately, I am not sure how I could implement something like this easily.

I would have to check the positions of all display capture sources on the OBS canvas and figure out if they are cropped / zoomed in, by gathering this information from all filters applied to those sources, and relate this information to the current cursor position.
This seems rather difficult to do reliably.
 
Did you check if the process that keeps running is in fact the same executable? Did you check if it works as regular if condition?

Yep - have looked multiple times, the process matches
1747860918748.png


I can't spot any obvious issues in your setup and this works just fine on my end.
Do you maybe have any other macros, which are running the action of the shown macro or any other macros also trying to launch the same process?

As suggested by @Destroy666 you can maybe check if the process has a different name for some reason.
Or alternatively you can first test with another application like notepad / calculator.
Did this, it actually shows up in the "conditional" test however if I hit run macro, it still causes this issue, it just seems to be ignoring the "NOT" and still processes it through, although the strange thing is that it's not recognizing the Streamer/Speaker bot processes, and I've triple, quadruple checked that they show up.
 
Sorry, some more clarification on my part:
If I want to display a variable in a scene, is there any alternative to writing the file to a variable and then reading that variable? I suspect the answer is no, just wondering if there was a feature available to skip the disk process.

View attachment 113581
Ah sorry, then I misunderstood your request.
That should already be possible by modifying the appropriate setting of the relevant text source:

1747932048382.png


So you can save the step of first writing the value to disk and reading it back out from the text source.

Let me know, if you have further questions / run into any problems! :)

Did this, it actually shows up in the "conditional" test however if I hit run macro, it still causes this issue, it just seems to be ignoring the "NOT" and still processes it through, although the strange thing is that it's not recognizing the Streamer/Speaker bot processes, and I've triple, quadruple checked that they show up.
Just to avoid a possible misunderstanding:
The "Run macro" button will run the macro action regardless of the condition state.
It is intended to be used to test the action sequence not as a means of "activating" the macro.

Are you facing the issue of the process being started unexpectedly also when *not* using the "Run macro" button and letting the plugin check the conditions?

If you want we can also try to figure out what the problem is in a quick call / screenshare session.
(If so, feel free to send me a DM)
 
This seems like a problem of the "Media Source" behavior on OBS side and is outside of the control of the Advanced Scene Switcher.

Pausing a media source, then immediately stopping it before triggering a restart seems to result in that behavior.
If this specific sequence of steps is performed the source will always report the status "stopped".
This is also the reason why the media source controls seem to misbehave (the timeline / progress bar will no longer move, because it too "thinks" that the media source is stopped)

So this will have to be fixed on OBS side.
I will try to submit a PR myself, if I can find an easy fix / find the time to.

However, what you can do to avoid this situation is simply remove the redundant "Stop" action, as it won't have any effect if you restart the media source right after anyway.

View attachment 113583


Thanks for the suggestion!

Unfortunately, I am not sure how I could implement something like this easily.

I would have to check the positions of all display capture sources on the OBS canvas and figure out if they are cropped / zoomed in, by gathering this information from all filters applied to those sources, and relate this information to the current cursor position.
This seems rather difficult to do reliably.

What if you would only need to interrogate/monitor a specific few source objects?
 
Ah sorry, then I misunderstood your request.
That should already be possible by modifying the appropriate setting of the relevant text source:

View attachment 113604

So you can save the step of first writing the value to disk and reading it back out from the text source.

Let me know, if you have further questions / run into any problems! :)


Just to avoid a possible misunderstanding:
The "Run macro" button will run the macro action regardless of the condition state.
It is intended to be used to test the action sequence not as a means of "activating" the macro.

Are you facing the issue of the process being started unexpectedly also when *not* using the "Run macro" button and letting the plugin check the conditions?

If you want we can also try to figure out what the problem is in a quick call / screenshare session.
(If so, feel free to send me a DM)
Thank You, exactly the trick i was looking for
 
Back
Top