Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

petjo10

Member
You can do that
1635474136330.png

i use these macro and if i have many sources i also use the lua source toggler
 

AaronD

Active Member
But it would be easier with one macro..i have many scenes and sources

A lot of things would be easier if it were designed specifically for them. But this is a general purpose thing. So there will always be some applications that don't really match up with how it works. Be proud of yourself for understanding how it does work, and using that to make it do what you need anyway.

That said, a checkbox to effectively create the reverse condition and action behind the scenes, might also be useful in a lot of cases beyond just that one...and probably hard to make in a general sense, because some actions don't really have a clear "undo" from the software's perspective.

"Undo" is one of those things that appear trivial to a user, but are nearly impossible to actually make happen. I've been there; I know! You need to design it in from the beginning, so that every action also saves the specific data that is required to undo it (when you as a developer still know what that data is!); or periodically save the entire state of everything so that you can restore one of those snapshots. The former requires a fair amount of explicit logic added to EVERYTHING; the latter requires a ton of memory. Either way, it still may not work right because certain things need to be set up again, and that setup has side-effects too.

In your specific case, I think it would work - "show" and "hide" are opposite functions without side effects - but it might be impossible to cover *everything*. That'll make it confusing when some things work and some don't. (maybe hide the "auto-undo" checkbox for the non-trivial actions???)

---

Or to make it even more generally useful, maybe have two actions: one for the condition becoming true, as it is now, and one for the same condition becoming false. The false action defaults to "do nothing", and there could be a button to set it to the reverse of the true action. Visually disable that button when the reverse is non-trivial. By allowing the false action to be anything, independent from the true action, it could create a lot of interesting behaviors, some of which might actually be useful! :-)
 

GraksO

New Member
Is it possible to run a scene switch when clicking the Start Streaming button? I tried using the stream running check condition but whenever I switch a scene afterwards it just goes back to the original scene (awesome plugin by the way)
 

GraksO

New Member
Is it possible to run a scene switch when clicking the Start Streaming button? I tried using the stream running check condition but whenever I switch a scene afterwards it just goes back to the original scene (awesome plugin by the way)
I may have figured it out??? I clicked the little clock icon and added a time condition of at most 1 second and it doesn't seem to be an issue anymore, but still wondering if there's a better way to doing this.
 

Warmuptill

Active Member
I may have figured it out??? I clicked the little clock icon and added a time condition of at most 1 second and it doesn't seem to be an issue anymore, but still wondering if there's a better way to doing this.
Adding a time restriction is the solution I would have suggested. :)
So I don't think there is a better way implemented at the moment, but feel free to suggest how I could improve it!
 

GraksO

New Member
Adding a time restriction is the solution I would have suggested. :)
So I don't think there is a better way implemented at the moment, but feel free to suggest how I could improve it!

just took a quick look at the documentation OBS provide and found this:
1635605613250.png

maybe it's possible to incorporate these into the plugin as an event which is called whenever the button is pressed, which in turn could trigger the macro (I have no clue if I'm using the correct terminology and my extent of programming knowledge ain't much so I might be very wrong about this)
 

AaronD

Active Member
Is it possible to run a scene switch when clicking the Start Streaming button? I tried using the stream running check condition but whenever I switch a scene afterwards it just goes back to the original scene (awesome plugin by the way)

Another way to do it might be to have a macro that both starts the stream and switches the scene, based on some other trigger. Then you don't use the Start Streaming button, but do that other trigger instead.
 

Warmuptill

Active Member
just took a quick look at the documentation OBS provide and found this: View attachment 76601
maybe it's possible to incorporate these into the plugin as an event which is called whenever the button is pressed, which in turn could trigger the macro (I have no clue if I'm using the correct terminology and my extent of programming knowledge ain't much so I might be very wrong about this)
So what you are asking for is instead of a "stream running for 0 seconds" you basically want a dedicated condition type "stream started" that saves you entering the time restriction part?

If so I will add it to the todo list - should be rather easy to implement.

Btw. these functions are used to stop or start streaming.
OBS also offers "frontend events" like "OBS_FRONTEND_EVENT_STREAMING_STARTED" so you were pretty close :)

First, this is a great plugin...thanks to Warmuptill for all your work on it.

We use OBS Studio with this plugin for our church worship services. During long parts, we use the Sequence tab with hotkeys to enable/disable switching between our 3 cameras. Sometimes, it seems when we hit the hotkey to start/stop the auto sequence, it doesn't always work (but a second press of the key does). You won't know it is not running for 45 seconds, when the next camera is supposed to go live on the stream.

1) Is there an indicator on the screen, to let me know when the plugin is running? Example: I hit the hotkey to enable the sequence and the indicator turns on.

2) If not, does the plugin throw an event when it is enabled/disabled that I can catch in a script and make my own indicator?
I have implemented the option to display plugin state changes in the system tray.

SystemTray.PNG

SystemTray2.PNG


A build with this change will be available here in a few minutes:
Note that you have to be logged into GitHub to be able to download it.
 

wilderf353

Member
...
I have implemented the option to display plugin state changes in the system tray.

View attachment 76602
View attachment 76603

A build with this change will be available here in a few minutes:
Note that you have to be logged into GitHub to be able to download it.

Great. I have downloaded it and tried it out. It works great on my home desktop. I will install it at church tomorrow too. Thanks again for doing this.
 

joshdreber

New Member
Hi all, I have another issue I'm hoping to get input on.

I want to be able to make OBS change the active scene automatically when an OpenLP slide is changed.

I have the advanced scene switcher plugin running, with various scenes and cameras running through a sequence based on time. For instance:
scene 1 is a ptz camera input for our pastor.
Scene 2 is a split input with that camera and a openlp browser input for slides.

The scene switcher runs automatically, 3 mins on pastor only and 1 min on pastor/slides. I want to have the switcher be interrupted and switch to scene 2 when a slide is changed in openlp, if OBS is currently on a scene with just the pastor.

Any thoughts on this or if its even been done? I've got the openlp custom browser dock switching slides from obs -> openlp, but I want it the other direction. The browser input scene works fine for showing slides.

Is there a way for OBS or the advanced scene switcher plugin to detect a slide/input change through the browser, and trigger a change of active scene to one with slides?

Essentially I'd like to eliminate having someone man the OBS machine and have it all automated based on what the openlp man is doing.

Thanks!
 

AaronD

Active Member
Hi all, I have another issue I'm hoping to get input on.

I want to be able to make OBS change the active scene automatically when an OpenLP slide is changed.

I have the advanced scene switcher plugin running, with various scenes and cameras running through a sequence based on time. For instance:
scene 1 is a ptz camera input for our pastor.
Scene 2 is a split input with that camera and a openlp browser input for slides.

The scene switcher runs automatically, 3 mins on pastor only and 1 min on pastor/slides. I want to have the switcher be interrupted and switch to scene 2 when a slide is changed in openlp, if OBS is currently on a scene with just the pastor.

Any thoughts on this or if its even been done? I've got the openlp custom browser dock switching slides from obs -> openlp, but I want it the other direction. The browser input scene works fine for showing slides.

Is there a way for OBS or the advanced scene switcher plugin to detect a slide/input change through the browser, and trigger a change of active scene to one with slides?

Essentially I'd like to eliminate having someone man the OBS machine and have it all automated based on what the openlp man is doing.

Thanks!

So, when a source changes, switch to a scene? I believe that's been discussed here before. Something about a DIY security system, I think, with OBS auto-switching to a camera with motion and recording the result? And needing a sensitivity setting so that leaves and vermin wouldn't trigger it. I'm sure a slide change would be more than enough.

I also remember something about needing the source to be rendered somewhere for it to work. A minimized projector from OBS is enough, but the source alone isn't. I'm not sure how these two points work together, so I might have some things confused.
(or maybe they didn't work together, and that was the discussion?)
 

AaronD

Active Member
The scene switcher runs automatically, 3 mins on pastor only and 1 min on pastor/slides. I want to have the switcher be interrupted and switch to scene 2 when a slide is changed in openlp, if OBS is currently on a scene with just the pastor.

If I might suggest something, I think it would work better as a finished product, to have a scene that has the slide overlaid over a corner of the camera. "Picture in Picture", to use some old terminology. Switch to the full-screen slide when it changes, stay there long enough for people to read it, then go to the PiP scene to keep a reminder of what it was, and stay there indefinitely. Don't time-out from the PiP scene. If the slide goes blank, take it away instead. (switch to a scene that only has the camera)

It might take some trial-and-error to make that work, but I'm sure the logic is possible with the current tools, assuming that the source-change-detector works.
 

Warmuptill

Active Member
Hi all, I have another issue I'm hoping to get input on.

I want to be able to make OBS change the active scene automatically when an OpenLP slide is changed.

I have the advanced scene switcher plugin running, with various scenes and cameras running through a sequence based on time. For instance:
scene 1 is a ptz camera input for our pastor.
Scene 2 is a split input with that camera and a openlp browser input for slides.

The scene switcher runs automatically, 3 mins on pastor only and 1 min on pastor/slides. I want to have the switcher be interrupted and switch to scene 2 when a slide is changed in openlp, if OBS is currently on a scene with just the pastor.

Any thoughts on this or if its even been done? I've got the openlp custom browser dock switching slides from obs -> openlp, but I want it the other direction. The browser input scene works fine for showing slides.

Is there a way for OBS or the advanced scene switcher plugin to detect a slide/input change through the browser, and trigger a change of active scene to one with slides?

Essentially I'd like to eliminate having someone man the OBS machine and have it all automated based on what the openlp man is doing.

Thanks!
>Is there a way for OBS or the advanced scene switcher plugin to detect a slide/input change through the browser, and trigger a change of active scene to one with slides?

You can try using a macro similar to this one:

OutputChanged.PNG


But as mentioned by @AaronD you need to be sure that the source output is being rendered.
Otherwise the scene switcher cannot notice that the output would have changed.
If your particular source is not part of every scene in your scene sequence and thus not always being renedered you can open a "windowed projector" of the source to work around this issue.

Projector.png


> I want to have the switcher be interrupted
Make sure to mark your scene sequence to be interruptible by clicking the corresponding checkbox.
 

joshdreber

New Member
>Is there a way for OBS or the advanced scene switcher plugin to detect a slide/input change through the browser, and trigger a change of active scene to one with slides?

You can try using a macro similar to this one:

View attachment 76618

But as mentioned by @AaronD you need to be sure that the source output is being rendered.
Otherwise the scene switcher cannot notice that the output would have changed.
If your particular source is not part of every scene in your scene sequence and thus not always being renedered you can open a "windowed projector" of the source to work around this issue.

View attachment 76619

> I want to have the switcher be interrupted
Make sure to mark your scene sequence to be interruptible by clicking the corresponding checkbox.

Dude, this is the second time in a week you've saved my bacon. I should stop trying to figure it out and just ask you directly XD. Thanks much, I'll report back after trying it out in our services. I foresee a loop issue where the macro runs and switches to a separate slide scene when its already on one, if it detects a change, but I'll try to see if there is a condition or lock I can add that prevents that.

Edit: I did end up using a video source that lets me list my browser input, which is weird that I can't just select browser input with the "changed" option, but if it works, great. Not really sure how OBS renders everything between scenes because I certainly don't have that browser input on all scenes, but it seems to switch how I want it regardless.
 
Last edited:

bcoyle

Member
A lot of things would be easier if it were designed specifically for them. But this is a general purpose thing. So there will always be some applications that don't really match up with how it works. Be proud of yourself for understanding how it does work, and using that to make it do what you need anyway.

That said, a checkbox to effectively create the reverse condition and action behind the scenes, might also be useful in a lot of cases beyond just that one...and probably hard to make in a general sense, because some actions don't really have a clear "undo" from the software's perspective.

"Undo" is one of those things that appear trivial to a user, but are nearly impossible to actually make happen. I've been there; I know! You need to design it in from the beginning, so that every action also saves the specific data that is required to undo it (when you as a developer still know what that data is!); or periodically save the entire state of everything so that you can restore one of those snapshots. The former requires a fair amount of explicit logic added to EVERYTHING; the latter requires a ton of memory. Either way, it still may not work right because certain things need to be set up again, and that setup has side-effects too.

In your specific case, I think it would work - "show" and "hide" are opposite functions without side effects - but it might be impossible to cover *everything*. That'll make it confusing when some things work and some don't. (maybe hide the "auto-undo" checkbox for the non-trivial actions???)

---

Or to make it even more generally useful, maybe have two actions: one for the condition becoming true, as it is now, and one for the same condition becoming false. The false action defaults to "do nothing", and there could be a button to set it to the reverse of the true action. Visually disable that button when the reverse is non-trivial. By allowing the false action to be anything, independent from the true action, it could create a lot of interesting behaviors, some of which might actually be useful! :-)
Well said. I've been working on a 24/7 broadcast app and have put a few undo's in the app. But as you said, it's hard. I put them him specific places where I found the action would be terrible hard to undo manually. You are a wise man.
 
Last edited:

AlexYa

New Member
It is very difficult to say what the issue is without further information, unfortunately.
What type of media sources are you using?
Does the issue occur if you have only the rule for "Video B" set up?

I am not sure I understand how using macros makes a difference - are both video sources in state "ended" at the same time?
If so then the scene switcher uses the higher priority rule to decide which scene to switch to.
(As otherwise the plugin would continuously switch back and forth between the two specified scenes)

I have the same problem as mr. Urbanian.
My goal was to make promo inserts between the clips from the playlist.

The workaround is as follows:
Two scenes, A (A: VLC source with playlist; loop; paused on hiding)
And B (B: Source with simple media source with promo; restart on active)

I made two macros:
1) From A to B: If A:VLCSource is "ended" - switch to scene B
2) From B to A: If B:Source is "ended" - switch to scene A.

And it wasn't works. Plugin even not switched scene A to B at all. Only B to A.

Already I've tried use not macros but Media rules instead. They not work at all (tested with "ended" and "played to end" events)

BUT! I've founded the solution "from the reverse"
I changed macros 1) to next:
Code:
From A to B: 
    If A:VLCSource is "playing" and "time remaining shorter" than 1-2 second:
         switch to scene B, 
         switch next track in A:VLCSource, 
         pause it at the moment.

Therefore, I came to the conclusions:
a) the "ended" event does not work for VLC Source (OBS level or plugin?)
b) Media rules do not work properly
c) When the "loop" setting is enabled in VLC, the "played to ended" event does not work either.
 

Attachments

  • Test_advanced_scene_switcher_with_tab_Media_and_media_sources.txt
    13.7 KB · Views: 39
  • Test_advanced_scene_switcher_with_tab_Media_and_media_sources_(played_to_end).txt
    13.7 KB · Views: 32
  • Test_advanced_scene_switcher_with_tab_Media_and_VLC_and_media_sources.txt
    17.3 KB · Views: 38
  • Test_advanced_scene_switcher_with_tab_Media_and_VLC_sources.txt
    14.5 KB · Views: 32
  • Test_advanced_scene_switcher_working_configuration.txt
    17 KB · Views: 33
Top