Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

2pacsaywer

New Member
Can you please share the settings you are using? (You can export them to a file on the General tab)
Thank you in advance for looking into this. After some more testing, I deleted all my Scenes and Sources and still had the same "lag" issue. I then went and deleted the macros in the advanced scene switcher until there were none left. Only when I delete all the macros does my game performance go back to normal.

Possibly some more useful info.

PC Specs
-RTX 3080 Ti
-i9 10900K (no over clock)
-16GB RAM with XMP turned on

-With OBS open not recording/streaming and Advanced Scene Switcher turned on OBS Studio is using 4% CPU 600MB RAM and 1.5% GPU usage.
-While Advanced Scene Switcher is turned off OBS is using 2.5% CPU 400MB RAM and 1.5% GPU.
-While OBS is open with Advanced Scene Switcher enabled, playing Paladins max settings 1440p CPU is at 47% RAM at 82% and GPU at 33%.
 

Attachments

  • Advance Scene Switcher Settings.txt
    11.2 KB · Views: 23

khaver

Member
Go Close and Go Wide both have the condition of "If..." One of them should be "If not..."
You're right. I accidently changed it when I was making the screen shots. I did change it to "if not' but still got the same result. Here's the part of the log where it's happening. It appears the switch ( 2 second fade) to the closeup scene is triggering the pattern match to return 0 so the Go Wide macro triggers a scene change back to the wide view scene.

Code:
10:03:25.633: [adv-ss] try to sleep for 374
10:03:26.008: [adv-ss] condition scene returned 0
10:03:26.008: [adv-ss] Macro Startup returned 0
10:03:26.008: [adv-ss] condition video returned 0
10:03:26.008: [adv-ss] ignoring condition check 'none' for 'Start Recording 2'
10:03:26.008: [adv-ss] condition scene returned 0
10:03:26.008: [adv-ss] Macro Start Recording 2 returned 0
10:03:26.058: [adv-ss] condition video returned 1
10:03:26.058: [adv-ss] Macro Pattern Match returned 1
10:03:26.058: [adv-ss] condition macro returned 1
10:03:26.058: [adv-ss] Macro Go Close returned 1
10:03:26.059: [adv-ss] condition macro returned 1
10:03:26.059: [adv-ss] Macro Go Wide returned 0
10:03:26.059: [adv-ss] Macro Stop Recording is paused
10:03:26.059: [adv-ss] running macro: Pattern Match
10:03:26.059: [adv-ss] running macro: Go Close
10:03:26.059: [adv-ss] switch to scene 'Sermon'
10:03:26.089: User switched to scene 'Sermon'
10:03:26.089: [adv-ss] switched scene
10:03:28.349: [adv-ss] detected busy loop - refusing to sleep less than 1ms
10:03:28.349: [adv-ss] try to sleep for 50
10:03:28.351: [adv-ss] current scene:  Sermon
10:03:28.352: [adv-ss] previous scene: Sermon Wide
10:03:28.400: [adv-ss] condition scene returned 0
10:03:28.400: [adv-ss] Macro Startup returned 0
10:03:28.400: [adv-ss] condition video returned 0
10:03:28.400: [adv-ss] ignoring condition check 'none' for 'Start Recording 2'
10:03:28.400: [adv-ss] condition scene returned 0
10:03:28.400: [adv-ss] Macro Start Recording 2 returned 0
10:03:28.451: [adv-ss] condition video returned 1
10:03:28.451: [adv-ss] Macro Pattern Match returned 1
10:03:28.451: [adv-ss] ignore match for Macro Pattern Match (on change)
10:03:28.451: [adv-ss] condition macro returned 0
10:03:28.451: [adv-ss] Macro Go Close returned 0
10:03:28.451: [adv-ss] condition macro returned 0
10:03:28.451: [adv-ss] Macro Go Wide returned 1
10:03:28.451: [adv-ss] Macro Stop Recording is paused
10:03:28.451: [adv-ss] running macro: Go Wide
10:03:28.451: [adv-ss] switch to scene 'Sermon Wide'
10:03:28.472: User switched to scene 'Sermon Wide'
10:03:28.472: [adv-ss] switched scene
10:03:30.717: [adv-ss] detected busy loop - refusing to sleep less than 1ms
10:03:30.717: [adv-ss] try to sleep for 50
10:03:30.719: [adv-ss] current scene:  Sermon Wide
10:03:30.719: [adv-ss] previous scene: Sermon
 

Warmuptill

Active Member
You're right. I accidently changed it when I was making the screen shots. I did change it to "if not' but still got the same result. Here's the part of the log where it's happening. It appears the switch ( 2 second fade) to the closeup scene is triggering the pattern match to return 0 so the Go Wide macro triggers a scene change back to the wide view scene.

Code:
10:03:25.633: [adv-ss] try to sleep for 374
10:03:26.008: [adv-ss] condition scene returned 0
10:03:26.008: [adv-ss] Macro Startup returned 0
10:03:26.008: [adv-ss] condition video returned 0
10:03:26.008: [adv-ss] ignoring condition check 'none' for 'Start Recording 2'
10:03:26.008: [adv-ss] condition scene returned 0
10:03:26.008: [adv-ss] Macro Start Recording 2 returned 0
10:03:26.058: [adv-ss] condition video returned 1
10:03:26.058: [adv-ss] Macro Pattern Match returned 1
10:03:26.058: [adv-ss] condition macro returned 1
10:03:26.058: [adv-ss] Macro Go Close returned 1
10:03:26.059: [adv-ss] condition macro returned 1
10:03:26.059: [adv-ss] Macro Go Wide returned 0
10:03:26.059: [adv-ss] Macro Stop Recording is paused
10:03:26.059: [adv-ss] running macro: Pattern Match
10:03:26.059: [adv-ss] running macro: Go Close
10:03:26.059: [adv-ss] switch to scene 'Sermon'
10:03:26.089: User switched to scene 'Sermon'
10:03:26.089: [adv-ss] switched scene
10:03:28.349: [adv-ss] detected busy loop - refusing to sleep less than 1ms
10:03:28.349: [adv-ss] try to sleep for 50
10:03:28.351: [adv-ss] current scene:  Sermon
10:03:28.352: [adv-ss] previous scene: Sermon Wide
10:03:28.400: [adv-ss] condition scene returned 0
10:03:28.400: [adv-ss] Macro Startup returned 0
10:03:28.400: [adv-ss] condition video returned 0
10:03:28.400: [adv-ss] ignoring condition check 'none' for 'Start Recording 2'
10:03:28.400: [adv-ss] condition scene returned 0
10:03:28.400: [adv-ss] Macro Start Recording 2 returned 0
10:03:28.451: [adv-ss] condition video returned 1
10:03:28.451: [adv-ss] Macro Pattern Match returned 1
10:03:28.451: [adv-ss] ignore match for Macro Pattern Match (on change)
10:03:28.451: [adv-ss] condition macro returned 0
10:03:28.451: [adv-ss] Macro Go Close returned 0
10:03:28.451: [adv-ss] condition macro returned 0
10:03:28.451: [adv-ss] Macro Go Wide returned 1
10:03:28.451: [adv-ss] Macro Stop Recording is paused
10:03:28.451: [adv-ss] running macro: Go Wide
10:03:28.451: [adv-ss] switch to scene 'Sermon Wide'
10:03:28.472: User switched to scene 'Sermon Wide'
10:03:28.472: [adv-ss] switched scene
10:03:30.717: [adv-ss] detected busy loop - refusing to sleep less than 1ms
10:03:30.717: [adv-ss] try to sleep for 50
10:03:30.719: [adv-ss] current scene:  Sermon Wide
10:03:30.719: [adv-ss] previous scene: Sermon
I think this might be the issue:
10:03:28.451: [adv-ss] ignore match for Macro Pattern Match (on change)
Please uncheck the "Perform actions only on condition change" option in the "Pattern match" macro.
 

khaver

Member
I also tried it with straight cuts and the immediate switch back to the wide shot still happens. I then added a duration check in the Pattern Match macro "Fot at least - 1 second". It now works. I'm not sure why adding the duration check made it work. Warmuptill, can you explain?

Thanks.
 

khaver

Member
Warmuptill, I was typing my last reply while you posted. I did try unchecking the "only on change" box but it still exhibited the same behavior. Adding the duration check fixed it.

Just to be thorough, I'll check all previous settings again and report back.
 

khaver

Member
Okay, I was wrong. The auto switching works without the duration check in the Pattern Match macro. Unchecking the "Perform actions only on condition change" in the Pattern macro was the fix.

Thanks for your help.
 

SillyMcDangle

New Member
That is really strange - I will try to investigate.
Did you observe this with previous versions of the plugin as well?
How much CPU time is roughly used up by OBS Studio studio process in that situation?

I have not used Advanced Scene Switcher until this current version. Brand new to streaming and I'm trying to get everything set up.

PC Specs:
-Radeon 6700XT
-Ryzen 5 3600
-16GB DDR4-3600 RAM

OBS usage with OBS open and not recording or streaming and Advanced Scene Switcher Enabled:
CPU: 2.4% GPU: 0% RAM: 313 MB

OBS usage with OBS open and not recording or streaming and Advanced Scene Switcher Disabled:
CPU: 3-3.5% GPU: 0% RAM: 324 MB

With OBS open and not recording or streaming, Advanced Scene Switcher Enabled and Apex running pretty much max settings in 1440p and normal applications running in the background:
CPU: 48% GPU: 94% RAM: 10.4 GB (TOTAL NUMBERS)

Then I turn off Advanced Scene Switcher and the lag goes away completely and the numbers are:
CPU: 35% GPU: 98% RAM: 10.4 GB (TOTAL NUMBERS)

All I did in Apex is hop in the firing range and I can replicate the issue. Stayed in the range, alt tabbed to OBS on my other monitor, disabled Advanced Scene Switcher, and went back to the game and read the numbers again. No idea why the CPU-GPU balance seemed to shift, but the way it shifted would make you think it would perform worse after I disabled Advanced Scene Switcher, which is the exact opposite of what actually happened. Super weird.
 

DJFrANKyEHP

New Member
@Warmuptill I think I have no sufficient words here to describe how thankfully I am for this really really useful plugin you have here.

I use it in every and all of my 'Streams', everydays, because whithout this plugin my 'Streams' cannot be done in the way they are configurated. I really love the incredible hard work it must have beyond what it is seen at first sight. I use this plugin for very much automated things, like change between scenes, activate and deactivate sources, to turn up and down the volume while speaking in the way if I speak the volume of the desk goes down and when I stop talking the volume goes up again, etc, etc, and etc. And I think I have not gotten the total potential it has.

The curve of learning I think is good because even when at first sight it can be hard, after working a little with it and understanding how it works, then you can go ahead with the only limits of your imagination and, of course, the quantity of work one can want to put in the 'Streams'.

So really... thanks you very much for this extremely powerful tool.

NOTE: You are credited as 'Plug-ins Creator' at the credits of my 'Streams' at the end of them. ;)
 

iGamer4tv

New Member
Is there a way to check a source is between specific positions using Scene item transform?

I want a trigger to happen if the x position is between 0 and 10. I want the "2" in x to be anywhere from 0 - 10.
Im not sure how to alter this, if possible!

"pos": {
"x": 2,
"y": 0

Orginial code for the source in question:

Code:
{
    "alignment": 5,
    "bottom": 0,
    "bounds": {
        "x": 1920,
        "y": 1080
    },
    "bounds_alignment": 0,
    "bounds_type": 2,
    "left": 0,
    "pos": {
        "x": 2,
        "y": 0
    },
    "right": 0,
    "rot": 0,
    "scale": {
        "x": 1,
        "y": 1
    },
    "size": {
        "height": 1080,
        "width": 1920
    },
    "top": 0
}
 
Last edited:

AaronD

Active Member
...turn up and down the volume while speaking in the way if I speak the volume of the desk goes down and when I stop talking the volume goes up again...
As an audio guy, that sounds like a ducker to me. You can make one from a compressor, by having it respond to a different signal than the one that it affects.

OBS has a compressor natively as one of the audio filters, so you can put it on your desk source or whatever else that you want to "duck" under your voice, and then put your voice in the Sidechain:
1659965270110.png

It'll behave a bit differently than the macro version. The most obvious way to me at the moment is that the macro always drops the background by a fixed amount (which might be what you want), whereas the compressor/ducker drops more if your voice is louder and less if you're softer.
And the macro only checks 10x per second or whatever you have it set to, whereas the audio filters check every sample. (44.1 or 48 thousand per second) Much more responsive that way.

The amount that it drops is [volume - Threshold] x Ratio...except that the Ratio control is labelled differently, as the actual ratio of the change in input volume to the change in output volume. The two timing controls - Attack and Release - are basically fade times - one down and one up - and the Output Gain is simply a fixed volume control after everything else is done. (so instead of only turning it down, it can turn up by that much normally and reduce from there)

A limiter is simply a compressor with oo:1 Ratio. Dedicated ones often have non-adjustable instant Attack as well, and the Gain control moved to the input so that it acts *before* the Threshold. OBS's limiter only has Threshold and Release, so any pre-gain needs to be a separate filter.

The screenshot here is for a presentation mic, which is Behringer's clone of an SM58 a fair distance away in a makeshift studio. No settings for Noise Suppression. Limiter has a Threshold of -6dB and Release 100ms. The Compressor does most of the work, and the Limiter is more of a "safety net". A different rig (not here at the moment) has the same Compressor filter used as a ducker so that a remote meeting doesn't feed back through the mic to the remote people. Hearing yourself that much later completely throws off your concentration, so the local mic (quite drastically in this case) ducks under the remote participants.

--- Geeking out a bit: ---

Conceptually, you can think of the compressor as only turning things down, and then the Output Gain (or makeup gain) is a separate thing that follows that, but most compressors implement it as an offset to the control signal instead. Same effect. If I have a bunch of channels to mix together, like a band, I often use the compressors' makeup gains to trim the faders so that they all line up nicely for an "okay" mix. The faders then become offsets from that instead of absolute controls.

In an analog compressor, like you might find in a recording studio or "old school" live rig, you have a volume detector that produces a control signal, which is compared to the Threshold and the difference (or zero if negative) moves on. Then the timing controls slow down their respective edges, followed by a "volume control" of sorts that turns down the control signal (this is the Ratio: all the way up is oo:1, all the way down is 1:1 or no effect), and finally the Output Gain or Makeup Gain offsets the control signal before feeding it to the gain element. Increasing control signal turns the gain element down, by the same amount that the detector produced it. (so if you connected them directly together, you'd always get the same volume out regardless of anything, which would amplify the electronic noise of an otherwise silent input to that volume, hence the Threshold to avoid that)

So far, I've described a "feedforward" compressor, where the detector is up front, measuring the raw signal, and its result is fed "forward" in terms of signal flow to the gain element. This makes it easy to disconnect the detector from the original input and feed it something else instead, which makes it a ducker. Or (in the more free-form analog world, and the digital things that already thought of it) you could put an EQ or other processing before the detector so that it responds more to the boosted frequencies (turns them down more) and less to the rest. The side-chain jack outputs a copy of the raw input for that purpose, in addition to receiving what the detector should respond to. A switch in that jack automatically connects the detector to the input, when there's no plug present.

There are also "feedback" compressors, where the detector is on the output and fed "back" to the gain element that comes before. This can only be a compressor, not a ducker (I guess technically it *could*, but it would change to a feedforward ducker), and can't reach oo:1 ratio. They're fairly rare now...except that our ears work this way, using the auditory nerve signals as the detector and restricting the movement of the eardrum as the gain element. Thus, when old people say, "It's too loud," it's probably because they can't restrict their eardrums anymore, and so they really are getting blasted more than someone younger...and consequently lose more of their hearing while the younger one doesn't lose any.

The quality of the mix also makes a difference because our hearing is essentially an RTA or spectrum analyzer, not a single microphone, and the signal to "clamp down" is the average of that RTA. Thus, a small range of prominent frequencies keeps the average low, so we don't clamp down, which allows that small range to get blasted and possibly damaged. A good mix is more even in its frequency content, which brings the average up, so that we do clamp down and then we're okay...so long as we're still able to clamp down.
 

lcalder

Member
I was wondering if there is a Mac M1 arm64 version of this magnificent plugin which I can try with the OBS 28 beta...
 

Warmuptill

Active Member
I was wondering if there is a Mac M1 arm64 version of this magnificent plugin which I can try with the OBS 28 beta...
I am looking into it at the moment.

If you want to test a pre-release you can give this one a try:
The M1 build is the "SceneSwitcher-macos-arm64-086daaf5e" one.
(Note that you will have to log into GitHub to be able to download it)
 

kellemar

New Member
Hmm, what's the difference between stoppped and ended state for media?

I've been trying to do this simple macro of switching to another scene when a video is ended (reaches end of the time). But whenever I'm on the scene where the video is, it immediately switches without the video playing in the first place.

Is there something I'm missing?
 

Attachments

  • Screenshot 2022-08-10 at 3.29.05 PM.png
    Screenshot 2022-08-10 at 3.29.05 PM.png
    40.5 KB · Views: 23

AaronD

Active Member
Hmm, what's the difference between stoppped and ended state for media?

I've been trying to do this simple macro of switching to another scene when a video is ended (reaches end of the time). But whenever I'm on the scene where the video is, it immediately switches without the video playing in the first place.

Is there something I'm missing?
I don't know what they all mean either (maybe Warmuptill can explain?), but Played to End seems to work for me.
 

ScanxTaz

New Member
Guys, I'm desperately trying to find how to start the "timed switcher". I've created a scene group, with the "time" selected, but the switching does not start. Am I missing something ?
 

Warmuptill

Active Member
Hmm, what's the difference between stoppped and ended state for media?

I've been trying to do this simple macro of switching to another scene when a video is ended (reaches end of the time). But whenever I'm on the scene where the video is, it immediately switches without the video playing in the first place.

Is there something I'm missing?
The difference between ended and stopped depends on the source type.
For the regular "Media source" there is not much of a difference as far as I am aware.
I would recommend to enable the following visual guides to make analysing the issue easier on your end:

What I *think* what might be happening is that the playback of the media source is in state "ended" even before you switch to the particular scene containing the media source so the scene is switched immediately.
(Maybe the particular media source is configured to stop its playback if it is no longer visible)

Guys, I'm desperately trying to find how to start the "timed switcher". I've created a scene group, with the "time" selected, but the switching does not start. Am I missing something ?
Scene Groups is not what you are looking for I think.
Please have a look at this guide:
Let me know if you have any questions!
 
Top