Advanced Scene Switcher

Advanced Scene Switcher 1.37.2

Hi everybody, first time here.

I have a simple task I want triggered by a stream deck and I’m having trouble figuring out how. Here’s what I’m after:

I have 3 cameras (let’s call them C1, C2 & C3) and, with the press of a button, would like to trigger them to cycle in a certain order with a set interval. I'd then like this sequence cancelled when I manually select a scene.

Button 1 - C1-C2-C3 repeat
Button 2 - C1-C3 repeat
Button 3 - C1-C2 repeat
Button 4 - C2-C3 repeat

I have the scene group tabs set in ACS and was hoping to just have a hotkey to just play a group until I manually switch scene again.

I’ve really spent too much time trying to work this out so thought I’d see if there’s a solution anybody knows of?

I even faffed about with getting streamer.bot on my Mac…

Thanks in advance



Adam
 
Hi everybody, first time here.

I have a simple task I want triggered by a stream deck and I’m having trouble figuring out how. Here’s what I’m after:

I have 3 cameras (let’s call them C1, C2 & C3) and, with the press of a button, would like to trigger them to cycle in a certain order with a set interval. I'd then like this sequence cancelled when I manually select a scene.

Button 1 - C1-C2-C3 repeat
Button 2 - C1-C3 repeat
Button 3 - C1-C2 repeat
Button 4 - C2-C3 repeat

I have the scene group tabs set in ACS and was hoping to just have a hotkey to just play a group until I manually switch scene again.

I’ve really spent too much time trying to work this out so thought I’d see if there’s a solution anybody knows of?

I even faffed about with getting streamer.bot on my Mac…

Thanks in advance



Adam
There are probably more ways to do this, but I can see two at the moment:

---

Set up each of the 4 sequences separately and independently, with each macro creating the condition that the next one looks for. So far, they'll fight each other, but you'll add a condition later that makes them play nice:
  • Sequence 1.1
    • Conditions:
      • C1 active for A1 seconds
    • Actions:
      • Switch to C2
  • Sequence 1.2
    • Conditions:
      • C2 active for B1 seconds
    • Actions:
      • Switch to C3
  • Sequence 1.3
    • Conditions:
      • C3 active for C1 seconds
    • Actions:
      • Switch to C1

  • Sequence 2.1
    • Conditions:
      • C1 active for A2 seconds
    • Actions:
      • Switch to C3
  • Sequence 2.2
    • Conditions:
      • C3 active for B2 seconds
    • Actions:
      • Switch to C1
Etc.
And likewise for all the other sequences you want, completely separate from each other, and ignoring for the moment that the others exist. Then to keep them from fighting each other, add a variable condition to each one (I've called it Selection here, but you can call it anything):
  • Sequence 1.1
    • Conditions:
      • Selection equals 1
        AND
        C1 active for A1 seconds
    • Actions:
      • Switch to C2
Etc.
Do that for all of them, with the appropriate value for Selection, and then each sequence only works when Selection equals that value.

Now, add one more set of macros to set the Selection:
  • Control 1
    • Conditions:
      • Button 1
    • Actions:
      • Set Selection = 1
  • Control 2
    • Conditions:
      • Button 2
    • Actions:
      • Set Selection = 2
Etc.
That's a lot of macros, but they're all short and simple, so it shouldn't be too bad to think through and see what it's all doing.

This way allows you to have complete customizability, with separate times and orders for each one. You may also have to "kick start" the sequence by explicitly switching to something that's included in it. Otherwise it'll just sit there and not do anything.

---

Have a macro for each scene that has no conditions and only switches to that scene:
  • C1
    • Conditions:
    • Actions:
      • Switch to C1
Etc.
And then a macro for each sequence that has a Sequence action in it. In each of those Sequence actions, add the appropriate switching macros to do what you want, and maybe a Timer condition to have it fire periodically:
  • Sequence 1
    • Conditions:
      • Every A seconds
    • Actions:
      • Sequence:
        • C1
        • C2
        • C3
  • Sequence 2
    • Conditions:
      • Every B seconds
    • Actions:
      • Sequence:
        • C1
        • C3
Etc.
And then to keep *those* from running over each other, you can add the variable as before, and its controlling macros:
Every A seconds:
  • Sequence 1
    • Conditions:
      • Selection equals 1
        AND
        Every A seconds
    • Actions:
      • Sequence:
        • C1
        • C2
        • C3
Etc.
  • Control 1
    • Conditions:
      • Button 1
    • Actions:
      • Set Selection = 1
  • Control 2
    • Conditions:
      • Button 2
    • Actions:
      • Set Selection = 2
Etc.

---

Personally, I like the first one better, but both should work.
 
Last edited:
Thanks Aaron!

I just started following this but think I'll try in the morning!

I'm just curious though: How can you utilise scenes groups? I was imaging I could just make scene groups and have a macro saying 'when button A is pressed - trigger scene group A'.

Anyway thanks for the reply, I'll do this on fresh eyes tomorrow.

Adam
 
I'm just curious though: How can you utilise scenes groups? I was imaging I could just make scene groups and have a macro saying 'when button A is pressed - trigger scene group A'.
It's possible that I've missed something obvious, but I don't remember seeing that. Where are you looking?

A bit of googling turns up a feature request from 2020, to be able to group scenes in the same way as you can with sources, but to my knowledge, that still hasn't happened. OBS 30.2.3 on Ubuntu Studio 22.04 LTS doesn't, which is what I use. (going to rebuild it on 24.04 LTS soon, but haven't yet)

For my more complex rigs, I have a naming convention that sorta gets me partway there, and I manually order them to make a folder structure of sorts with those names...but the naming convention is really to have something that Adv. SS can match and send the appropriate control messages all over the place to automate the rest of the rig. The organization is just a welcome side-effect of that.
 
Hi, I'm still wondering how to make it work on the latest OBS build (portable version). It works flawless on the normal version but I feel the need to use it on portable version as well, what's the workaround for that?
I've the latest version of plugin.
 
i know ADVSS has OCR .....but is therer a way to perform an action if the number on the selected area is bigger than or less than
that would be pretty cool for sports/gaming/finance very cool actually
 
i know ADVSS has OCR .....but is therer a way to perform an action if the number on the selected area is bigger than or less than
that would be pretty cool for sports/gaming/finance very cool actually
You can perform anything that the Variable condition can perform. Just use Variable Set to macro property action with the OCR text first.
 
First off, so grateful for this plugin and its immense capability! I feel like I'm only scratching the surface and I love getting to explore new use cases and all the functionality!

I was wondering if there's a straightforward way to have a dock or panel of buttons to run Macros? I know I could do this using hotkeys, but I'd prefer to have an intuitive interface so operators can easily click on manually run macros, without having to open the settings of the Advanced Scene Switcher. The thought/desire is something functionally exactly like the "Run Macro" in that settings page, but available for multiple Macros right next to each other and dockable in OBS Studio.
 
First off, so grateful for this plugin and its immense capability! I feel like I'm only scratching the surface and I love getting to explore new use cases and all the functionality!

I was wondering if there's a straightforward way to have a dock or panel of buttons to run Macros? I know I could do this using hotkeys, but I'd prefer to have an intuitive interface so operators can easily click on manually run macros, without having to open the settings of the Advanced Scene Switcher. The thought/desire is something functionally exactly like the "Run Macro" in that settings page, but available for multiple Macros right next to each other and dockable in OBS Studio.

Are you speaking of macro buttons triggered buy hotkey strokes, but _look_ like buttons, or also can be triggered with a mouse click?
 
First off, so grateful for this plugin and its immense capability! I feel like I'm only scratching the surface and I love getting to explore new use cases and all the functionality!

I was wondering if there's a straightforward way to have a dock or panel of buttons to run Macros? I know I could do this using hotkeys, but I'd prefer to have an intuitive interface so operators can easily click on manually run macros, without having to open the settings of the Advanced Scene Switcher. The thought/desire is something functionally exactly like the "Run Macro" in that settings page, but available for multiple Macros right next to each other and dockable in OBS Studio.
You can register docks for macros in the advanced settings of each macro.
The docks will allow you to manually run the macro.
You can find an example how to access those additional settings here:
 
You can register docks for macros in the advanced settings of each macro.
The docks will allow you to manually run the macro.
You can find an example how to access those additional settings here:
Perfect, this is exactly what I was looking for. Thank you so much!
 
I want a macro, when run, to detect if the current program scene is "Camera 2" and if it is, set preview scene to "Camera 1"
But no matter what I set the "IF" condition to be, it always detects the current scene to be "Camera 2". Am I programming this wrong?

1738942732044.png
 
I want a macro, when run, to detect if the current program scene is "Camera 2" and if it is, set preview scene to "Camera 1"
But no matter what I set the "IF" condition to be, it always detects the current scene to be "Camera 2". Am I programming this wrong?

View attachment 111231
This macro as shown will spam the logfile with one or the other message. Is that how you're getting the "always detected" claim?

Better would be to remove the Log actions - keep the logfile clean except for things that really do need to be communicated *later* - and turn on the highlighting instead. Gear icon in the top right, then a few checkboxes. That lets you see what it's doing, right now in the moment.
 
I made some progress on how to correctly send commands triggered by an HTML onclick, from Javascript directly to OBS that is using Websocket (I am on OBS 20.2.3, Windows, btw).

Javascript command works to send the hotkey of "Ctrl + Num1":

obs.call('TriggerHotkeyByKeySequence', {"keyId": "OBS_KEY_NUM1", "keyModifiers": {"control": true}});

And here is a full test script I used to get to a "working solution" for me:

HTML:
<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src='js/obs-ws.min.js'></script>
</head>
<body>
     <button onclick="triggerButton()">Click Me!</button>
<script>

    function triggerButton() {     
        const obs = new OBSWebSocket();
            async function connectToOBS() {
                try {
                    const { obsWebSocketVersion, negotiatedRpcVersion } = await obs.connect('ws://127.0.0.1:4455', '', {
                      rpcVersion: 1
                    });
                        console.log(`Connected to OBS Studio version ${obsWebSocketVersion} using RPC version ${negotiatedRpcVersion}`);

                            obs.call('TriggerHotkeyByKeySequence', {"keyId": "OBS_KEY_NUM1", "keyModifiers": {"control": true}});

                    } catch (error) {
                    console.error('Failed to connect to OBS Studio:', error.message);
                }
            }
        connectToOBS();
    }

</script>
</body>
</html>
 
My first thought is to use a variable to keep track of that count. Three macros:
  1. Time for next video (however you detect that):
    • No actions, just this one condition
  2. Macro #1 Condition AND Count != 0:
    • Play next video, AND
    • Decrement Count
  3. Macro #1 Condition AND Count == 0:
    • Play trailer, AND
    • Set Count = 3
You could put the "Time for next video" condition in the other two, and save a macro, but this allows you to change it once (if/when it does need changed), and have both of the working macros follow that change.

Also note, that this relies on Adv. SS effectively auto-DJ'ing single videos. Not a playlist that runs itself. It may still be possible to interject something in the middle of a self-running playlist, but it gets to be a mess in a hurry if you have multiple sources of automation like that. They often end up fighting each other, or getting confused because one did something that the other didn't expect, etc.

I see Adv. SS as a programming language, and I'm pretty well convinced that it's Turing Complete, which means that it can do anything that any computing machine can do, including simulating any other machine perfectly (ignoring time and memory requirements). So if you're asking if something is *possible*, then the answer is always yes, given the proper access to things. It's just a matter of how...
adv. scene switcher can djing single videos?

My solution is atm, a VLC Playlist. The Playlist is created, every time you save the config. I tested a little bit, and I use the End status with a counter. after every video is finished, ended can trigger something. so the playlist is just paused, when the scene is switched to "commercial/trailer" or so.
 
any thoughts on how to trigger the refresh browser source cache button automatically on a specific browser source prior to running through the rest of the list?
 
[EN] Hello, I wanted some help creating a macro. one that activates and deactivates the one source based on whether the first Friday of the current month.
[ES] Buenas, quería algo de ayuda para crear una macro. una que active y desactive la una fuente en base a si el primer viernes del mes actual.

something like that / algo así:

If today.dayOfWeek = friday and today.dayOfMonth <=7
then image01.visibility = true
else image01.visibility = false

With the part about if it's Friday there is no problem, the advanced switcher gives it to me for free, but I don't know how to do the other check /
con la parte de si es viernes no hay problema, el advanced switcher me lo da gratis, pero con se como hacer la otra comprobación

sorry for the syntax, I really don't know much about programming/
perdón por la sintaxis, realmente no sé mucho de programación.
 
adv. scene switcher can djing single videos?
Each video by itself in a scene, as the only source in that scene. Then switch scenes as desired to show the videos:
  • If Any Media on Current Scene is Playing and Time Remaining shorter than X
    • Switch to Random Scene with Transition length X
That gives a nice transition from one to the next while both are playing.

Or a series of:
  • If Any Media on Scene A is Playing and Time Remaining shorter than AB
    • Switch to Scene B with Transition length AB

My solution is atm, a VLC Playlist. The Playlist is created, every time you save the config. I tested a little bit, and I use the End status with a counter. after every video is finished, ended can trigger something. so the playlist is just paused, when the scene is switched to "commercial/trailer" or so.
Glad you got something to work.
 
Back
Top