Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

L&Mproducer

New Member
I have a scene that contains a bunch of sources (dozens and dozens). Our stream deck has buttons to hide/show each of these. I'm being asked to make an "undo" button that hides the last source shown, then the second last, then the third last, etc. (just like an UNDO button in software does)
I know I could use a data structure to keep a list of scenes that have been SHOWN in the order they have been shown, and when the UNDO button is clicked, it pops the last source off the list and then re-hides it.
The problem is that I don't know how to do this within Advanced Scene Switcher.
I don't want to go making dozens and dozens of conditions for each source, and have to remember to update it each time I change my sources.
Also I see lots of references to indexes (like which index a source is within a scene) but no way to loop through these indexes to do anything super valueable. I feel like I'm missing something.
 

Warmuptill

Active Member
I have a scene that contains a bunch of sources (dozens and dozens). Our stream deck has buttons to hide/show each of these. I'm being asked to make an "undo" button that hides the last source shown, then the second last, then the third last, etc. (just like an UNDO button in software does)
I know I could use a data structure to keep a list of scenes that have been SHOWN in the order they have been shown, and when the UNDO button is clicked, it pops the last source off the list and then re-hides it.
The problem is that I don't know how to do this within Advanced Scene Switcher.
I don't want to go making dozens and dozens of conditions for each source, and have to remember to update it each time I change my sources.
Also I see lots of references to indexes (like which index a source is within a scene) but no way to loop through these indexes to do anything super valueable. I feel like I'm missing something.
While it might be possible to do this somehow using the Advanced Scene Switcher I feel like it might be easier to set up a custom script which handles this.
Iterating through a list of scene items is currently not easily possible.
 

AaronD

Active Member
I have a scene that contains a bunch of sources (dozens and dozens). Our stream deck has buttons to hide/show each of these. I'm being asked to make an "undo" button that hides the last source shown, then the second last, then the third last, etc. (just like an UNDO button in software does)
I know I could use a data structure to keep a list of scenes that have been SHOWN in the order they have been shown, and when the UNDO button is clicked, it pops the last source off the list and then re-hides it.
The problem is that I don't know how to do this within Advanced Scene Switcher.
I don't want to go making dozens and dozens of conditions for each source, and have to remember to update it each time I change my sources.
Also I see lots of references to indexes (like which index a source is within a scene) but no way to loop through these indexes to do anything super valueable. I feel like I'm missing something.
If you limit your undo history to X steps, then you can have X variables, that you manage as a sort of "stack". It'll be clunky compared to a real stack, but if you can separate the internal logic that makes it work that way, from its actual use, then it should be straightforward from there.

You'll probably have several macros with no conditions, so they don't run on their own, that are used instead as "functions", "methods", "subroutines", or whatever you want to call them. Put your low-level management logic in there, and "call" them from the higher-level macros using the Macro action. Arguments / parameters / whatever, as well as return values, can be done with more variables.

Every time you make an "undo-able" change, you encode that and "push" it onto the stack. When you want to undo, you "pop" one off the stack and decode it. If the stack is empty, do nothing, or something appropriate for that error condition. Being limited to X steps, in this case, should probably lose the oldest entry. You could just as easily code it to deny any more pushes, but that would make it undo something other than the last action.

If you also want to redo, then you have a second stack for that. When you pop and undo, you also push it onto the redo stack. Otherwise, same idea. When you do something new, clear / erase / wipe / reset the redo stack. (whatever you want to call that action)
 
Last edited:

Klayy

New Member
Hello there.

I'm having trouble connecting my Twitch token to Advanced Scene Switcher. I can get to the Authorize page but then it never redirects me after that. I see it under my Connections tab in my Twitch settings but it fails to connect within the plugin.

Is there a setting or step I'm missing regarding my token?
 

CaPoSno

New Member
I have another use case which I hope your plugin could ev. help with:

From time to time in my streams I get micro-stutter from my Magewell capture card which immediately disappears once I manually change video capture device settings e.g. from Color Format "YUY2" to "Automatic" or from "Automatic" to "YUY2".

It seems this action triggers kind of on the fly reset of the card which then leads to - again - smooth video display.

The idea is now to set up a macro which performs this manual action and link macro execution to a hotkey. Going through all the documentation here it seems doable with the plugin. Am I correct?

Thanks for your help
 

AaronD

Active Member
I have another use case which I hope your plugin could ev. help with:

From time to time in my streams I get micro-stutter from my Magewell capture card which immediately disappears once I manually change video capture device settings e.g. from Color Format "YUY2" to "Automatic" or from "Automatic" to "YUY2".

It seems this action triggers kind of on the fly reset of the card which then leads to - again - smooth video display.

The idea is now to set up a macro which performs this manual action and link macro execution to a hotkey. Going through all the documentation here it seems doable with the plugin. Am I correct?

Thanks for your help
Yes, that's absolutely doable! I even do it myself to fix the terrible latency that one of my capture cards has by default.
1717678189036.png

Use the "Get current settings" button to get both the wrong and right settings, and then trim it manually to only keep the part that changed. It may not hurt to keep all of it, but I've seen and even designed side-effects on purpose, even when writing the same value, so I try to avoid that when I can.

This is also one of the very few times I'll use a Wait action, and you'll notice it's very short. Normally, I use a different macro for each step in a sequence, and use the condition timers instead. This one is all in one macro because it's "atomic", as programmers call it: can't (or shouldn't) be broken down any further or interrupted, for any reason at all, not even pedantically.

The (*) after the name, in my naming convention, means that it has a docked button. Click the gear icon at the top-right, then:
1717678439381.png

1717678521973.png
 

fencer

New Member
Hi everyone
I have a problem with record starting via macro, for some reason it doesnt start record. Scenes are correctly switched depend of records on the sequence tab .
obs_macro_rec.png

OS Win 7, OBS 27.2.4 (x64) Switcher 1.17.5
Could someone help me to find the reason of this problem?
UPD: dont offer update OS, OBS&Switcher, for some resons I cant do it.
Thanks
 

AaronD

Active Member
OS Win 7
...
UPD: dont offer update OS...for some resons I cant do it.
You know you're asking to get hacked, right? Then you're forced to do something anyway, with timing that will likely wreck a few other things. You really do need to get back to being hack-resistant on *your* schedule, not someone else's.



For the actual problem:
Hi everyone
I have a problem with record starting via macro, for some reason it doesnt start record. Scenes are correctly switched depend of records on the sequence tab .View attachment 104429
I don't see anything that would keep it from working, except:
  • "And recording stopped" might somehow be blocking it. Does it think it's already recording at that point in your program?
  • The Priority order on the General tab might somehow prevent the macro from running at all. Default is to have Macros as the highest priority, but depending on how the code works under the hood, it could be that everything runs together, and then the lower-priority actions are ignored in case of a clash. If the Macros are not the highest, and if the code really does work that way, then it could appear at times that the macros are broken.
Likewise, if something else is not the highest, and the code really does work that way, then it could appear that the something else is broken. Try to migrate everything into the macros. It might take some thinking, but all of it is possible, often with multiple ways of doing it that each have different side-effects and other features that you may or may not appreciate. Then with everything else empty, make sure that Macros have the top priority.


Also, looking at your screenshot again, you only have that one macro enabled. (the checkbox next to the name, on the left side) Unchecked there, means it won't run. That's also how the Pause/Unpause actions work: they only control those checkboxes. Maybe you thought it meant something else?
 

Warmuptill

Active Member
Hello there.

I'm having trouble connecting my Twitch token to Advanced Scene Switcher. I can get to the Authorize page but then it never redirects me after that. I see it under my Connections tab in my Twitch settings but it fails to connect within the plugin.

Is there a setting or step I'm missing regarding my token?
The plugin will receive the token information from your browser via "localhost" on port "8080".
It could be that something is blocking this local connection or something else is already running on this port.
This might be visible in the OBS log.
 

CaPoSno

New Member
I used .zip to install 1.26.3 version but advanced-scene-switcher-opencv.dll was not included there so old (1.24.2) version remained in the directory which - for some reason - could not be loaded despite installation of new Microsoft Redistributable as recommended.

It worked with advanced-scene-switcher-opencv.dll from version 1.26.1. Please add advanced-scene-switcher-opencv.dll also in 1.26.3 zip.
 

fencer

New Member
You know you're asking to get hacked, right? Then you're forced to do something anyway, with timing that will likely wreck a few other things. You really do need to get back to being hack-resistant on *your* schedule, not someone else's.



For the actual problem:

I don't see anything that would keep it from working, except:
  • "And recording stopped" might somehow be blocking it. Does it think it's already recording at that point in your program?
  • The Priority order on the General tab might somehow prevent the macro from running at all. Default is to have Macros as the highest priority, but depending on how the code works under the hood, it could be that everything runs together, and then the lower-priority actions are ignored in case of a clash. If the Macros are not the highest, and if the code really does work that way, then it could appear at times that the macros are broken.
Likewise, if something else is not the highest, and the code really does work that way, then it could appear that the something else is broken. Try to migrate everything into the macros. It might take some thinking, but all of it is possible, often with multiple ways of doing it that each have different side-effects and other features that you may or may not appreciate. Then with everything else empty, make sure that Macros have the top priority.


Also, looking at your screenshot again, you only have that one macro enabled. (the checkbox next to the name, on the left side) Unchecked there, means it won't run. That's also how the Pause/Unpause actions work: they only control those checkboxes. Maybe you thought it meant something else?
Thanks a lot
About your mentonied that I asking to get hacked) It's more simple - OBS is installed on the old weak sever wich doesn't support nothin more higher Win 7, so OBS version and swither version have maximum version for version OS support - that's why "dont offer update OS, OBS&Switcher, for some resons I cant do it."
The server is in the DMZ where hasnt out to Internet.
I solved my problem, now there is some another way to record and it works as I want.
start_rec_sc1.png
And you were right macros priority must be the first.

Now when I unpause strart_rec_sc1 it records all scenes in the sequence and stops.
 

AaronD

Active Member
About your mentonied that I asking to get hacked) It's more simple - OBS is installed on the old weak sever wich doesn't support nothin more higher Win 7, so OBS version and swither version have maximum version for version OS support - that's why "dont offer update OS, OBS&Switcher, for some resons I cant do it."
Doesn't matter what the hardware supports or not. Old system, out of support = hack bait. Period.

The server is in the DMZ where hasnt out to Internet.
That helps, but it's not enough. There are things that jump every gap imaginable. Remember STUXNET, that destroyed Iran's nuclear program a few years ago? Iran did everything right, including an "air gap" between that and the internet, and it STILL got in and did its job. Then the code that did that quickly ended up on the black market, so now everyone can use it.

I solved my problem, now there is some another way to record and it works as I want.
View attachment 104499And you were right macros priority must be the first.

Now when I unpause strart_rec_sc1 it records all scenes in the sequence and stops.
Glad you found the fix!
 

Warmuptill

Active Member
I used .zip to install 1.26.3 version but advanced-scene-switcher-opencv.dll was not included there so old (1.24.2) version remained in the directory which - for some reason - could not be loaded despite installation of new Microsoft Redistributable as recommended.

It worked with advanced-scene-switcher-opencv.dll from version 1.26.1. Please add advanced-scene-switcher-opencv.dll also in 1.26.3 zip.
Thanks for pointing that out!
I will investigate what went wrong there and release an update as soon as I can.

Update:
The issue is caused by the fact that GitHub decided to integrate a new version of the Visual Studio tools.
This resulted in MSVC 19.40.33811.0 being used in the CI environment, which is not compatible with the OpenCV version used up to now. (4.6.0)
Downgrading to the older version is unfortunately not possible.

Fortunately, OpenCV released a new version, which is compatible with MSVC 19.40.33811.0 just a few days ago.
A build of the plugin with version is available here on GitHub:
The Windows release is available here:
You will have to be logged into GitHub to be able to download those builds unfortunately.

Unfortunately, using this new OpenCV version with with MSVC 19.40.33811.0 will also result in setups running an old version of the Microsoft Visual C++ Redistributable no longer being able to use the Video condition.

I believe OBS Studio is facing similar issues with their recent beta builds.
Maybe they come up with a clever solution for this type of issue, which I can also apply for this plugin.

Thanks again for notifying me about his problem and sorry for not really being able to solve it yet!
 
Last edited:

Lawrence_SoCal

Active Member
About your mentonied that I asking to get hacked) It's more simple - OBS is installed on the old weak sever wich doesn't support nothin more higher Win 7, so OBS version and swither version have maximum version for version OS support - that's why "dont offer update OS, OBS&Switcher, for some resons I cant do it."
The server is in the DMZ where hasnt out to Internet.
I held off for a while, but even circa 2009 CPUs ran Win10 fine.
There is very little that Win7 x86 runs on that won't also run Win10. I do have a Win8 ARM based system that can't upgrade :( ...
Most any CPU/system powerful enough to be running OBS Studio on Win7 I'd have thought would be fine with Win10 (and its a free upgrade... full system back first, just to be safe) ... just curious... which CPU/chipset does your old weak server have?

Iran did everything right, including an "air gap" between that and the internet, and it STILL got in and did its job.
Nah, they may have done a LOT right... but a they violated basic security principles (by letting someone connect a device to both secured and insecure networks. And yes, I'm aware of nation-state methods of getting around that, but not relevant in the context of OBS Studio users). The problem is that in most cases, a truly secure/isolated system isn't usually all that functional for typical users, and enabling it to be so tends to get quite expensive... [ignore Tempest-like environments as not relevant to this discussion]
For typical (even security-minded) users, an isolated/restricted system needs an update, or new content, or something.... and then that protected system is no longer 'safe'
 

Klayy

New Member
The plugin will receive the token information from your browser via "localhost" on port "8080".
It could be that something is blocking this local connection or something else is already running on this port.
This might be visible in the OBS log.
I do see something in the logs. It just says: Failed to bind token server to localhost 8080! I'm not sure what else to look out for to solve the issue.

The whole log file seems too long to post on here so I'll just provide the link.

 

derupasu

New Member
I downloaded Advanced Scene Switcher a few days ago and tried to do image recognition in OBS. After some research, it seems that image recognition can be done by changing the “Source” to “Video” in the following picture, but I can't find the “Video” button.
 

Attachments

  • IMG_4121.png
    IMG_4121.png
    8.2 KB · Views: 15
Top