Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

padukunna

New Member
Hi, this is my first time posting here.
I have one camera hooked up to OBS and I'm using this plugin for a few tasks:
  1. Turn off monitor after 10 mins of idle time
  2. Change recording folder at change of date
  3. Stop recording when camera goes offline and start after it comes online
  4. Motion detection in a selected area and log it

I require help with #4.
Currently,I'm only able to log a message and not the timestamp when the macro is triggered.

What my requirement is, when the macro is triggered, save the current date and time in a variable and use that when writing to the log file.

This is my current macro. How do I get the current date and time?

1706945739228.png


Thanks in advance.
 

Warmuptill

Active Member
Hi, this is my first time posting here.
I have one camera hooked up to OBS and I'm using this plugin for a few tasks:
  1. Turn off monitor after 10 mins of idle time
  2. Change recording folder at change of date
  3. Stop recording when camera goes offline and start after it comes online
  4. Motion detection in a selected area and log it

I require help with #4.
Currently,I'm only able to log a message and not the timestamp when the macro is triggered.

What my requirement is, when the macro is triggered, save the current date and time in a variable and use that when writing to the log file.

This is my current macro. How do I get the current date and time?

View attachment 101372

Thanks in advance.
I would suggest to set up a helper macro which set up various variables.
You can use those to generate the desired timestamp string.
The macro should look something like this:
1707002475935.png


You can import this example using this code:
Code:
AAAVXnic7VhbbyI3FP4rlp/abaAMm220vG2zRIu0aVDIpqqqqDIzhxmLwR7ZHhYa8d97jj03GnVLSx4HgTT+zsXn8tmD/cw3Ijba8snvz1yJDfAJX4BjH4UD9iiMFMscLL/ghSgtClcit0AjI/Ic8gbQ6joTKm017FoW0x3Ed2rhhHENnhpdFs0o0fEap3NSpRjCMzeQSuvANAqZsPel+rl0Tis+caYM2JyieYHiTK60n8WyE1gm0yzHn5utrrVKpJNa2Qe0aDRM7f8Bdhgnx/nqfI9wPydKSvVS9iVgKI2PJgkRVUrt/EwYYBT28MjihgL6lomPeMgPF6FrH2ISNTqLIpcOizfX1o99TwvqbfT+3eGier56d3V4qhxM0V1w8s+2V9H7xnZElnWPPmm3hr3tcAIrEEC0fmoK1YWcTtMc5n+H2xL4eWOd56KwkDS+JT7yBDmJ9cp1KmOMBdlTGkFWtzqRK0mseeZObuAP9GedEVI5r2eBJvAE24qcWt88jIYod/uCHg8UsgwmWzDWlyE6IJyI/d3qV4C1lzXRhiAwqgcZFk6p2A0s2SUbjSbR28koYuPR+JK3SuNvaslUaQO09NrEPRT8B54bKEC066ksyPeduq/goFRX5n+m3Mn4OoN4XbstBHEEVfgQP+z4y4kcIv7XNm6rXQUTBkUPSe2+lvwS9qHfQBjeouMKnilMRCbM4/kSmIUc/LSojG1/DGlyHKly89hJutO46CeiRboB5WbJjk8GEY7L5cIZ3IqqHWvUheSf4BFkP+zmbR3e8Aq7FS7OvC/UWkmVoCEq0EJmTjNCvGqRixiOZRXIvkqX1e5wVa9kSm0LRepuvQ7zrmumi6rgI78ruGy6KwzY0En+HYvYD2zM3rC37Hv2IyOW4dq7Lq3Tm7nRm6JlklRF6WqMf0AXqWKeMxRj3YVJ8DDzyhR1pvOks2HLFwI+GGCVwTCH6Q4Gvu1babSi4j8et/zLYno/v7+7mX2eUjNjULBoukurO9D2on5V0VboYFOgm1YcEdFCHzzh9sSjA21i5zLyVivfoZ6SPSXPouTGE+lVOPlR7HtG9ow8l5H4wn8dPn7SZf/W7gl5NiEz4tHrvLWlKv3Joedkz8nzXtuBSa/CyoU/lPas7Fl5LivD9QayEs/f0Nzo0Bn8iaA6s6M7vupsbcW2Ug93GbASZe4ahhHP1fHR53SL8Mf0dP3qj8N/CKne1083aRbd6SYPYN0JBk+dCxQeDceXwzE//AVvTSre

Then you can reference those variables using the ${variable name here} syntax in various text fields throughout the plugin.
So a timestamp example could look like this:
1707002732476.png


This example would result in a line similar to this being appended to the given file:
My log message happened at: 2024-2-4-0-24-32

Hope that helps!
 

PaulCroft

New Member
Hi

I have a few macro set up in the Advanced Scene Switcher and they're all working great. The plug in is so intuitive its amazing. BUT I am trying to get my broadcasts to automatically start at a certain time and I just cannot get it to work. I have tired a few different things and right now my brain has gone to fog. I am including screenshots of my latest attempt that failed. I have a broadcast set up to go to YouTube. I have tried setting the same time on the schedule broadcast section for the Youtube video and that doesn't work either. Can you see anything I am doing incorrectly, or any advise?

TIA
Screenshot (2).png
Screenshot (3).png
 

AaronD

Active Member
Hi

I have a few macro set up in the Advanced Scene Switcher and they're all working great. The plug in is so intuitive its amazing. BUT I am trying to get my broadcasts to automatically start at a certain time and I just cannot get it to work. I have tired a few different things and right now my brain has gone to fog. I am including screenshots of my latest attempt that failed. I have a broadcast set up to go to YouTube. I have tried setting the same time on the schedule broadcast section for the Youtube video and that doesn't work either. Can you see anything I am doing incorrectly, or any advise?

TIAView attachment 101419View attachment 101420
The macro is called "Start", but its actions are Stop.
 

padukunna

New Member
I would suggest to set up a helper macro which set up various variables.
You can use those to generate the desired timestamp string.
The macro should look something like this:
View attachment 101392

You can import this example using this code:
Code:
AAAVXnic7VhbbyI3FP4rlp/abaAMm220vG2zRIu0aVDIpqqqqDIzhxmLwR7ZHhYa8d97jj03GnVLSx4HgTT+zsXn8tmD/cw3Ijba8snvz1yJDfAJX4BjH4UD9iiMFMscLL/ghSgtClcit0AjI/Ic8gbQ6joTKm017FoW0x3Ed2rhhHENnhpdFs0o0fEap3NSpRjCMzeQSuvANAqZsPel+rl0Tis+caYM2JyieYHiTK60n8WyE1gm0yzHn5utrrVKpJNa2Qe0aDRM7f8Bdhgnx/nqfI9wPydKSvVS9iVgKI2PJgkRVUrt/EwYYBT28MjihgL6lomPeMgPF6FrH2ISNTqLIpcOizfX1o99TwvqbfT+3eGier56d3V4qhxM0V1w8s+2V9H7xnZElnWPPmm3hr3tcAIrEEC0fmoK1YWcTtMc5n+H2xL4eWOd56KwkDS+JT7yBDmJ9cp1KmOMBdlTGkFWtzqRK0mseeZObuAP9GedEVI5r2eBJvAE24qcWt88jIYod/uCHg8UsgwmWzDWlyE6IJyI/d3qV4C1lzXRhiAwqgcZFk6p2A0s2SUbjSbR28koYuPR+JK3SuNvaslUaQO09NrEPRT8B54bKEC066ksyPeduq/goFRX5n+m3Mn4OoN4XbstBHEEVfgQP+z4y4kcIv7XNm6rXQUTBkUPSe2+lvwS9qHfQBjeouMKnilMRCbM4/kSmIUc/LSojG1/DGlyHKly89hJutO46CeiRboB5WbJjk8GEY7L5cIZ3IqqHWvUheSf4BFkP+zmbR3e8Aq7FS7OvC/UWkmVoCEq0EJmTjNCvGqRixiOZRXIvkqX1e5wVa9kSm0LRepuvQ7zrmumi6rgI78ruGy6KwzY0En+HYvYD2zM3rC37Hv2IyOW4dq7Lq3Tm7nRm6JlklRF6WqMf0AXqWKeMxRj3YVJ8DDzyhR1pvOks2HLFwI+GGCVwTCH6Q4Gvu1babSi4j8et/zLYno/v7+7mX2eUjNjULBoukurO9D2on5V0VboYFOgm1YcEdFCHzzh9sSjA21i5zLyVivfoZ6SPSXPouTGE+lVOPlR7HtG9ow8l5H4wn8dPn7SZf/W7gl5NiEz4tHrvLWlKv3Joedkz8nzXtuBSa/CyoU/lPas7Fl5LivD9QayEs/f0Nzo0Bn8iaA6s6M7vupsbcW2Ug93GbASZe4ahhHP1fHR53SL8Mf0dP3qj8N/CKne1083aRbd6SYPYN0JBk+dCxQeDceXwzE//AVvTSre

Then you can reference those variables using the ${variable name here} syntax in various text fields throughout the plugin.
So a timestamp example could look like this:
View attachment 101393

This example would result in a line similar to this being appended to the given file:
My log message happened at: 2024-2-4-0-24-32

Hope that helps!

Wow, this is brilliant and really helped and works like a charm.
Thank you @Warmuptill
 

PaulCroft

New Member
The macro is called "Start", but its actions are Stop.
Well that was my "duh" moment! This was just a test macro and the actual macro does have "start" I checked it again. The actual macro has a specific start time so I set up the test macro and missed the "stop" reference.
 

DZ_Da_Dude

New Member
Ok I never figured it out. It works on OBS but not live on twitch. here is what I'm trying to do

When I go live on twitch I want to add a small delay to allow people to join the stream.

After this small delay I want to start my "stream starting " animated screen scene (its 7 seconds long but I have it on loop) with the intro song playing

8 seconds before the song ends I want to switch to the animated logo intro scene (its 7 seconds) to play while the song finishes

After all of that is done go to the game capture.

How can I accomplish this if possible.start stream.pngswitch to intro.pngswitch to live feed.pngend stream.png
 

Warmuptill

Active Member
Ok I never figured it out. It works on OBS but not live on twitch. here is what I'm trying to do

When I go live on twitch I want to add a small delay to allow people to join the stream.

After this small delay I want to start my "stream starting " animated screen scene (its 7 seconds long but I have it on loop) with the intro song playing

8 seconds before the song ends I want to switch to the animated logo intro scene (its 7 seconds) to play while the song finishes

After all of that is done go to the game capture.

How can I accomplish this if possible.View attachment 101481View attachment 101482View attachment 101483View attachment 101480
Sorry to hear that you are having issues!
What exactly happens when it "does not work"? (Nothing at all? The plugin switches to the wrong scene?)

I can't spot any obvious issues, which would contradict your description, at the moment.
It might help to track down the issue if you enable verbose logging, reproduce the problem, and share the corresponding log file.
(With a timestamp when the issue occurred and what happened that shouldn't have / what did not happen but should have)
 

AaronD

Active Member
Ok I never figured it out. It works on OBS but not live on twitch. here is what I'm trying to do

When I go live on twitch I want to add a small delay to allow people to join the stream.

After this small delay I want to start my "stream starting " animated screen scene (its 7 seconds long but I have it on loop) with the intro song playing

8 seconds before the song ends I want to switch to the animated logo intro scene (its 7 seconds) to play while the song finishes

After all of that is done go to the game capture.

How can I accomplish this if possible.View attachment 101481View attachment 101482View attachment 101483View attachment 101480
I know how to do this on Linux, but I presume you're on Windows. Much less scriptability there, but maybe you can take my structure and figure something out.

---

Because you have a soundtrack that continues through multiple scenes, I'd use a global source for that. Set up a loopback (virtual speaker and mic pair, so whatever goes to that "speaker" appears in that "mic", and any app can use them as if they were physical), connect a global source in OBS (Settings -> Audio) to that virtual mic, and connect a remote-controllable player to that virtual speaker. Yes, you're playing that song outside of OBS, and piping it in as a live source. The remote control for that player is its own external program that goes in the Run action of Adv. SS.

On Linux, I'd use MPD as the external player, and its command-line controller MPC.
And just for my own comfortability, add a graphical controller as well. I like GMPC, even though it's no longer maintained or officially recommended. Still works just fine, but not strictly needed at all.
All three can be installed on Debian Linux and its derivatives (Ubuntu, Mint, etc.) with just one command line:
sudo apt install mpd mpc gmpc
It takes a while to wrap your head around the documentation for the command-line controller and what options to give it from Adv. SS' Run action, and especially for the player's config file, but then it works well. Things either work or they don't, with not much indication of why (I'm a casual programmer myself; good error messages are amazingly hard!), but once they work, they keep working.

---

Okay, now that you've got the sound outsourced and controlled from Adv. SS, and piped back into a global source in OBS, you can focus on the picture. The scenes themselves are silent, and you simply switch them as needed while the outsourced soundtrack continues unaffected.

For the media-ending trigger, I'd use this condition instead:
1707319267133.png

Of course, you can specify a particular media item instead of the "any" shown here, but "any" works too. Mine goes to the Previous Scene, to make it a truly-general "return from whatever", with nothing actually specified, but of course you can send it to a specific one instead.

I think the key here is "Playing and Time remaining shorter", instead of "Ended" or "Ending". Maybe those two work now, but I've had enough problems with them in the past, not triggering, that I did this instead. AND, triggering a half-second early allows a half-second transition while it's still playing (or however long you want to make it), which gives a much more professional look anyway.

---

So, between those two points and some timers, maybe that gets you going?

Also, instead of Wait actions, I like to use the Condition timers:
1707320243156.png

This gives you a series of short macros, compared to a single long macro with Waits. The huge advantage (IMO) is that you can escape the sequence easily, simply by switching to something else before the timer expires. And you can enter the sequence at any point, simply by switching to that scene, and it runs from there. It also makes it easy to loop several scenes, simply by sending the last one back to the first.

You can use that timer technique on anything, not just scenes. I do use Waits occasionally, but not very often, and they're always short. Mostly to avoid a race condition or let something stabilize, and not much more. All of my high-level timing is done as shown here.
 

Destroy666

Member
2 questions:
1. Can a variable dynamically refer to other variables? E.g. let's assume I used `${TickerSomePart} | ${TickerSomeOtherPart}` in save/load properties (which doesn't work = parse them) and then the variable would expand these each time it's used. Kind of like dynamic interpolation in programming.
2. If so, is there any way to track if the expanded content changes?

I'm pretty sure the answer to both is "no", but just making sure I'm not missing anything. The workaround is of course to use `Set to fixed value` variable action with text mentioned in question 1 once any of the parts changes. But that's not great to manage the more parts there are and the more times parts change. E.g. with 5 parts changing 3 times on average, you would have 15 places to change the action if you want to e.g. modify separators or add another part.

Maybe there's some better way I'm not thinking of.
 

Destroy666

Member
I guess another simplier way is to use a macro with bunch of or conditions checking if any of the parts changed and then the action is used once. Forgot that possibility existed for a second. Still not too great with nesting, but ofc better.
 

vanawesome

New Member
Does anyone know why when i rename a macro hotkey trigger, it still shows as
"macro_condition_hotkey_2" when i call it via websocket command "GetHotkeyList"

I'm tyring to write a python script that will send OBS a TriggerHotkeyByName command when a certain sensor is triggered. But, even tho I see the commands coming through via the websocket server connection, the hotkey itself it not being triggered. I'm a noob at python, so could be something I'm doing wrong.... but not sure why the websocket doesn't recognize the hotkey name change I gave it.

2024-02-08_23-31-48.jpg
 

vanawesome

New Member
Does anyone know why when i rename a macro hotkey trigger, it still shows as
"macro_condition_hotkey_2" when i call it via websocket command "GetHotkeyList"

I'm tyring to write a python script that will send OBS a TriggerHotkeyByName command when a certain sensor is triggered. But, even tho I see the commands coming through via the websocket server connection, the hotkey itself it not being triggered. I'm a noob at python, so could be something I'm doing wrong.... but not sure why the websocket doesn't recognize the hotkey name change I gave it.

View attachment 101559
This is OBS for Mac BTW. version 30.0.2
 

Warmuptill

Active Member
Does anyone know why when i rename a macro hotkey trigger, it still shows as
"macro_condition_hotkey_2" when i call it via websocket command "GetHotkeyList"

I'm tyring to write a python script that will send OBS a TriggerHotkeyByName command when a certain sensor is triggered. But, even tho I see the commands coming through via the websocket server connection, the hotkey itself it not being triggered. I'm a noob at python, so could be something I'm doing wrong.... but not sure why the websocket doesn't recognize the hotkey name change I gave it.

View attachment 101559
OBS hotkeys consist of a "name" and a "description" field.
The value modifiable in the hotkey condition, which is also visible the OBS settings menu, is the "description" field.
The "name" field is never changed after the hotkey was initially created, but there is no reason it could not also be adapted as far as I can tell.

A build where the "name" is also changed when the hotkey "description" is changed will be available here in a few minutes:
You will have to be logged into GitHub to be able to download it.
Please back up your settings before trying this build in case you should run into any issues. (If you do please let me know)
 

Haifeng

New Member
Hello!

I setup 2 macro:

1st one when the input streaming is paused thus the video source hasn't changed for a while,then switch to another scene,and it works fabulously.

But when the singnal is back and the video changes for a specified duration,the 2nd macro which switch back to the previous scene doen't work normal.

So, I am rather confused now.
 

aarona68

New Member
Good afternoon.

Just wanted to stop in and thank the creator of this plugin. I have zero coding experience besides learning basic HTML in 10th grade computer class (in 2005). I started streaming about a year ago with my daughter. Just playing some simple Switch games and showing her how all of the Twitch stuff works. I didn't use many plugins, if any at all. I wish I would have known about this one though, because I could have done a bit more and made the stream perform a lot better.

In just 15 minutes, I've already programmed a few macros and have them working exactly as intended. This is great. I'm planning on making tutorial videos for the company I work for that shows trainees how to do certain things. This will be a huge help and I really appreciate the effort that's been but into this.

Thank you!
 

Warmuptill

Active Member
Hello!

I setup 2 macro:

1st one when the input streaming is paused thus the video source hasn't changed for a while,then switch to another scene,and it works fabulously.

But when the singnal is back and the video changes for a specified duration,the 2nd macro which switch back to the previous scene doen't work normal.

So, I am rather confused now.
Unfortunately, it is very difficult to say what the issue might be without further information.

Can you share the two macros you have set up?
You can do this by either by exporting the two macros or by exporting your settings to a file.

It might also be of use if you can provide a log file with verbose logging enabled and corresponding timestamp of when the issue happened in the log.
 

Kaivarri

New Member
I've been searching through the pages, and can't seem to find what I'm looking for... What I'd like to do, is set it to when I switch from my "Starting" Scene to my "live" scene, it activates a unique transition (fade to color, 8 second duration) and during the transition plays a specific audio file. I have tried setting it to play, but it will only play the audio once the transition is complete. If I try having the source muted, and do unmute, same thing it waits until the full transition to unmute the audio, therefore skipping the audio. My audio is about 14 seconds long, though the tail end is fine to have after ending the transition.

Is this something currently possible?
 
Top