Resource icon

Advanced Scene Switcher 1.25.1

Warmuptill

Active Member
After updating obs studio and advanced scene switcher my macros were gone. I previously exported my settings and now I imported those settings. But no macros appear in the settings. I also restarted obs studio.

I now opened to have a look at the text-file. It´s not that much text. Is this normal?


Also after importing the settings I get a message saying the import was sucessfull. Then the plugin settings window closes. Is this the normal behavior?
The file you linked is from version 1.9.1 of the plugin.
This is very old and from a time before the macro functionality was even introduced.

Are you sure you imported the correct file?
 

J Sparq

New Member
The file you linked is from version 1.9.1 of the plugin.
This is very old and from a time before the macro functionality was even introduced.

Are you sure you imported the correct file?
Thank you Warmuptill for your reply.

I did the backup a couple of months ago. But I was not aware of that I had to update plugins manually. So yes the plugin was very old. I was forced to update the plugin after my latest Obs Studio upgrade. I´m not sure if the functionality was called "macro" or something else. But I did, for example, set up the plugin to automatically switch from one scene to another after a certain time period.

The backup version being very old might be the problem I don´t understand why I get the "import completed succefully" message though.
 

Warmuptill

Active Member
Thank you Warmuptill for your reply.

I did the backup a couple of months ago. But I was not aware of that I had to update plugins manually. So yes the plugin was very old. I was forced to update the plugin after my latest Obs Studio upgrade. I´m not sure if the functionality was called "macro" or something else. But I did, for example, set up the plugin to automatically switch from one scene to another after a certain time period.

The backup version being very old might be the problem I don´t understand why I get the "import completed succefully" message though.
The contents of the file you provided for the import are valid.
That is why the plugin is able to import them successfully.

Nevertheless there is pretty much nothing in the provided settings file besides a few generic settings.

Just guessing here, but could it be that you are maybe using a different scene collection than you did in the past?
The settings are stored and are specific to each scene collection.
So if you previously used a different scene collection, if you switch back to it the settings should still be there.

Other than that I am not sure how to help unfortunately :(
Please let me know if you have any questions!
 

kdarroch

Member
So after updating to OBS 29.0.0 and Advanced Scene Switcher 1.20.3 My macros that do compares to sources, scenes, etc. can't get the necessary screen capture to do the compare with.

Error is "Failed to get screen shot of source" every time I try to pick area to look for changes. You can see the source but it just sits there blinking and eventually causes OBS to crash

Any ideas? Have tried multiple different sources, re-created the macro, and still same result.

Guess I will downgrade back to previous advanced scene switcher and see if that fixes it for now. Dead in the water with 1.20.3
 

kdarroch

Member
so further testing revealed the following
OBS 29 does not have the issue using 1.19.2 version of plugin.
Every release after that is having the issue
Maybe my case is unique (or I am the first to run across it) but it appears to an issue with the plugin being able to get a screen capture of the source in order to do the compare or let you select an area to check in.

Hopefully a bug fix coming soon
 

Warmuptill

Active Member
so further testing revealed the following
OBS 29 does not have the issue using 1.19.2 version of plugin.
Every release after that is having the issue
Maybe my case is unique (or I am the first to run across it) but it appears to an issue with the plugin being able to get a screen capture of the source in order to do the compare or let you select an area to check in.

Hopefully a bug fix coming soon
Can you share the settings that are causing this issue? (It would be best if you export them to a file on the General tab)
Can you also share the crashlog of the crash you mentioned?

I could imagine that maybe the interval on the General tab is set to a very low value and thus the dialog for selecting the area cannot get the screenshot in time.
In the older versions the dialog would only update at a fixed interval of 500ms instead of based on the interval value selected on the General tab.

Update:
A test build where the delay between screenshots will be dynamically scaled up can be found here in a few minutes:
I would appreciate if you could give this a try and check if the issue is resolved.
To be able to download it you will have to log into GitHub - let me know if that should be an issue for you.
 
Last edited:

Warmuptill

Active Member
I'm probably missing something simple like just not putting things in the correct syntax.

For a macro that will execute based on the contents of a txt file, can you only put one term in the box or can you put a list of terms?
section:
If -> File -> Local File -> [file name] -> Browse -> matches

I can get the macro to work fine with a single term in the box. I would like to be able to put a list of terms and if the txt file matches any of the terms to execute

There is a checkbox to enable regular expressions with the following options: Allow partial match, Match case insensitive, . matches newlines, ^ and $ match start/end of line, Enable Qt's ExtendedPatternSyntax.

. matches newlines or ^ and $ match start/end of line seem to be what I would need to make a list but I guess I don't know what syntax to put the list in to get these to work. Tried putting a . in front of each term or at the end of each term to mark a newline and also tried putting ^ and $ and the start/end of each line.

As I said, probably something simple like I just need the correct syntax.
If a list cannot be done, then I'll just make a separate macro for every term.
You can use a single File condition to match multiple patterns using regular expressions.
For example, the regular expression (pattern1)|(pattern2)|(pattern3) would match if the file only contains either of the following lines:
  • pattern1
  • pattern2
  • pattern3
File.PNG


Regular expressions can be very powerful, but also complicated.
I would suggest testing them on https://regex101.com/.

And sorry about the delayed response.
I somehow missed your message.
 

Warmuptill

Active Member
I would like to request for the option of switch to what ever is in the preview window
Thanks for the suggestion! :)

I think that should already be possible using the "Studio mode" action.
It should allow you to "Swap preview and program scene".

Let me know if that is what you were looking for or if I misunderstood something.
 

kdarroch

Member
Can you share the settings that are causing this issue? (It would be best if you export them to a file on the General tab)
Can you also share the crashlog of the crash you mentioned?

I could imagine that maybe the interval on the General tab is set to a very low value and thus the dialog for selecting the area cannot get the screenshot in time.
In the older versions the dialog would only update at a fixed interval of 500ms instead of based on the interval value selected on the General tab.

Update:
A test build where the delay between screenshots will be dynamically scaled up can be found here in a few minutes:
I would appreciate if you could give this a try and check if the issue is resolved.
To be able to download it you will have to log into GitHub - let me know if that should be an issue for you.
Here it is, I think. So I do think it has to do with Check Switch conditions time interval. You had suggested 50 (lowest) to speed my macro execution in another post.
New code I tried and screen blinks once and then freezes and then OBS crashes/goes away but no crash log is asked about to save. That seams to be intermittent as to when OBS asks to save a crash log but when I looked for it the only one I found was for yesterday but it might help. Apparently saving of the log is not automatic.

Does not show issue with older version as previously stated
 

Attachments

  • Crash 2023-01-30 09-19-42.txt
    150 KB · Views: 4
  • adv-ss-failure.txt
    416.1 KB · Views: 6

DougCPilot

New Member
Hello! I've done some live streaming using OBS with one camera. It was easy enough to set it to fade from my opening mp4 scene to the live camera scene. Now, I'd like to experiment with having 2 cameras and having the view switch randomly between the two. I followed the guide for "automatically cycling through a list of scenes" using macros and I got that working between the two camera scenes. But if I include the mp4 in that same macro, it's included in the loop. How would I set it up so that the mp4 would play once when I begin the stream, and then fade to the macro that loops the cameras?

Thanks in advance for the help. And thanks for creating this awesome plugin!
 

Warmuptill

Active Member
Here it is, I think. So I do think it has to do with Check Switch conditions time interval. You had suggested 50 (lowest) to speed my macro execution in another post.
New code I tried and screen blinks once and then freezes and then OBS crashes/goes away but no crash log is asked about to save. That seams to be intermittent as to when OBS asks to save a crash log but when I looked for it the only one I found was for yesterday but it might help. Apparently saving of the log is not automatic.

Does not show issue with older version as previously stated
It seems that in the settings file you shared the pattern threshold values are all set to zero.
That means that pretty much any pattern will match everywhere in the image.

Is trying to visualize the current matches maybe fully loading whichever CPU core is used for displaying the UI of OBS and thus causing the apparent freeze? (You seem to have a lot of video condition check active.)

I assume this is probably not intended and what likely happened is that, you exported the settings on version 1.20.x and imported them on 1.19.x.
The settings formats are unfortunately not backwards compatible in the sense that you can import settings files from newer version of the plugin on older versions. (The other way around should work in almost all cases)

Hello! I've done some live streaming using OBS with one camera. It was easy enough to set it to fade from my opening mp4 scene to the live camera scene. Now, I'd like to experiment with having 2 cameras and having the view switch randomly between the two. I followed the guide for "automatically cycling through a list of scenes" using macros and I got that working between the two camera scenes. But if I include the mp4 in that same macro, it's included in the loop. How would I set it up so that the mp4 would play once when I begin the stream, and then fade to the macro that loops the cameras?

Thanks in advance for the help. And thanks for creating this awesome plugin!
You will have to introduce additional macros and pause / unpause the sequence macro you created already.

First create a macro that does whatever should happen when you start streaming.
In this example it will switch to a given scene and wait there for a fixed amount of time.
Make sure to add an additional action to the end of the macro handling the stream start that "unpauses" the sequence macro you created previously.

StreamStart.PNG


Next add one more macro that pauses the Sequence macro when you start the plugin.

OBSStart.PNG


There are of course many other ways of doing the same thing which might be better suited to your set up, but I still hope this example helped! :)
 

videored

New Member
Is it normal that my CPU usage went way up on OBS after updating this? All I did was that and I went from single digits to something like 14 to 20% all the time. I even got a few rare crashes here and there.

There's also a bug where if you group some macros with the recently added feature to group them into a folder and then delete one macro, the grouped folder disappears and (Most of the time) OBS just crashes.
 

Héraès

Member
Hello. It's been years that I want to find a way to go back to a "main scene" that I would define at some moment during my stream, to just go back to it by pushing a key. I know there is a plugin to go back to the previous scene, but if I have switched to numerous scenes, I would prefer a way to go back to it by a single push, instead of pressing several time a <previous> key.

For now the only solution I found was to create a "meta" scene, in wich I import all the other scenes, and I chose the one visible in it.

Could you help me to solve this old "problem" with a tiny addition to your plugin ?
Here's the idea :

- Add a "Define scene as main scene" action in your plugin.
- Add also a "Go to main scene" action.

So in your plugin, we could create a first macro in wich :
- Condition : When > Hotkey "X" pressed (I chosed the X key as an example)
- Action : Define scene as main scene. (your plugin would get the actual name scene and store it in a variable)

And we would create a second macro :
- Condition : When > Hotkey "Y" pressed (an other key here)
- Action : Go back to the main scene. (your plugin would use the content of the variable)
 

kdarroch

Member
It seems that in the settings file you shared the pattern threshold values are all set to zero.
That means that pretty much any pattern will match everywhere in the image.

Is trying to visualize the current matches maybe fully loading whichever CPU core is used for displaying the UI of OBS and thus causing the apparent freeze? (You seem to have a lot of video condition check active.)

I assume this is probably not intended and what likely happened is that, you exported the settings on version 1.20.x and imported them on 1.19.x.
The settings formats are unfortunately not backwards compatible in the sense that you can import settings files from newer version of the plugin on older versions. (The other way around should work in almost all cases)


You will have to introduce additional macros and pause / unpause the sequence macro you created already.

First create a macro that does whatever should happen when you start streaming.
In this example it will switch to a given scene and wait there for a fixed amount of time.
Make sure to add an additional action to the end of the macro handling the stream start that "unpauses" the sequence macro you created previously.

View attachment 91229

Next add one more macro that pauses the Sequence macro when you start the plugin.

View attachment 91228

There are of course many other ways of doing the same thing which might be better suited to your set up, but I still hope this example helped! :)

It seems that in the settings file you shared the pattern threshold values are all set to zero.
That means that pretty much any pattern will match everywhere in the image.

Is trying to visualize the current matches maybe fully loading whichever CPU core is used for displaying the UI of OBS and thus causing the apparent freeze? (You seem to have a lot of video condition check active.)

I assume this is probably not intended and what likely happened is that, you exported the settings on version 1.20.x and imported them on 1.19.x.
The settings formats are unfortunately not backwards compatible in the sense that you can import settings files from newer version of the plugin on older versions. (The other way around should work in almost all cases)


You will have to introduce additional macros and pause / unpause the sequence macro you created already.

First create a macro that does whatever should happen when you start streaming.
In this example it will switch to a given scene and wait there for a fixed amount of time.
Make sure to add an additional action to the end of the macro handling the stream start that "unpauses" the sequence macro you created previously.

View attachment 91229

Next add one more macro that pauses the Sequence macro when you start the plugin.

View attachment 91228

There are of course many other ways of doing the same thing which might be better suited to your set up, but I still hope this example helped! :)
Try 2,

latest load you wanted me to try.
Apparently somehow it set all of the match conditions to 0 and the area to 0-0-0-0
Fixed all of that and while I no longer get screen capture error OBS crashes every time I go to select the area to check in.
I also unchecked the box for the option on all macros and was picking 1 by 1 to set back up.
never make it past 1st area select and OBS crashes sometimes writing a crash report but mostly just disappearing.

also, is there a save button somewhere? I know it saves after exiting but what about while editing? A save button would be awesome, maybe I am missing something
 

Attachments

  • adv-ss-test-2_V1 2-2023.01.31.18.28.30.txt
    460.1 KB · Views: 6
  • Crash 2023-01-31 18-17-36.txt
    150 KB · Views: 7

Warmuptill

Active Member
Is it normal that my CPU usage went way up on OBS after updating this? All I did was that and I went from single digits to something like 14 to 20% all the time. I even got a few rare crashes here and there.

There's also a bug where if you group some macros with the recently added feature to group them into a folder and then delete one macro, the grouped folder disappears and (Most of the time) OBS just crashes.
No, such a drastic increase in CPU usage would be quite surprising in fact.
Can you share the settings you are using? (You can export them to a file on the General tab)
Does the high CPU usage go away after stopping the plugin?

The bug regarding grouping was (hopefully) fixed in the update released yesterday.
If you install the newest version the broken folders will be removed. (no macros will be removed)

Hello. It's been years that I want to find a way to go back to a "main scene" that I would define at some moment during my stream, to just go back to it by pushing a key. I know there is a plugin to go back to the previous scene, but if I have switched to numerous scenes, I would prefer a way to go back to it by a single push, instead of pressing several time a <previous> key.

For now the only solution I found was to create a "meta" scene, in wich I import all the other scenes, and I chose the one visible in it.

Could you help me to solve this old "problem" with a tiny addition to your plugin ?
Here's the idea :

- Add a "Define scene as main scene" action in your plugin.
- Add also a "Go to main scene" action.

So in your plugin, we could create a first macro in wich :
- Condition : When > Hotkey "X" pressed (I chosed the X key as an example)
- Action : Define scene as main scene. (your plugin would get the actual name scene and store it in a variable)

And we would create a second macro :
- Condition : When > Hotkey "Y" pressed (an other key here)
- Action : Go back to the main scene. (your plugin would use the content of the variable)
That should be possible with a setup using a variable:
  • One macro is used to set the value of variable "Main Scene" to the name of the current scene if the hotkey "Set Main Scene" is pressed.

    The value for the "Main Scene" variable will set based on the "Scene" condition.
    It itself does not interfere with the logic of the hotkey press as any scene name will match the given regular expression pattern .*.
    So the condition logic for the macro basically results in If hotkey "Set Main Scene" is pressed AND true.

    SetMainScene.PNG
  • A second macro will have to be created that switches to a scene which matches the value of the variable "Main scene".

    SwitchMainScene.PNG
Let me know if you have any questions! :)

Try 2,

latest load you wanted me to try.
Apparently somehow it set all of the match conditions to 0 and the area to 0-0-0-0
Fixed all of that and while I no longer get screen capture error OBS crashes every time I go to select the area to check in.
I also unchecked the box for the option on all macros and was picking 1 by 1 to set back up.
never make it past 1st area select and OBS crashes sometimes writing a crash report but mostly just disappearing.
First of all, thank you very much for your support in helping figuring this out!
I really do appreciate it! :)
And sorry for causing you this much trouble!

I am glad to hear that the screen capture issue is resolved / understood.

Unfortunately, I am at a bit off a loss at the moment what could be causing your observed area sleection crashes.
The provided crash log does not point in the direction of the plugin but some Qt libraries.
It is still likely somehow related to something that the plugin does as you do not observe the crashes in other scenarios I assume, but it makes the analysis of the issue rather difficult.
I can also not reproduce the problem on my end for some reason.

Is there maybe some common feature of the type of sources that are causing these crashes?
Is it maybe the order of the steps you take before attempting to select the area?

also, is there a save button somewhere? I know it saves after exiting but what about while editing? A save button would be awesome, maybe I am missing something
The plugin settings are saved every time you close the settings dialog.
 
Last edited:

kdarroch

Member
No, such a drastic increase in CPU usage would be quite surprising in fact.
Can you share the settings you are using? (You can export them to a file on the General tab)
Does the high CPU usage go away after stopping the plugin?

The bug regarding grouping was (hopefully) fixed in the update released yesterday.
If you install the newest version the broken folders will be removed. (no macros will be removed)


That should be possible with a setup using a variable:
  • One macro is used to set the value of variable "Main Scene" to the name of the current scene if the hotkey "Set Main Scene" is pressed.

    The value for the "Main Scene" variable will set based on the "Scene" condition.
    It itself does not interfere with the logic of the hotkey press as any scene name will match the given regular expression pattern .*.
    So the condition logic for the macro basically results in If hotkey "Set Main Scene" is pressed AND true.

    View attachment 91240
  • A second macro will have to be created that switches to a scene which matches the value of the variable "Main scene".

    View attachment 91241
Let me know if you have any questions! :)


First of all, thank you very much for your support in helping figuring this out!
I really do appreciate it! :)
And sorry for causing you this much trouble!

I am glad to hear that the screen capture issue is resolved / understood.

Unfortunately, I am at a bit off a loss at the moment what could be causing your observed area sleection crashes.
The provided crash log does not point in the direction of the plugin but some Qt libraries.
It is still likely somehow related to something that the plugin does as you do not observe the crashes in other scenarios I assume, but it makes the analysis of the issue rather difficult.
I can also not reproduce the problem on my end for some reason.

Is there maybe some common feature of the type of sources that are causing these crashes?
Is it maybe the order of the steps you take before attempting to select the area?


The plugin settings are saved every time you close the settings dialog.
Ok,

Tried it with different video sources (camera, screen capture, scene vs. straight feed, etc) crashes every time.

When i tried it with OBS main output it crashes as well but no crash report.

Attached are all the crash reports
 

Attachments

  • Crash 2023-02-01 04-28-00.txt
    150 KB · Views: 4
  • Crash 2023-02-01 04-29-30.txt
    150 KB · Views: 4
  • Crash 2023-02-01 04-30-58.txt
    150 KB · Views: 4

kdarroch

Member
Ok,

Tried it with different video sources (camera, screen capture, scene vs. straight feed, etc) crashes every time.

When i tried it with OBS main output it crashes as well but no crash report.

Attached are all the crash reports
Don't worry about any trouble I am having, this plugin is awesome and I am amazed at how much it can do/automate. Just a glitch somewhere that I am confident will work itself out at some point.

I am going to go back in time and see if I can get everything working again and that might help identify the problem.

If I understand correctly, I will need to load the scene switcher setup from before the update as once it is exported from a newer version of the plugin it cannot be used in a previous version of the plugin

Thanks for all of the help
 
Top