Resource icon

Advanced Scene Switcher 1.25.3

bcoyle

Member
Hello,

Thanks for that useful plugin!

Is there an opportunity to make an easy schedule by importing a text file that says when to show which scene?

And how can I consider time zones? For example, when a time repeats at the end of daylight saving time, how can I say: show this on 2.30 DST and show that on 2.20 Standard time (2.20 standard comes after 2.30 daylight saving time). All in UTC would be easier. :)

Thanks!
You should come over to the 24/7 broadcast thread
 

Lawrence_SoCal

Active Member
an incomplete settings file only replaces what's present in the file and leaves everything else unchanged.
Personally, if something like that was to be implemented, I'd want the option of how to handle an Import. There are times when you are intentionally removing stuff... ie when I import settings, the ONLY settings I want are those in the Import.
just pointing out different use case/workflow considerations
 
Last edited:

kdarroch

Member
Sor
How long does it usually / in the worst case take for the plugin to run through all your macros?
What types of actions are they performing? (In particular are any "Wait" actions or other time consuming actions used?)

The way the macro system currently operates is that it checks each macro's condition sequentially and in a second step then perform all actions.

So if the condition checks themselves are processed quickly, the main way to reduce the time it takes to recognize changes is to reduce the scene switcher interval on the General tab.

View attachment 90001

The default is 300ms - I guess you could try to use 50ms.

But with the video condition I could guess that the issue is not the switcher interval, but the time it takes to process each image.
Can you check if you see the following messages in your OBS log?
spent <number here> ms in <name here> condition check of macro <name here>

If that is the case you could try to set up some logic so that not all macros containing video conditions are active all the time.

The actions section of each macro is also performed sequentially by default, starting with the top most macro.
So if you have a set of macros that are waiting or performing other tasks for extended periods of time, you will run into the situation that other macros will be delayed.
To work around this you can enable the option to run the macros containing the "slow" action(s) in parallel the other macros, so it no longer blocks the execution of other actions.

View attachment 90002
ry, been busy on other stuff.
get alot of the following in the log, not sure what it means

10:09:43.634: [adv-ss] Failed to get screenshot in time for source Screen Capture
10:09:43.634: [adv-ss] spent 300 ms in video condition check of macro '25A'!

lines of that for each macro ( 24A..25A..26A..etc)

Going to try the other ideas you suggested and see it it helps.

What I don't understand is if it's the time to compare / process the source image then why is the CPU usage still almost nothing? Is the video card doing the work?

Thanks for any help
 

Xariscd

New Member
is it possible with this plugin to be able to change the position of the ndi camera from one present to another present at the speed that i want?, in fact i want the camera makes a walk and returns to the original position again.all this autotikally
 
Last edited:

Warmuptill

Active Member
What I don't understand is if it's the time to compare / process the source image then why is the CPU usage still almost nothing? Is the video card doing the work?
To be honest I am not sure if the OpenCV libraries are also using parts of the GPU.

But the main point is that the macros and their conditions are checked sequentially.
Thus generally speaking the plugin will only ever use a single core of your CPU at most.

In addition to that the plugin will also "go to sleep" for at least 50ms each time, which further reduces the CPU load.

is it possible with this plugin to be able to change the position of the ndi camera from one present to another present at the speed that i want?, in fact i want the camera makes a walk and returns to the original position again.all this autotikally
I think you might be able to achieve what you are looking to do with a combination of the move transition plugin and this plugin.
I believe it provides a filter you can apply to a source to move it.
This you could toggle via the advanced scene switcher.

Unfortunately I am not really familiar with the move transition plugin myself so I cannot give a concrete example on how to set this up.
 

kdarroch

Member
To be honest I am not sure if the OpenCV libraries are also using parts of the GPU.

But the main point is that the macros and their conditions are checked sequentially.
Thus generally speaking the plugin will only ever use a single core of your CPU at most.

In addition to that the plugin will also "go to sleep" for at least 50ms each time, which further reduces the CPU load.


I think you might be able to achieve what you are looking to do with a combination of the move transition plugin and this plugin.
I believe it provides a filter you can apply to a source to move it.
This you could toggle via the advanced scene switcher.

Unfortunately I am not really familiar with the move transition plugin myself so I cannot give a concrete example on how to set this up.
Thanks for the info, Will set the time to 50ms and check the run macro's in parallel and see what happens.

So I guess there is no way to just let it run and load the CPU down? Looks like it is designed not to load the CPU but for me I have plenty of CPU and would rather things run faster. I realize at some point it might load the cpu too much but right now it's running less than 10%
 

huuich

New Member
Can you elaborate on what the condition is supposed to do / what the circumstances are in which you want to stop streaming?

As far as I understand a source can be active, but not visible.
A source that is showing is always active.

Depending on what you have in mind with your condition you might also want to have a look at "Scene item visibility".
@Warmuptill I want to stop streaming automatically when a zoom meeting is ended, so I've tried "Scene item visibility" like you guess, I have 2 Sources, 1 is zoom and 2 is Image, but it always automatic stop Streaming though zoom is running or not

Stop-scene.jpg


I tried automatically stop streaming by audio volume like this picture. I want to if audio below 8% in 1 minute, Streaming is stopped automatically, but still not successfully. I don't know how to solve my problem with stop streaming automatically. Please give me an advice. Thanks!

Stop-audio.jpg
 

AaronD

Active Member
@Warmuptill I want to stop streaming automatically when a zoom meeting is ended, so I've tried "Scene item visibility" like you guess, I have 2 Sources, 1 is zoom and 2 is Image, but it always automatic stop Streaming though zoom is running or not

View attachment 90735

I tried automatically stop streaming by audio volume like this picture. I want to if audio below 8% in 1 minute, Streaming is stopped automatically, but still not successfully. I don't know how to solve my problem with stop streaming automatically. Please give me an advice. Thanks!

View attachment 90736
"Active" or "Visible" doesn't necessarily mean that the audience can see it. You can have two full-screen things in the same scene, both enabled, and both reporting "Active" or "Visible", but the audience will only see one of them because it covers the other. To my knowledge, there's no way to tell programmatically what the audience actually sees, at least not reliably in every case. You have to infer that by the way that things are structured and what logic you use to detect it.

Also, if a source shows transparent or isn't receiving anything, there's no way to tell that at all, except possibly for an image match...sometimes. It's still on, and reported as such.

Audio falling silent seems to me like the better option, out of the two that you presented, but still not good enough as I see it, to use for something important. At least not by itself. For example, what if everyone goes quiet for longer than the timer? Is there enough background noise to keep the macro from triggering? In other words, does the meeting's internal noise suppressor fail badly enough for you to use it as a "meeting active" indicator?



Thinking outside the box a bit, what if you had a script that started the meeting, waited for the meeting program to finish, and then did something to trigger the macro? You'll have to know the command line to start the meeting, which you can get from the shortcut that you normally use to start it. Put that in a script, and either change the shortcut to run the script instead, or make a new shortcut to do that.
(or you might even use the Run action in a macro to run the script, so that you only start OBS, and also get the meeting automatically)

By default, a script will wait until each command is done before continuing, which is what you want in this case. Not-waiting takes something extra, like a & on the end for Linux Bash scripts or a start "" at the front for Windows Batch. Don't include that, and it'll wait instead.

Then think about what you can do in a script, that a macro can pick up. Lots of possibilities there.
 
Last edited:

Warmuptill

Active Member
Streaming is stopped automatically, but still not successfully.
Sorry for yet again replying with another questions.
What exactly do you mean by "streaming is stopped, but not successfully"?
Is the action performed and OBS reports that the stream is stopped, but whatever streaming service you are using is still reporting that you stream is online?

I want to stop streaming automatically when a zoom meeting is ended
Is it maybe possible to simply check if the zoom application is running still?
If so, something like this might work:

Zoom.PNG


Or maybe you could use the "Window" condition to check for changes in the window title? (Not really familiar with how Zoom behaves in that regard)
 

huuich

New Member
Thinking outside the box a bit, what if you had a script that started the meeting, waited for the meeting program to finish, and then did something to trigger the macro? You'll have to know the command line to start the meeting, which you can get from the shortcut that you normally use to start it. Put that in a script, and either change the shortcut to run the script instead, or make a new shortcut to do that.
(or you might even use the Run action in a macro to run the script, so that you only start OBS, and also get the meeting automatically)

By default, a script will wait until each command is done before continuing, which is what you want in this case. Not-waiting takes something extra, like a & on the end for Linux Bash scripts or a start "" at the front for Windows Batch. Don't include that, and it'll wait instead.

Then think about what you can do in a script, that a macro can pick up. Lots of possibilities there.
@AaronD Thank you for detailed explanation. I haven't much experience about code and script so I don't know how to do with your guess. Could you give me a clue to start with script for OBS?
Sorry for yet again replying with another questions.
What exactly do you mean by "streaming is stopped, but not successfully"?
Is the action performed and OBS reports that the stream is stopped, but whatever streaming service you are using is still reporting that you stream is online?
Sorry for the unclear explanation. I mean when I set it up like that, the streaming stops immediately without stopping at the time I want.
Is it maybe possible to simply check if the zoom application is running still?
If so, something like this might work:
Zoom application is running still with 2 processes zoom.exe but your tutorial image and suggestions below have helped me to have a pretty optimal solution.
Or maybe you could use the "Window" condition to check for changes in the window title? (Not really familiar with how Zoom behaves in that regard)
This suggestion of yours helped me find the solution is to select the window titled Zoom Meeting if it does not exist, it will stop Streaming as shown. I respond and post the solution so that if someone else has a similar problem they will find a solution. Thanks for all the suggestions and feedback. OBS and Advanced Scene Switcher are awesome.
obs-auto-stop-streaming-solution.jpg
 

AaronD

Active Member
@AaronD Thank you for detailed explanation. I haven't much experience about code and script so I don't know how to do with your guess. Could you give me a clue to start with script for OBS?
Since you never specified what operating system you're on, I'll give you two examples that do the same thing. The specific syntax is OS-specific, but the concept is the same.

Linux:
Bash:
#!/bin/bash

# This is a comment, not executed.  Anything without the # in front is executed.
# The first line tells the system what program to use to interpret this script.



# Copy this line from the shortcut that you normally use to start it:
zoom [options]

# Create or overwrite a text file with "some_trigger" in it:
echo "some_trigger" > /path/to/trigger_file



# The script is done now.  Set up AdvSS to trigger on that file.
Set the permissions to make this script file executable, and run it instead of Zoom directly.

Windows:
Code:
@echo off

REM This is a comment, not executed.  Anything without a REM in front is executed.
REM The first line de-clutters the terminal window by not printing the commands.



REM Copy this line from the shortcut that you normally use to start it:
zoom.exe [options]

REM Create or overwrite a text file with "some_trigger" in it:
echo "some_trigger" > C:\path\to\trigger_file.txt



REM The script is done now.  Set up AdvSS to trigger on that file.
Change the file extension of this script to .bat, and run it instead of Zoom directly.
 

AaronD

Active Member
Come to think of it, if all the script does is wait for a single thing to finish, and then trigger AdvSS, can the Run action in AdvSS do the same thing? I've never had a reason to try it.

So instead of a script, you'd have a macro instead with 2 actions in it:
  1. Run Zoom, with arguments copied from the normal shortcut (or perhaps modified/added for further automation), and wait for it to finish while continuing to run other macros.
  2. End-of-Zoom "something". I think you wanted to stop streaming? There's a direct action for that.
The condition for that macro should be something that's always true, so that it runs on startup. Plugin-running, for one example. Or maybe you could have a hotkey if you don't want it to be always. At any rate, you don't use the shortcut anymore to start Zoom, but let the macro do it instead.
 

phillymantis

New Member
having a weird issue.....hard for me to grasp it myself

i set up the "podcast example" when i first got the plugin weeks ago and it worked flawlessly for 2 views a host and mixed view scenes

now it simply refuses to switch to the mixed view when two audio outputs trigger...instead choosing to quickly flash between the two individual views

i thought maybe my experimenting caused it so i created a whole new scene collection strictly following the example and get the same thing, very strange

maybe i can make a video showing the dilemna and log
 

Warmuptill

Active Member
having a weird issue.....hard for me to grasp it myself

i set up the "podcast example" when i first got the plugin weeks ago and it worked flawlessly for 2 views a host and mixed view scenes

now it simply refuses to switch to the mixed view when two audio outputs trigger...instead choosing to quickly flash between the two individual views

i thought maybe my experimenting caused it so i created a whole new scene collection strictly following the example and get the same thing, very strange

maybe i can make a video showing the dilemna and log
Unfortunately it is very difficult to tell what the issue is without having further details.
Can you share the settings you are using? (Export them to a file / share screenshots)
 
@Warmuptill Thanks for the new update and the reply!

I think a csv file with UNIX timestamps in UTC (this would mean that we don´t have daylight saving time in it) would be nice:

timestamp,scene,transition,duration
1674072000,"SCENE2","transition1",300
1674075600,"SCENE1","transition1",300
1674076500,"SCENE2","transition2",500
 

AaronD

Active Member
@Warmuptill Thanks for the new update and the reply!

I think a csv file with UNIX timestamps in UTC (this would mean that we don´t have daylight saving time in it) would be nice:

timestamp,scene,transition,duration
1674072000,"SCENE2","transition1",300
1674075600,"SCENE1","transition1",300
1674076500,"SCENE2","transition2",500
That might be the most useful from a coding perspective, but I think it would also mean that a translator would be needed to create the timestamps. I'm sure there are lots of free ones online, but for someone that only knows the GUI side of Windoze, it doesn't really mean anything. Maybe the plugin could have the translator built-in, or link to one?
 
Top