Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

I am developing an OBS environment that relies heavily on Advanced Scene Switcher, for other users to use.
Is there a way to lock out users from changing anything in AdvSS, so they don't access to "the code".
  • Perhaps a password mechanism to be able to make changes?
Also, I am already planning to load the "master" settings file whenever OBS is loaded -- perhaps that is sufficient -- as in if a curious user messes things up for themselves, they would be instructed to restart OBS?
  • Where is the settings file located, that is loaded upon OBS launch?
 

AaronD

Active Member
I am developing an OBS environment that relies heavily on Advanced Scene Switcher, for other users to use.
Is there a way to lock out users from changing anything in AdvSS, so they don't access to "the code".
  • Perhaps a password mechanism to be able to make changes?
Also, I am already planning to load the "master" settings file whenever OBS is loaded -- perhaps that is sufficient -- as in if a curious user messes things up for themselves, they would be instructed to restart OBS?
  • Where is the settings file located, that is loaded upon OBS launch?
You can start with:
  • File -> Show Settings Folder
  • File -> Show Profile Folder
Adv. SS is part of the Scene Collection, which should be close by, but you probably want to back up ALL of that and restore it before each launch anyway. (don't launch OBS directly, but have a script that restores the backup and *then* launches it)

I do something similar for digital sound in a couple of churches: A computer somewhere is on 24/7 (usually a Raspberry Pi), and when the sound board appears on the network, it pushes the standard settings into it. (there's a battery backup and some additional timing involved, so that a power hiccup doesn't completely wreck a service, but you get the idea) So it no longer matters how the last person left it. And if you want to continue how you left off, you need to explicitly save it, wait for the reset, and then load it again. Works really well!

I haven't done that yet with OBS - still changing things around too much myself - but probably the way I'd do it is to:
  1. Have a Profile and Scene Collection that is known to work. I'll call it "Standard" for now.
  2. Back that up, but only that, so that others can still have their favorite derivatives of it.
  3. Have the launcher script restore the backup and point OBS to it:
    • obs --profile "Standard" --collection "Standard" and whatever other command-line options you want. obs --help in a terminal to see all of them.
Then if something doesn't work, you can tell them to restart, which has them run the script because you've modified the launcher(s) to do that. And if they want to keep their "special settings", they can do that too by the normal switching method inside of OBS, because the backup does *not* include that. But you don't support their derivatives. If they mess it up and don't know how to fix it, then they can reboot and use the standard.
 
Last edited:
Thank you, @AaronD -- I am aleady storing off in a separate location the Profile, Scene Collection, and AdvSS settings file, and also using the --profile and --collection switches as you mentioned.

Sounds like my approach is inline with yours. :-)

Just to confirm -- you are saying that all the AdvSS settings (including macros) are stored in the Scene Collection file?
 

Sambo3975

New Member
Unfortunately, the minimum required OBS version for this plugin is currently OBS 30.1.2.

You still seem to be using OBS 27.
I think the last version of the advanced scene switcher supporting OBS 27 was 1.17.7.
I had installed OBS and this plugin through the Synaptic package manager. For some reason, it has OBS 27 as the latest version of the software, but it installed the version of the plugin for OBS 30.

I removed those versions and went ahead and installed from flatpak instead, so now the version incompatibility is resolved. Of course, now I've just moved on to another problem. OBS just hangs when trying to load the plugin. Here's the new log:

Code:
12:42:49.330: Using EGL/X11
12:42:49.352: CPU Name: AMD Ryzen 7 3700X 8-Core Processor
12:42:49.352: CPU Speed: 3600.000MHz
12:42:49.353: Physical Cores: 8, Logical Cores: 16
12:42:49.353: Physical Memory: 32035MB Total, 13597MB Free
12:42:49.353: Kernel Version: Linux 5.15.0-124-generic
12:42:49.353: Flatpak Branch: stable
12:42:49.353: Flatpak Arch: x86_64
12:42:49.353: Flatpak Runtime: runtime/org.kde.Platform/x86_64/6.6
12:42:49.353: App Extensions:
12:42:49.353:  - com.obsproject.Studio.Plugin.SceneSwitcher
12:42:49.353:  - com.obsproject.Studio.Locale
12:42:49.353: Runtime Extensions:
12:42:49.353:  - org.freedesktop.Platform.GL.default
12:42:49.353:  - org.freedesktop.Platform.GL.nvidia-535-183-01
12:42:49.353:  - org.freedesktop.Platform.openh264
12:42:49.353:  - org.gtk.Gtk3theme.Mint-Y-Dark-Aqua
12:42:49.353:  - org.gtk.Gtk3theme.Mint-Y-Dark-Teal
12:42:49.353:  - org.kde.Platform.Locale
12:42:49.353:  - org.freedesktop.Platform.GL.default
12:42:49.353: Flatpak Framework Version: 1.12.7
12:42:49.353: Desktop Environment: X-Cinnamon (cinnamon)
12:42:49.353: Session Type: x11
12:42:49.353: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
12:42:49.354: Qt Version: 6.6.3 (runtime), 6.6.3 (compiled)
12:42:49.354: Portable mode: false
12:42:49.399: OBS 30.2.3 (linux)
12:42:49.399: ---------------------------------
12:42:49.409: ---------------------------------
12:42:49.409: audio settings reset:
12:42:49.409:     samples per sec: 48000
12:42:49.409:     speakers:        2
12:42:49.409:     max buffering:   960 milliseconds
12:42:49.409:     buffering type:  dynamically increasing
12:42:49.410: ---------------------------------
12:42:49.410: Initializing OpenGL...
12:42:49.482: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
12:42:49.482: OpenGL loaded successfully, version 3.3.0 NVIDIA 535.183.01, shading language 3.30 NVIDIA via Cg compiler
12:42:49.507: ---------------------------------
12:42:49.507: video settings reset:
12:42:49.507:     base resolution:   2560x1440
12:42:49.507:     output resolution: 1920x1080
12:42:49.507:     downscale filter:  Bicubic
12:42:49.507:     fps:               60/1
12:42:49.507:     format:            NV12
12:42:49.507:     YUV mode:          Rec. 709/Partial
12:42:49.507: NV12 texture support enabled
12:42:49.507: P010 texture support not available
12:42:49.507: Audio monitoring device:
12:42:49.507:     name: Default
12:42:49.507:     id: default
12:42:49.507: ---------------------------------
12:42:49.527: No AJA devices found, skipping loading AJA UI plugin
12:42:49.527: Failed to initialize module 'aja-output-ui.so'
12:42:49.545: No AJA devices found, skipping loading AJA plugin
12:42:49.545: Failed to initialize module 'aja.so'
12:42:49.723: [pipewire] No capture sources available
12:42:49.767: [obs-browser]: Version 2.23.6
12:42:49.767: [obs-browser]: CEF Version 103.0.5060.134 (runtime), 103.0.0-5060-shared-textures.2594+g17f8588+chromium-103.0.5060.134 (compiled)
12:42:49.780: NVENC supported
12:42:49.780: VAAPI: Failed to initialize display in vaapi_device_h264_supported
12:42:49.780: FFmpeg VAAPI H264 encoding not supported
12:42:49.780: VAAPI: Failed to initialize display in vaapi_device_av1_supported
12:42:49.781: FFmpeg VAAPI AV1 encoding not supported
12:42:49.781: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
12:42:49.781: FFmpeg VAAPI HEVC encoding not supported
12:42:49.860: [obs-websocket] [obs_module_load] you can haz websockets (Version: 5.5.2 | RPC Version: 1)
12:42:49.860: [obs-websocket] [obs_module_load] Qt version (compile-time): 6.6.3 | Qt version (run-time): 6.6.3
12:42:49.860: [obs-websocket] [obs_module_load] Linked ASIO Version: 103002
12:42:49.864: [obs-websocket] [obs_module_load] Module loaded.
12:42:49.923: [adv-ss] version: 1.28.0
12:42:49.923: [adv-ss] version: 0ee6feb529930e0bc6458bd8b58ec983ea9d3d9b
12:42:49.924: [adv-ss] attempting to load "/app/plugins/lib/obs-plugins/advanced-scene-switcher-plugins/advanced-scene-switcher-base.so"
12:42:49.927: [adv-ss] successfully loaded "/app/plugins/lib/obs-plugins/advanced-scene-switcher-plugins/advanced-scene-switcher-base.so"
12:42:49.927: [adv-ss] attempting to load "/app/plugins/lib/obs-plugins/advanced-scene-switcher-plugins/advanced-scene-switcher-opencv.so"
12:42:49.937: [adv-ss] successfully loaded "/app/plugins/lib/obs-plugins/advanced-scene-switcher-plugins/advanced-scene-switcher-opencv.so"
12:42:49.937: [adv-ss] attempting to load "/app/plugins/lib/obs-plugins/advanced-scene-switcher-plugins/advanced-scene-switcher-midi.so"

Once it gets to this line, the process just freezes and the UI never appears.

Be aware that if you decide to update OBS, the change from v27 to v28 not only breaks pretty much all of the plugins, but also wipes out their settings even if you downgrade back!
  • Some of their functions became native, so you don't need the old plugin anymore. The WebSocket server is one of those.
  • Some died because they were already abandoned but still continued to work until then.
  • Some, like this one, were rebuilt for the change and thus continue to work.
There is a way to upgrade without losing settings - essentially upgrade both OBS and all the plugins before trying to run it at all, and hope that you did it all right - but it's much more straightforward to document all of what you have, let it wipe out, and then rebuild it from your documentation.

It's generally recommended to keep things up to date, but do be aware of that version in particular!
I thankfully don't need to worry about this, because I didn't have an install of OBS before I started trying to set this up.
 

Sambo3975

New Member
I was able to get OBS to launch by manually deleting the advanced-scene-switcher-midi.so from the folder. I figure it's for reacting to inputs from a MIDI controller, which I don't need. Still, I'd like to have a solution to this so I don't have to navigate through the rather human-unfriendly directory structure used by Flatpak to manually delete a file every time the plugin is updated.
 

AaronD

Active Member
I had installed OBS and this plugin through the Synaptic package manager. For some reason, it has OBS 27 as the latest version of the software, but it installed the version of the plugin for OBS 30.

I removed those versions and went ahead and installed from flatpak instead, so now the version incompatibility is resolved. Of course, now I've just moved on to another problem...
...navigate through the rather human-unfriendly directory structure used by Flatpak to manually delete a file every time the plugin is updated.
I really don't like Flatpak, or any other container, for OBS. The entire purpose of a container (secure, private sandboxing; universal self-contained compatibility; etc.) runs counter to what OBS needs to really work well (direct access to good hardware, efficient execution, etc.). It might be the only way to make it work reliably on some distros, but if that's the case, you should probably look at switching distros, even if you end up multi-booting just for OBS. Always run OBS natively if you possibly can.

I believe Mint is based on Debian, right? If so, then I think the official PPA should work:
sudo apt-add-repository ppa:obsproject/obs-studio
Then a normal sudo apt update && sudo apt upgrade should get the actual latest version with all the features.
Or if you've removed the native version, sudo apt update && sudo apt install obs-studio will finally get the right one.
 

AaronD

Active Member
...I didn't have an install of OBS before I started trying to set this up.
If this is a fresh OS install with nothing else set up either, then you might look at Ubuntu Studio instead:
It's designed specifically for media production, with a low-latency kernel by default and a TON of apps preinstalled and already working! OBS is one of them, albeit an old version. But once you install the PPA and do a normal update/upgrade, you'll have the right version, native, and you can build from there.
 

Warmuptill

Active Member
Hi,

Hotkeys for macros has stopped working for me, and I have no idea why.

I have macros for managing whether sources are enabled in scenes, and have them linked to hotkeys. It was all working fine until about a week ago, when now they don't.

The macros still work - I can run them manually. Hotkeys still work, e.g. for doing transitions. There are no conflicting hotkeys. I've removed and reassigned the hotkeys, and tried using other hotkeys. No upgrade have been done (at least not intentionally). I've restarted OBS and the computer. I've switched profiles.

I haven't yet looked at logs. I only just thought of that, and the computer is not with me.

Anything else I can try next time I am at the computer?

Thanks @Warmuptill for a great plugin.
I think providing an OBS log with verbose logging enabled will have the best chance at providing a hint as to what the problem might be.
 

RobertWilliams

New Member
Does anybody know what the "Save Time remaining" under Timer conditions does?
1731458491498.png
 

MrGhost

Member
Yesterday I destroyed my long un-updated Win 10 OS so that it can't boot, and all I have is the drive with all its folders and files and program files and appdata etc.

Because the computer was mostly only used for OBS my primary need is to just put back OBS, Streamdeck, Bitfocus & Advance Scene Switcher. However I am going to do full updates including Windows 11 whcih I have already installed, and OBS which is on 30.1.2, which is also what the old installed OBS was (kept that more updated than Windows!).

I think I can manage the OBS by just installing the OBS folders in Program files and AppData, and so far I have not attempted the Bitfocus and Streamdeck restoring. I don't know if I had backed them up very recently though some time about a year ago maybe. I probably made quite a lot of buttons in those two that I want to get back.

But because the most difficult part of my OBS is this plugin I have the most backups and probably could just restore one of those. However if there is a Macro or two especially in the ever changing scenes area it may not be the most up to date backup.

Is there a good way to just replace the new OBS folders with the originals from the dead Windows OS which are still exactly as they would be? Which folders contain the Advanced Scene Switcher configuration?

Anyone with info on Streamdeck and Bitfocus Companion locations, that could also be a big help. I am not finding tons of info on Bitfocus Companion backup locations online. I figure I look first in Program Files and then in AppData local and roaming. But if there is anything else you may know about I could always use some location information.

And 1 more thing, I am just going to probably update everything and if anyone has any advice and tips on any potential pitfalls due to any known changes particularly with the MIDI macros (which where new when I installed this plugin) or timer macro plugins updating this here plugin from the version I had been using which I installed over a year ago (the plugin version I had not updated in over a year) it would be ever so helpful.

Thanks.
 
Last edited:

Warmuptill

Active Member
Does anybody know what the "Save Time remaining" under Timer conditions does? View attachment 109221
It will save the "Time remaining" value, so that when you restart OBS / switched scene collections the timer will continue at the place it left off at instead of restarting from the beginning.

But because the most difficult part of my OBS is this plugin I have the most backups and probably could just restore one of those. However if there is a Macro or two especially in the ever changing scenes area it may not be the most up to date backup.

Is there a good way to just replace the new OBS folders with the originals from the dead Windows OS which are still exactly as they would be? Which folders contain the Advanced Scene Switcher configuration?
The settings of the advanced scene switcher are stored as part of the scene collection data of OBS.
So all the settings are stored in these json files in this directory:
C:\Users\<your user name>\AppData\Roaming\obs-studio\basic\scenes\...

You can import your old scene collections in OBS via "Scene Collection" -> "Import".

So everything should be there still.

And 1 more thing, I am just going to probably update everything and if anyone has any advice and tips on any potential pitfalls due to any known changes particularly with the MIDI macros (which where new when I installed this plugin) or timer macro plugins updating this here plugin from the version I had been using which I installed over a year ago (the plugin version I had not updated in over a year) it would be ever so helpful.
Newer versions of the advanced scene switcher plugin should be backwards compatible with the older settings file.
I don't expect any issues.
I can't really comment if that is true for all the other plugins you had used previously.

If you should run into any issues with getting the advanced scene switcher to work / import the old settings do not hesitate to ask and I will try to assist you.
 

jimpalompa

New Member
Thanks for such a great and essential plug-in. My question:

Are there any way to change Window Capture source setting on macOS with the plugin? Can't get it to work, probably since macOS are kinda different to Windows OS. Scenario:

I have a Source, macOS Screen Capture, using method Window Capture. I have a If statement looking for the Window title ABC (which works).

However, I want to update my Source setting to match the ABC window. But since the Source setting for Window Capture method uses what I understand to be the window ID, instead of window name or process name, it seems to be impossible to automate this.

Thanks again, cheers
 

MrGhost

Member
If you should run into any issues with getting the advanced scene switcher to work / import the old settings do not hesitate to ask and I will try to assist you.
After doing it I do have a thing or two of note you might want to note:

I was able to get it to use the old .json file, only after I added the prefix it expects from backups. Once i added the Adv ss prefix it loaded that backup.

I was using a new install of Windows 11 so all my Macros off of Windows 10 had the wrong User folder name because of Windows' new Truncated User Folder naming protocol.

When I made a new folder in USERS named my old name, I had to change the permissions to allow the new user full control of the TXT files I use for Chatlog sources that change and get written to by my Macros.

Maybe you could put something in the macros that could identify when an item is in the User folder and give it the string variable for the USER folder who is using the computer. These files tend to get made inside the macros...so well you know? For sure the screenshots in the machine learning get made in the User folder. I can't really remember where the TXT files were generated from but they may be auto located by the macros or the directory may be the default. You may want to put the string value in when people select that directory.

Another thing that has changed in my system is the MIDI device name. It takes the whole name, so it is my fault changing my name but I wanted to update my name to differentiate in case there would someday be confusion between the two eras which have a common root name I added the 24 at the end of the new name. So what happens is all the MIDI devices take on both the new computer name and also they appear to be directed to a different MIDI instance, Network Midi 11, rather than Network Midi 8 which the old scene switcher had. This opens up this way after restoring the backup .json file. Of course all I had to do was reassign the network midi to group with 11 instead of 8 on the other computer, but if this was a single computer setup I don't know if it would be so easy and I might have to go thru and find every MIDI device instance and change them all individually which could be pretty hard to do as I have something between 2 and 300 Macros.

Another thing which I wanted you could call it a feature, which is still the same as it was in 2023, is the Advanced Scene Switcher won't open as the same size I had dragged the center line to and edges, so it won't keep its size I set. I have long macro names such as MIDIChatLogCC32 and MIDIChatLogforCC32Amount and things, so I always have to drag that center line. Is there no way to make the window open the same size and settings as it was when I closed it?

Other than these 3 notes, I say thanks for the help I got it all setup and it works good enough now!
 

Warmuptill

Active Member
Thanks for such a great and essential plug-in. My question:

Are there any way to change Window Capture source setting on macOS with the plugin? Can't get it to work, probably since macOS are kinda different to Windows OS. Scenario:

I have a Source, macOS Screen Capture, using method Window Capture. I have a If statement looking for the Window title ABC (which works).

However, I want to update my Source setting to match the ABC window. But since the Source setting for Window Capture method uses what I understand to be the window ID, instead of window name or process name, it seems to be impossible to automate this.

Thanks again, cheers
I will try to look into it, when I find the time to.

Another thing which I wanted you could call it a feature, which is still the same as it was in 2023, is the Advanced Scene Switcher won't open as the same size I had dragged the center line to and edges, so it won't keep its size I set. I have long macro names such as MIDIChatLogCC32 and MIDIChatLogforCC32Amount and things, so I always have to drag that center line. Is there no way to make the window open the same size and settings as it was when I closed it?
You will have to check this box on the General tab to enable saving of the window position, size, and the splitter positions.
1731702478781.png

I am glad to hear that everything is working! :)
 

AaronD

Active Member
Thanks for such a great and essential plug-in. My question:

Are there any way to change Window Capture source setting on macOS with the plugin? Can't get it to work, probably since macOS are kinda different to Windows OS. Scenario:

I have a Source, macOS Screen Capture, using method Window Capture. I have a If statement looking for the Window title ABC (which works).

However, I want to update my Source setting to match the ABC window. But since the Source setting for Window Capture method uses what I understand to be the window ID, instead of window name or process name, it seems to be impossible to automate this.

Thanks again, cheers
I will try to look into it, when I find the time to.
You got me thinking. I have a similar problem (or at least it seems the same at first glance), but I didn't think it was all that bad to fix it up manually. It would still be nice to automate it though, if it could be reliable enough to not think about.

Anyway, on Linux, OBS's Window Capture seems to want the exact title that it had last time. If that exact title doesn't exist, it doesn't connect to anything until it does, and then it grabs that.

It would be nice to automate a different title for the Window Capture to look for, from the same shell script that gives a different URL to the external web browser that it needs to capture.

Easiest for the script would be to add a command line flag to OBS's main executable, but I can understand if that's not possible. Alternately, Adv. SS could get it from a file that the script creates or replaces before starting OBS.

I thought briefly about using the name of the Profile or Scene Collection, but:
  • That case can simply be hard-coded, since the Window Capture is part of the Collection.
  • I don't actually change the Scene Collection, or the Profile. It's generic enough to work for everything, with not much going on in the first place, and I maintain it that way.
 

lcalder

Member
Thank you — will give it a go very soon!
@Warmuptill: Thanks for this amazing enhancement (zoom-to-mouse-advss.lua). I don't know if you should post this as a new lua script as it needs AdvancedSS to work, but I know many people will love this.
I noticed that the two example macros you created worked very well except the decrease zoom was incrementing instead of decrementing as you copied it from the increment zoom and forgot that. I just mention it so that others can fix this easily by changing "increment" to "decrement" for the variable part of the macro.
I also created a copy of the macro and named it "Set Default Zoom" where the variable is set to a fixed value of 2.00, which others might find useful to do.
Thanks again for your powerful contributions!
 

RobertWilliams

New Member
Using 12.8.1.

In this version I noticed that when doing a Video/matches pattern condition and a "perform check only in area" setting is specified, the create screenshot --> " Highlight the area of the screenshot you want to keep" window ignores the "only in area " specified and gives you the entire scene/source. I appreciate the enhancement to 12.8.1 to select a subset of the selected area but I think it makes sense to only show part of the scene/source specified "perform check only in area" in the window to select the area to screenshot.
 

Warmuptill

Active Member
@Warmuptill: Thanks for this amazing enhancement (zoom-to-mouse-advss.lua). I don't know if you should post this as a new lua script as it needs AdvancedSS to work, but I know many people will love this.
I noticed that the two example macros you created worked very well except the decrease zoom was incrementing instead of decrementing as you copied it from the increment zoom and forgot that. I just mention it so that others can fix this easily by changing "increment" to "decrement" for the variable part of the macro.
I also created a copy of the macro and named it "Set Default Zoom" where the variable is set to a fixed value of 2.00, which others might find useful to do.
Thanks again for your powerful contributions!
Glad I could be of help!

I think it would probably make the most sense for the original script to be updated and implement the hotkeys for zooming out /in / resetting the zoom level there.

Using 12.8.1.

In this version I noticed that when doing a Video/matches pattern condition and a "perform check only in area" setting is specified, the create screenshot --> " Highlight the area of the screenshot you want to keep" window ignores the "only in area " specified and gives you the entire scene/source. I appreciate the enhancement to 12.8.1 to select a subset of the selected area but I think it makes sense to only show part of the scene/source specified "perform check only in area" in the window to select the area to screenshot.
Agreed.
A build where the behavior is changed accordingly will be available here in a few minutes on GitHub:
(As per usual you will have to be logged into GitHub to be able to download it - if that should be a problem let me know)
 
Top