Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Warmuptill

Active Member
Is there a way to set a variable to a fixed value based on what's written inside a .txt file? I keep track of certain stuff in a single line in a .txt and it would help me a lot (Considering that I've seen this can do the opposite already, modify a .txt file).
I think something similar to this should do what you want to achieve.
It assigns the content of a given file to a variable.

Variable.PNG
 

TazChris94

New Member
I'd do this:
View attachment 93930
Notable differences are:
  • Only on change
    • I use this for everything! It ensures that the macro only runs once when the condition becomes true, instead of continuously while it's true.
  • Any source on Current Scene
    • This works regardless of what you add or remove later, so you don't have to keep coming in here and changing the macros. If you have multiple videos and you only want it to do this for one of them, then you would still specify the exact one, instead of Any on Current.
  • Playing and less than X time remaining
    • This gives it X time to figure out that the condition is true (check your scan interval on the General tab), but it's usually pretty quick about it.
    • Ended has always been somewhat vague to me. Does it have to have been playing first? Or is it *always* Ended, except for when it's playing, even if it hasn't played at all yet? Depending on the answer to that, is the Ended signal short enough to be missed sometimes? Playing and almost done, doesn't have that ambiguity.
  • Transition over the same X time
    • This gives a nice professional look, as the video is practically over anyway, and the last X time of it is still playing during the transition. That gives the impression that it could have gone on longer, but you made a production decision to end it there. In other words, you appear proactive instead of reactive.

Thank you for the information. I actually found that in the general settings section, that 'if no actions performed for x seconds' was set to switch to a scene. I set this to do not switch and it fixed the initial issue. But I also discovered that ended is ended, and it was thus running each time. So, your solution makes sense and should work without issue.

Chris
 

megavapor

New Member
im need simple change the title live before initiate, im use .bat to start and stop stream automate, via scheduletask , its work, but im need change one by one the titles and midia in youtube, hard job...
need comand to add .bat change title
or change title in open obs, im use (start /d "D:\youtube\obs mega1\bin\64bit" obs64.exe --portable --scene "a" --collection "1" --startstreaming --minimize-to-tray)
or obs script to change title schedule, from list titles ramdom
please sugestions thanks
 

pepvk0

New Member
New here. I have searched but couldn't find it, sorry if the question is already answered.
Using studio mode, what I would want OBS to do is switch the Preview to the "next in line" Scene after a media file has finished playback.
e.g. I have in my scene list from top to bottom: Scene0 blackout, Scene1 containing media1, Scene2 containing media2, Scene3 containing Media3. I begin with Program: blackout and Preview: Scene1. Now I press <Transition> and Scene1 becomes Program playing back Media1. Now as soon as Media1 is finished playing back (and becomes black due to "show nothing when playback ends" being ticked in Media1 properties), I want Scene2 to become the Preview. Then I press <Transition> and Media 2 starts playback, and when it's finished Scene3 is in the Preview, etc.etc.
Any way I can achieve this?
Using it for basic theatre playback btw.

TL;DR Is there a way to automate sequential playback of Scenes containing Media?
edit: syntax
 

AaronD

Active Member
Using studio mode, what I would want OBS to do is switch the Preview to the "next in line" Scene after a media file has finished playback.
Now as soon as Media1 is finished playing back (and becomes black due to "show nothing when playback ends" being ticked in Media1 properties), I want Scene2 to become the Preview. Then I press <Transition> and Media 2 starts playback, and when it's finished Scene3 is in the Preview, etc.etc.
Using it for basic theatre playback btw.
I was going to suggest immediate playback, one after the other, so you wouldn't have to hit the button every time, but your mention of theater made it "click". I've done sound for some theatrical performances and seen behind the scenes of some others, and yeah, you can't automate the timing like that! What you asked for is exactly what you need.

It's not far off either, from what I do already for some of my rigs:
1683859354163.png

The idea there is to switch back to whatever camera it was on (previous scene) after anything is finished playing, without having to come in here and change the macro every time to look for a specific video. But you actually *want* a specific video, or rather, several of them with different actions for each:
1683859474681.png

Right-click and Duplicate this one for as many videos as you have, and edit accordingly. I kept the "Playing and almost done" logic, as I think it's easier to understand at a glance how it works, than "Ended" is. The "only on change" checkbox is less important for this one than it might be for others, but I just have it on everything anyway. It makes it run *once* when the condition becomes true, instead of *continuously* while the condition is true.
 

Warmuptill

Active Member
im need simple change the title live before initiate, im use .bat to start and stop stream automate, via scheduletask , its work, but im need change one by one the titles and midia in youtube, hard job...
need comand to add .bat change title
or change title in open obs, im use (start /d "D:\youtube\obs mega1\bin\64bit" obs64.exe --portable --scene "a" --collection "1" --startstreaming --minimize-to-tray)
or obs script to change title schedule, from list titles ramdom
please sugestions thanks
What exactly are you referring to here with "title"?
Is this some text source inside of OBS or the title of your broadcast on the streaming website you are using?
In case of the former you can use the "Source" action to adjust the settings of a text source.
In case of the latter I am unfortunately not sure if that is doable with this plugin.
 

RoyceRemix

New Member
So I think I'm nearly there... I have a few dozen short videos, and when I go to the scene they're in, I want the 1st video to play - Then the next time I leave and return to the scene I want just the 2nd video to play, etc. I currently have a variable incrementing and being appended to another "prefix" variable, but when I go to enable a source called the variable, AdvSS warns that the obs UI cannot globally control sources, and it doesn't work.

Is this possible to set up? Also I see there's Macro Reset Counter, not sure what this means but maybe could help?
 

Attachments

  • SpyMacro-01.png
    SpyMacro-01.png
    50.8 KB · Views: 28

Warmuptill

Active Member
So I think I'm nearly there... I have a few dozen short videos, and when I go to the scene they're in, I want the 1st video to play - Then the next time I leave and return to the scene I want just the 2nd video to play, etc. I currently have a variable incrementing and being appended to another "prefix" variable, but when I go to enable a source called the variable, AdvSS warns that the obs UI cannot globally control sources, and it doesn't work.

Is this possible to set up? Also I see there's Macro Reset Counter, not sure what this means but maybe could help?
I think you are looking for the "Scene Item Visibility" action and not the "Source" action.
 

BobbyJones

New Member
Amazing Plugin!

2 Problems I am facing:

1. is it possible to define an ELSE statement ? I check an area for pattern, if match, source becomes visible. Now I want the source to be invisible if pattern does NOT match, but I dont see option for Else statement. Workaround is creating mirrored condition, but thats extra computing requirement :(

2. I see no color matching, only pattern. Now I could make a green pattern image, but isnt it easier to compute just checking for color ?
 

AaronD

Active Member
1. is it possible to define an ELSE statement ? I check an area for pattern, if match, source becomes visible. Now I want the source to be invisible if pattern does NOT match, but I dont see option for Else statement. Workaround is creating mirrored condition, but thats extra computing requirement :(
You could do this in a second macro:
1684161754008.png


2. I see no color matching, only pattern. Now I could make a green pattern image, but isnt it easier to compute just checking for color ?
You might be right on that one. There's average brightness, which is fairly easy to specify, but I don't see color either:

1684161956789.png

Having some experience myself behind the scenes of this sort of thing, average color is not all that hard to compute, but it *is* surprisingly hard to specify.
  • Do you want a brightness calculation of a specific channel instead of overall?
  • Do you want an exact color? That works for computer-generated things but not a camera. A camera would need a tolerance, so how do you specify that tolerance?
  • What about different color spaces? RGB, HSV, YCrCb, etc. Each of them makes different things easy or hard.
Again, it's entirely doable, but you have a lot more questions to answer about how it should work.
 

BobbyJones

New Member
You could do this in a second macro:
View attachment 94154


You might be right on that one. There's average brightness, which is fairly easy to specify, but I don't see color either:

View attachment 94155
Having some experience myself behind the scenes of this sort of thing, average color is not all that hard to compute, but it *is* surprisingly hard to specify.
  • Do you want a brightness calculation of a specific channel instead of overall?
  • Do you want an exact color? That works for computer-generated things but not a camera. A camera would need a tolerance, so how do you specify that tolerance?
  • What about different color spaces? RGB, HSV, YCrCb, etc. Each of them makes different things easy or hard.
Again, it's entirely doable, but you have a lot more questions to answer about how it should work.
it should work as easy as possible :) I think RGB is most common. And if putting a threshold, it should even trigger on different color spaces.
Actually it can work similar to the pattern match selecting a specific area, just with color and Threshold. It would make things easier and expecially less processing power requirement than comparing to a pattern I guess. Would love to see this being possible

By the way just pointing out a very high demanded scenario for this plugin: Streamers using a widescreen monitor often face the issue that UI Game elements are not on stream, if playing on Widescreen (21:9), but only streaming the 16:9 Format. (UI elements are on the most right/left)
Some games offer to move UI elments, some dont.
A way to do that is cutting the elment from the original 21:9 source and adding them to the streamend 16:9 source with a mask.
The Problem though is that if the Game changes to different screens, those mask will show nonsense :) So This plugin here can check for specific colors / patterns, and show/hide those added UI elements only, if they are being shown. Also one of the scenarios I am using it.
 
Last edited:

AaronD

Active Member
it should work as easy as possible :) I think RGB is most common. And if putting a threshold, it should even trigger on different color spaces.
Actually it can work similar to the pattern match selecting a specific area, just with color and Threshold.
If you really understand how the color spaces work, you'll see that that's technically nonsense. Yes, it makes perfect sense to a layman, but good luck coding it!

For example, where you see "orange", a computer only sees numbers:
  • RGB: Red = 100%, Green = 50%, Blue = 0%
  • HSV: Hue = 30deg, Saturation = 100%, Value = 100%
  • YCrCb: Luminance = 57%, Chrominance_Red = 27%, Chrominance_Blue = -31%
This is using the BT.709 standard for YCrCb. Other standards exist too, which give slightly different results.

  • If you've somehow encoded some other information in the RGB channel values because those are the most accessible for you or because our eyes see that directly, then of course you'll want to use that.
  • If you're looking for a specific color in a scene, regardless of lighting, then HSV or something similar might be good. RGB is terrible for that.
  • YCrCb is often used in broadcast because it provides the brightness directly and the color separate from that. Once that exists, the two sets of information can be encoded differently, to preserve the brightness more than the color. (this was even true in analog TV, to be backwards-compatible with black-and-white sets) OBS's default is NV12, which is a specific version of this. If you're detecting something related to the details of broadcast, then you'll probably want to use this one.
Etc.

The different color spaces don't really matter as much for picking the color to start with, as the software can easily do that conversion. The trouble comes in specifying the tolerance. It's completely different, for just one example, to specify a color in a scene as range of Red, a range of Green, and a range of Blue, than it is to specify a range of Hue, and completely ignore the Saturation and Value.
 
Last edited:

BobbyJones

New Member
If you really understand how the color spaces work, you'll see that that's technically nonsense. Yes, it makes perfect sense to a layman, but good luck coding it!

For example, where you see "orange", a computer only sees numbers:
  • RGB: Red = 100%, Green = 50%, Blue = 0%
  • HSV: Hue = 30deg, Saturation = 100%, Value = 100%
  • YCrCb: Luminance = 57%, Chrominance_Red = 27%, Chrominance_Blue = -31%
This is using the BT.709 standard for YCrCb. Other standards exist too, which give slightly different results.

  • If you've somehow encoded some other information in the RGB channel values because those are the most accessible for you or because our eyes see that directly, then of course you'll want to use that.
  • If you're looking for a specific color in a scene, regardless of lighting, then HSV or something similar might be good. RGB is terrible for that.
  • YCrCb is often used in broadcast because it provides the brightness directly and the color separate from that. Once that exists, the two sets of information can be encoded differently, to preserve the brightness more than the color. (this was even true in analog TV, to be backwards-compatible with black-and-white sets) OBS's default is NV12, which is a specific version of this. If you're detecting something related to the details of broadcast, then you'll probably want to use this one.
Etc.

The different color spaces don't really matter as much for picking the color to start with, as the software can easily do that conversion. The trouble comes in specifying the tolerance. It's completely different, for just one example, to specify a color in a scene as range of Red, a range of Green, and a range of Blue, than it is to specify a range of Hue, and completely ignore the Saturation and Value.
I think as long as the thresshold can be changed, the colorspace of the user should not be so much of a problem, as he can change the thresshold according if it triggers the match or not, while debugging (match is blinking green in the rules page).
 

Warmuptill

Active Member
I think as long as the thresshold can be changed, the colorspace of the user should not be so much of a problem, as he can change the thresshold according if it triggers the match or not, while debugging (match is blinking green in the rules page).
I will try to look into it. :)
 

AaronD

Active Member
I think as long as the thresshold can be changed, the colorspace of the user should not be so much of a problem, as he can change the thresshold according if it triggers the match or not, while debugging (match is blinking green in the rules page).
It's not a single threshold. See the end of my previous post...
 

qwe1154323937

New Member
1.22.0 Added MIDI, but I don't have such a device (external sound effect device?)
So I can only translate through a literal understanding, if I meet someone who has such a device, I will translate this aspect and re-translate it later.
The uploaded file is the translated Chinese file, please add it in the current version or the next version, thanks.
 

Attachments

  • 1.22.0 Chinese - zh-CN.rar
    17.9 KB · Views: 15
Top