Advanced Scene Switcher

Advanced Scene Switcher 1.37.2

Can we get an explanation of how this new feature works?

“The "Cursor" condition type now exposes macro properties for the current cursor position.”
You can assign the X and Y position of the cursor location to variables like this:
1748428316792.png
 
I found a solution, playing after each other more “Miedia”, below are the details.

But I have another problem, why is it that randomly when playing consecutive “MEDIA” in between, once it shows a black background for a few ms, and when executing the same Macro once it plays fine, without a black screen?

Like in the Google video: FILM with black screen

This random black screen between MEDIA also occurs on several computers. Once it is there, once it is not. Why?

Is there any solution?


---
AND for proper playback of media in succession, such as on “Hotkey” the key is to set the Macr activity:

1748500710404.png

.
and settings:

1748500819378.png
 
Hi All,
Still pretty new to Advanced Scene Switcher, but have had some success automatically muting some audio and unmuting others when switching to / from certain scenes.

What I wan to do now I suspect may be impossible. I want to completely abort a transition if one is requested when certain conditions are met.

I tried setting up a condition on any transition from X of exactly 0.3s duration (my default) and on that transition, instead do a cut transition to X. That doesn't seem to do what I want and I'm thinking it's a bit of a lost cause.

I also have a lua script running and I have a frontend_event_callback and it seems I get PREVIEW_CHANGED, SCENE_CHANGED and TRANSITION_STOPPED, but no real way to know if the preview changed was a prelude to a transition or not.

Maybe if I can check some global to know that at the time of the preview changed, a transition is already underway, I could just change it to X, otherwise let the new preview stay. Seems maybe changing a preview during a preview change event callback may be a bad idea.

Anyway, I know it seems like a really stupid stupid thing to want to do, but I have a reason, so if anyone can suggest a way Advanced Scene Switcher can help, or any other approach that might be viable. I want (under certain conditions) to allow the user to press transition and do some side action that will affect the source on Program instead of an actually transitioning the special scene to Program. Maybe imagine a scenario where I can modify the source on Program before it arrives in OBS in a way that I can't by an OBS transition or filter, etc.
 
Maybe if I can check some global to know that at the time of the preview changed, a transition is already underway, I could just change it to X, otherwise let the new preview stay. Seems maybe changing a preview during a preview change event callback may be a bad idea.
Yeah, that didn't work. Turns out the preview set is not the new preview to transition to, but instead the program scene being first moved to the preview as the transition kicks off.

I think I'll have to resort to some kind of a hotkey which acts on the preview and not actually using the transition. It eliminates the option of not using studio mode for this, but I don't see any hooks in transition to modify the behavior.
 
I found a solution, playing after each other more “Miedia”, below are the details.

But I have another problem, why is it that randomly when playing consecutive “MEDIA” in between, once it shows a black background for a few ms, and when executing the same Macro once it plays fine, without a black screen?

Like in the Google video: FILM with black screen

This random black screen between MEDIA also occurs on several computers. Once it is there, once it is not. Why?

Is there any solution?


---
AND for proper playback of media in succession, such as on “Hotkey” the key is to set the Macr activity:

View attachment 113697
.
and settings:

View attachment 113698
This is probably happening because of how the "wait for playback to stop" functionality is implemented.
It will check if the media source's state is not "playing" for at least a time span of 10ms.
The reason it is implemented like this is, that media sources which are set to loop or are playing back a playlist will switch states from "playing" to e.g "ended" for a brief amount of time and this would otherwise stop the waiting.
Hi All,
Still pretty new to Advanced Scene Switcher, but have had some success automatically muting some audio and unmuting others when switching to / from certain scenes.

What I wan to do now I suspect may be impossible. I want to completely abort a transition if one is requested when certain conditions are met.

I tried setting up a condition on any transition from X of exactly 0.3s duration (my default) and on that transition, instead do a cut transition to X. That doesn't seem to do what I want and I'm thinking it's a bit of a lost cause.

I also have a lua script running and I have a frontend_event_callback and it seems I get PREVIEW_CHANGED, SCENE_CHANGED and TRANSITION_STOPPED, but no real way to know if the preview changed was a prelude to a transition or not.

Maybe if I can check some global to know that at the time of the preview changed, a transition is already underway, I could just change it to X, otherwise let the new preview stay. Seems maybe changing a preview during a preview change event callback may be a bad idea.

Anyway, I know it seems like a really stupid stupid thing to want to do, but I have a reason, so if anyone can suggest a way Advanced Scene Switcher can help, or any other approach that might be viable. I want (under certain conditions) to allow the user to press transition and do some side action that will affect the source on Program instead of an actually transitioning the special scene to Program. Maybe imagine a scenario where I can modify the source on Program before it arrives in OBS in a way that I can't by an OBS transition or filter, etc.
Yeah, that didn't work. Turns out the preview set is not the new preview to transition to, but instead the program scene being first moved to the preview as the transition kicks off.

I think I'll have to resort to some kind of a hotkey which acts on the preview and not actually using the transition. It eliminates the option of not using studio mode for this, but I don't see any hooks in transition to modify the behavior.
Unfortunately, aborting an already active transition is not something, which works well in OBS, as far as I know.
So, you did not miss anything and resorting to some other method, like the hotkey you mentioned, is probably a better approach.
 
I just downloaded OBS 31.0.3 Advanced Scene Switcher 1.30.0

I want to switch between two media-sources (mp4 video files) when each ends.

Looping a set of media sources​



scene-1 contains media-source mp4-1
scene-2 contains media-source mp4-2

Macro 1 waits for mp4-1 to end and then restarts mp4-2
Macro 2 waits for mp4-2 to end and then restarts mp4-1
Both have perform actions on condition changed.

I looked at the log and this is what I got:

13:15:30.114: User switched to scene 'scene-2'
13:15:45.517: [adv-ss] running actions of Macro 2
13:15:45.517: [adv-ss] performed action "AdvSceneSwitcher.action.media.type.restart" for source "mp4-1"

It just hangs here. Not other output. Screen shows a very dimmed image of scene-2. mp4-1 video does not start!
Help!
 
I just downloaded OBS 31.0.3 Advanced Scene Switcher 1.30.0

I want to switch between two media-sources (mp4 video files) when each ends.

Looping a set of media sources​



scene-1 contains media-source mp4-1
scene-2 contains media-source mp4-2

Macro 1 waits for mp4-1 to end and then restarts mp4-2
Macro 2 waits for mp4-2 to end and then restarts mp4-1
Both have perform actions on condition changed.

I looked at the log and this is what I got:

13:15:30.114: User switched to scene 'scene-2'
13:15:45.517: [adv-ss] running actions of Macro 2
13:15:45.517: [adv-ss] performed action "AdvSceneSwitcher.action.media.type.restart" for source "mp4-1"

It just hangs here. Not other output. Screen shows a very dimmed image of scene-2. mp4-1 video does not start!
Help!
Unfortunately, it is difficult to tell what the problem might be just from your description.
Can you please export your macros and share a log with verbose logging enabled?
Could it be that one of the media source was manually paused?
 
Ok, here are the logs. Thanks! I tried same thing on another computer with same results.
I think you might have accidentally configured your macros incorrectly.

Instead of restarting the playback of the "mp4-1" source when the playback of "mp4-2" has ended you have configured the macro to restart it when "mp4-2" is still playing.

1749027340558.png


You probably intended to check for the state "ended" instead:

1749027482167.png


The same problem exists in "Macro 1".
 
Last edited:
I changed both Macros to playing and here is log results with no change when mp4-1 video ends. This just continues on and on.
What does this mean? "skip actions for Macro Macro 2 (on change)"

10:44:03.844: [adv-ss] condition media returned 0
10:44:03.844: [adv-ss] Macro Macro 1 returned 0
10:44:03.844: [adv-ss] condition media returned 1
10:44:03.844: [adv-ss] Macro Macro 2 returned 1
10:44:03.844: [adv-ss] skip actions for Macro Macro 2 (on change)
10:44:03.845: [adv-ss] try to sleep for 300

It seems to me that when the 1st video ends, then it should play the 2nd video? and vice-versa.

I looked at sample macros in site for media switching and they used 'ended'. I even imported them and changed media-names but still does not work. I saw when it detects the video ending and issues command to start the new video but the output screen remains blank.
 
What does this mean? "skip actions for Macro Macro 2 (on change)"
This means that while all the conditions of the macro are true the actions are not executed again, as they have already been executed when the macro's conditions did initially evaluate to true.

This behavior can be toggled with the highlighted setting:

1749145189818.png


For what you want to set up this setting should be enabled (as it already is), as you don't want to "mp4-1" source to restarted over and over continuously.

I looked at sample macros in site for media switching and they used 'ended'. I even imported them and changed media-names but still does not work. I saw when it detects the video ending and issues command to start the new video but the output screen remains blank.
What type of sources are you using?
Does the media source properly if you click the "Run macro" button, which can be used to manually execute the actions of the currently selected macro?

If you want we can also hop on a quick call where you share your screen and we figure out what the problem is live instead of sharing comments here every couple of days :)
If so, feel free to send me a direct message.
 
Ok, here is what I tried. ASS is not running and I manually turned on Scene1 - mp4-1 video playing. Then I opened ASS window, clicked on Macro1 and clicked Run Macro. Here is result.

10:20:03.012: User switched to scene 'Scene1'
10:20:03.337: [adv-ss] current scene: Scene1
10:20:03.337: [adv-ss] previous scene: Scene2
10:20:11.026: [adv-ss] running actions of Macro 1
10:20:11.026: [adv-ss] performed action "AdvSceneSwitcher.action.media.type.restart" for source "mp4-2"

The mp4-2 video did not play, so I then started Scene2 video manually and did same for Macro 2. Stiil no video output.

10:20:29.277: User switched to scene 'Scene2'
10:20:29.571: [adv-ss] current scene: Scene2
10:20:29.571: [adv-ss] previous scene: Scene1
10:20:36.174: [adv-ss] running actions of Macro 2
10:20:36.174: [adv-ss] performed action "AdvSceneSwitcher.action.media.type.restart" for source "mp4-1"

On the expanded horizontal menu on ASS under Media, I tried another a 1st line macro and it did switch, however when I entered a 2nd line to switch back, it did not work.
 
I tried the horizontal menu Media again and this time it worked. When I tried to add a 3rd video, it went crazy. Here log for working with 2 videos.
10:32:51.549: [adv-ss] try to sleep for 299
10:32:51.850: [adv-ss] Macro Macro 1 is paused
10:32:51.850: [adv-ss] Macro Macro 1 returned 0
10:32:51.850: [adv-ss] Macro Macro 2 is paused
10:32:51.850: [adv-ss] Macro Macro 2 returned 0

10:32:51.850: [adv-ss] match for 'media' - switch to scene 'Scene2'
10:32:51.863: User switched to scene 'Scene2'
10:32:51.863: [adv-ss] switched scene

10:32:51.863: [adv-ss] try to sleep for 287
10:32:52.151: [adv-ss] Macro Macro 1 is paused
10:32:52.151: [adv-ss] Macro Macro 1 returned 0
10:32:52.151: [adv-ss] Macro Macro 2 is paused
10:32:52.151: [adv-ss] Macro Macro 2 returned 0
.
.
.
10:33:39.763: [adv-ss] try to sleep for 299
10:33:40.063: [adv-ss] Macro Macro 1 is paused
10:33:40.063: [adv-ss] Macro Macro 1 returned 0
10:33:40.063: [adv-ss] Macro Macro 2 is paused
10:33:40.063: [adv-ss] Macro Macro 2 returned 0

10:33:40.063: [adv-ss] match for 'media' - switch to scene 'Scene1'
10:33:40.075: User switched to scene 'Scene1'
10:33:40.075: [adv-ss] switched scene
 
Ok, here is what I tried. ASS is not running and I manually turned on Scene1 - mp4-1 video playing. Then I opened ASS window, clicked on Macro1 and clicked Run Macro. Here is result.

10:20:03.012: User switched to scene 'Scene1'
10:20:03.337: [adv-ss] current scene: Scene1
10:20:03.337: [adv-ss] previous scene: Scene2
10:20:11.026: [adv-ss] running actions of Macro 1
10:20:11.026: [adv-ss] performed action "AdvSceneSwitcher.action.media.type.restart" for source "mp4-2"

The mp4-2 video did not play, so I then started Scene2 video manually and did same for Macro 2. Stiil no video output.

10:20:29.277: User switched to scene 'Scene2'
10:20:29.571: [adv-ss] current scene: Scene2
10:20:29.571: [adv-ss] previous scene: Scene1
10:20:36.174: [adv-ss] running actions of Macro 2
10:20:36.174: [adv-ss] performed action "AdvSceneSwitcher.action.media.type.restart" for source "mp4-1"

On the expanded horizontal menu on ASS under Media, I tried another a 1st line macro and it did switch, however when I entered a 2nd line to switch back, it did not work.
If even clicking the "Run macro" button has no effect at all, but using a different action type like "switch scene" works as expected, I am at a loss. :(
What types of sources are you using? (VLC source , media source, image slide show, something else)
Are you sure you have selected the correct media sources?
When I tried to add a 3rd video, it went crazy
What do you mean by that?
 
I am using two .mp4 video files. I had only 2 macros, the when I added a third to continue on, then the video output was quickly switching among the 3 videos.
I am having some success using the media Tab in the center of ASS, but when I try to use 2 individuals macros nothing happens. I tried going to OBS Version 3.1.0 but no luck. Is there earlier version of ASS I could try?
 
hi :)
i'm trying to set up adv-SS to automatically switch between games & my desktop. however, i think i may have set up the macros incorrectly as it's only half-working.

switching from my game scene to my desktop scene works. it plays the 300ms fade transition & everything is fine.
however, when it's the other way around (desktop scene ➔ game scene), it doesn't switch. i know this because it doesn't play the 300ms fade transition, & it records my whole desktop audio rather than just game audio.

i've attached a screenshot of the setup.

thankyou :]
 

Attachments

  • macro.png
    macro.png
    99.3 KB · Views: 191
hi :)
i'm trying to set up adv-SS to automatically switch between games & my desktop. however, i think i may have set up the macros incorrectly as it's only half-working.
(tried editing original msg but there's a timelimit. anyway. i recorded a video of my OBS's behavior).
 
Back
Top