Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Warmuptill

Active Member
Thank you, I am attaching the crash log.
Appreciate it!

Unless I am misinterpreting it the crash is not caused by the plugin.
The crashing thread seems to be libobs: graphics thread. ("faultingThread": 14)
A call to mallocseems to fail in FT_Load_Glyph.
So, it is probably related to some text source rendering, but I am not really familiar with what is being done there.
 

Rozenman

Member
So, it is probably related to some text source rendering,
Oh! This thought flashed through my mind, but I couldn’t verify it. Using two variables, I load the numbers of study groups and the name of the lesson into the text source. Depending on the date. Well, “What can you do?”, as Van Gogh said. Thank you very much!
 

old_maple

New Member
Ok, so I simply want to loop between two scenes but using macros this simply isn't working, a friend and I spent 3 hours banging our heads together and finally found a solution but it seems the solution is going away?( attached) how can I get this to work with macros? we tried Sequence macros but it stops and doesn't continue to loop. We're either both really dumb (likely) or macros aren't fully working yet for this kind of thing?
 

Attachments

  • Screenshot 2024-05-14 210815.png
    Screenshot 2024-05-14 210815.png
    24.1 KB · Views: 18

old_maple

New Member
Ok, so I simply want to loop between two scenes but using macros this simply isn't working, a friend and I spent 3 hours banging our heads together and finally found a solution but it seems the solution is going away?( attached) how can I get this to work with macros? we tried Sequence macros but it stops and doesn't continue to loop. We're either both really dumb (likely) or macros aren't fully working yet for this kind of thing?
It says development of this tab has stopped and switch to macro's but I can't get it to work for the life of me.
 

AaronD

Active Member
A call to mallocseems to fail in FT_Load_Glyph.
So, it is probably related to some text source rendering, but I am not really familiar with what is being done there.
If malloc fails, that usually means it can't find enough contiguous memory to fit what the program asks for at that point. So malloc either returns NULL, or throws an exception itself, depending on some esoteric details that are different for different systems.

As a programmer, you're supposed to check every time you use malloc, to see if you actually got a valid chunk of memory before you use it. If you got NULL instead, DON'T use it! (and figure out what to do without it) If you try to use NULL, it'll crash with a segmentation fault. If malloc throws its own exception and you don't catch it, that's also a crash.

But a lot of programmers don't bother with all that, because it rarely happens. Especially on their own machines that they actually know and care to spec and maintain well. So they don't check at all and just use whatever malloc comes up with...and we get apps that crash when the overall machine gets low on RAM. If a library does that, then any app that uses the library inherits it, even if the author of the app did everything right.
 

AaronD

Active Member
we tried Sequence macros but it stops and doesn't continue to loop.
Using the tutorial that has everything in one macro with Waits in between, yes, that's true. Macros don't loop, so you have to explicitly re-trigger it every time if you go that route.

how can I get this to work with macros?
Use lots of macros! One for each step:
  • Step 1
    • Condition:
      • Scene _ for A seconds
    • Action:
      • Switch to Scene 1
  • Step 2
    • Condition:
      • Scene 1 for B seconds
    • Action:
      • Switch to Scene 2
  • Step 3
    • Condition:
      • Scene 2 for C seconds
    • Action:
      • Switch to Scene 3
  • ...
  • Step _
    • Condition:
      • Scene [_-1] for ? seconds
    • Action:
      • Switch to Scene _
As you can see, I replaced the waits with condition timers, and each one creates the condition that the next one looks for. Then it becomes trivial to make it loop: just have the last one create the condition that the first one looks for.

And of course it doesn't have to be just scenes. It could be anything that Adv. SS can do.

Two huge advantages with this method, over the single macro with Waits, are:
  • You can enter at any point, just by making that condition true. In the case of a sequential scene switcher, just switch to any scene that's part of the sequence, and the macros take it from there.
  • You can escape just by making the conditions not true. In the case of a sequential scene switcher, switch to something that's not in the sequence before the timer runs out.
    • The single macro with Waits, from the tutorial, will continue to enforce the sequence until it's all the way done, even if you don't want it to anymore.
 

old_maple

New Member
Using the tutorial that has everything in one macro with Waits in between, yes, that's true. Macros don't loop, so you have to explicitly re-trigger it every time if you go that route.


Use lots of macros! One for each step:
  • Step 1
    • Condition:
      • Scene _ for A seconds
    • Action:
      • Switch to Scene 1
  • Step 2
    • Condition:
      • Scene 1 for B seconds
    • Action:
      • Switch to Scene 2
  • Step 3
    • Condition:
      • Scene 2 for C seconds
    • Action:
      • Switch to Scene 3
  • ...
  • Step _
    • Condition:
      • Scene [_-1] for ? seconds
    • Action:
      • Switch to Scene _
As you can see, I replaced the waits with condition timers, and each one creates the condition that the next one looks for. Then it becomes trivial to make it loop: just have the last one create the condition that the first one looks for.

And of course it doesn't have to be just scenes. It could be anything that Adv. SS can do.

Two huge advantages with this method, over the single macro with Waits, are:
  • You can enter at any point, just by making that condition true. In the case of a sequential scene switcher, just switch to any scene that's part of the sequence, and the macros take it from there.
  • You can escape just by making the conditions not true. In the case of a sequential scene switcher, switch to something that's not in the sequence before the timer runs out.
    • The single macro with Waits, from the tutorial, will continue to enforce the sequence until it's all the way done, even if you don't want it to anymore.
So the solution is not loop but make a shit ton of macros? that seems stupid since the sequence thing is in the list of macro's and it says that it will restart from the beginning once the end is reached so one would assume it would start macro 1 again go to macro2 and repeat? but it doesn't, seems broken to me.
 

Attachments

  • Screenshot 2024-05-15 103156.png
    Screenshot 2024-05-15 103156.png
    3.6 KB · Views: 13

AaronD

Active Member
Use lots of macros! One for each step:
I use that trick a LOT, by the way. Convert what's normally thought of as a single sequence, into a series of trivial actions that each have their own triggers. It works wonders in embedded programming too, where you only have one thread and a lot of things to do.

In the embedded world, it's literally one big loop that's always freewheeling, and inside that loop you have a bunch of conditional branches to do those trivial steps. None of those steps takes very long. No explicit delays or waiting for anything in any of them, ever, not even as part of a library. (which means that I increasingly have to rewrite or simply discard an otherwise good library function to make it non-blocking) Anything that might possibly delay the execution of something, is instead its own trigger for its own branch.

So you might imagine a dot that represents what the machine is currently looking at, constantly flying down the list of conditions over and over and over again, much faster than you can actually see it, and every once in a while, it branches off to do some part of something and comes right back to continue down the list. In the embedded world, all of that is explicit, but for us here, the main loop already exists, and we simply add our conditional branches to it.
 

Warmuptill

Active Member
Ok, so I simply want to loop between two scenes but using macros this simply isn't working, a friend and I spent 3 hours banging our heads together and finally found a solution but it seems the solution is going away?( attached) how can I get this to work with macros? we tried Sequence macros but it stops and doesn't continue to loop. We're either both really dumb (likely) or macros aren't fully working yet for this kind of thing?
There are multiple way to set up a sequence of scene switches using macros.
Here are a few examples on how to achieve this:
 

AaronD

Active Member
So the solution is not loop but make a shit ton of macros? that seems stupid since the sequence thing is in the list of macro's and it says that it will restart from the beginning once the end is reached so one would assume it would start macro 1 again go to macro2 and repeat? but it doesn't, seems broken to me.
Use the tools that are there, and make *that* sing. I've suspected for a while already that this plugin is Turing-Complete, which means that it's really a programming language that can do anything that any other Turing-Complete programming language can do, given enough time and machine resources. And I've seen some really stupidly inefficient "thought experiment" languages and machines, along with proof that they are also Turing-Complete. Compared to those, Adv. SS is not bad at all!
 
Installed 1.26.1 - I could not get it to work, re-installed multiple times, clean installs as well

Went back to 1.25.5 and everything works fine, except some macros lost their settings

Did not check 1.26.0....

Heres a log when I had 1.26.1 installed if you wanna see it.
 

Warmuptill

Active Member
Installed 1.26.1 - I could not get it to work, re-installed multiple times, clean installs as well

Went back to 1.25.5 and everything works fine, except some macros lost their settings

Did not check 1.26.0....

Heres a log when I had 1.26.1 installed if you wanna see it.
Same issue for me. I tried 1.26 and 1.26.1 and the plugin does not load at all. 1.25.5 works fine
Thanks for pointing it out.
I am aware of the issue and was able to track down what is causing it.
I will release an update soon, which should resolve the problem.
In the mean time you can also work around this problem by installing the most recent version of the Microsoft Visual C++ Redistributable.
 

Warmuptill

Active Member
did i forget the log link in my last post? or did obsf cut it out?

Either way, 1.26.2 fixes the issue, thanks.
Thanks for the quick feedback! :)
And sorry for not fixing it sooner - this type of problem was a rather tricky to analyze!

(I did not see a log file or a link to one)
 
Thanks for the quick feedback! :)
And sorry for not fixing it sooner - this type of problem was a rather tricky to analyze!

(I did not see a log file or a link to one)
it was really late at night, i remember copying the link but must have forgot to paste... oh well it all worked out
 

Raymond NL

New Member
I stream sports games. These matches have four periods.
In my scoreboard, from a txt file, I specify period 1, 2, 3 or 4.

I would like to use advanced-scene-switcher to adjust the replay buffer path from a txt file or hotkey. All saved videos will then come to an associated folder by period.
for example:
Replay buffer path period 1:
\Replaybuffer\1\
Replay buffer path period 2:
\Replaybuffer\1\2\
Replay buffer path period 3:
\Replaybuffer\1\2\3\
Replay buffer path period 4:
\Replaybuffer\1\2\3\4\

Is this possible?
 

Bairespm

Member
Hello, is there any possibility that I can choose which GPU to project on another screen with macros?
My intention is not to overload a video card if I have more than one.
 

Warmuptill

Active Member
I stream sports games. These matches have four periods.
In my scoreboard, from a txt file, I specify period 1, 2, 3 or 4.

I would like to use advanced-scene-switcher to adjust the replay buffer path from a txt file or hotkey. All saved videos will then come to an associated folder by period.
for example:
Replay buffer path period 1:
\Replaybuffer\1\
Replay buffer path period 2:
\Replaybuffer\1\2\
Replay buffer path period 3:
\Replaybuffer\1\2\3\
Replay buffer path period 4:
\Replaybuffer\1\2\3\4\

Is this possible?
I believe this should be possible.
The "File" condition can be used to check, if the content of a file matches a given pattern.
The "Hotkey" condition can be used to perform a set of actions when a hotkey is pressed.
The output path of the replay buffer can be changed using the "Recording" action type.

So an example macro for the first period might look something like this:
1716229639976.png

Note that the replay buffer has to be stopped and started for the change of the output path to take effect.
The "Wait" action has been added to ensure that the stopping of the replay buffer was successful, since that takes a bit of time.

You will have to create 4 macros in total to handle all four cases.

Just to mention it: You could also get fancy and use variables, but that might be a bit overkill for just 4 different cases.

Let me know, if you have any further questions!
Hope that helped! :)

Hello, is there any possibility that I can choose which GPU to project on another screen with macros?
My intention is not to overload a video card if I have more than one.
I am not sure to be honest.
Is this a setting within OBS?
If so, can you please point me to where I can find it and I will look into it. :)
 
Top