Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Haifeng

New Member
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.
switch.jpg


back.jpg


This is what I setup..Maybe because the broadcasting scene is on the background,when the repaly scene remains in the preview window,so the macro cannot judge correctly?But how to get the broadcasting scene into the preview window automatically?
 

Destroy666

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?
What's your setup? Did you try 2nd macro with Transition condition for the sound?
 

AaronD

Active Member
View attachment 101690

View attachment 101691

This is what I setup..Maybe because the broadcasting scene is on the background,when the repaly scene remains in the preview window,so the macro cannot judge correctly?But how to get the broadcasting scene into the preview window automatically?
If the "changed" condition works, then instead of a separate "not changed", maybe you could use "not macro" instead, and point it to the one that works:
1707844734338.png

Or you might combine both into a single macro by using the "else" clause, which is in a later version than you or I have.
 

Haifeng

New Member
If the "changed" condition works, then instead of a separate "not changed", maybe you could use "not macro" instead, and point it to the one that works:
View attachment 101704
Or you might combine both into a single macro by using the "else" clause, which is in a later version than you or I have.
The supplement of else clause is not bad.

Thank you very much.
 

Warmuptill

Active 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?
Unfortunately, it is very hard to say what the issue might be without knowing more about your setup.
You can share the macro(s) you are currently using?

Maybe this table might give you an idea on how to set this up:

Depending on what type of transition is used it might be necessary to include the same audio source in both, the source scene, and the target scene.
 

Kaivarri

New Member
Unfortunately, it is very hard to say what the issue might be without knowing more about your setup.
You can share the macro(s) you are currently using?

Maybe this table might give you an idea on how to set this up:

Depending on what type of transition is used it might be necessary to include the same audio source in both, the source scene, and the target scene.
Sorry for the delay in getting back to everyone, thank you for all the help! Using the If transition got it to work. I was trying the If scene, with previous being starting and current is live. By making it the transition clause it fixed what I was trying to do. Now to tweak a few other things using this :D
Made my intro perfect and saved my poor ADHD brain from having to remember to mute/unmute the audio! now to set in faders :D
 

justedit

Member
Hi @Warmuptill ! First of all, I'd like to thank you for this awesome plugin. I'm using since 2 years in a big forum in Dubaï where I have 2 OBS stations (main + spare) feeding a 6400x1000px LED screen in a lobby.
My OBS main is using macros to time-switch between scenes and the "old" network tab to send websocket commands to slave my OBS spare.
My OBS spare use also the old "network" tab to receive OBS main websocket commands to switch in sync with the main.
It's been running from 4 days 24/24h like a charm. Since 2 days my OBS spare crashes (without any error, just closing OBS) After some investigations, it seems that it could be an Advanced Scene Switcher issue (last line of the crash log attached) but I'm not a coder guy so I might be wrong.

I would like to try do the same master-slave thing with macros. How can I achieve that? I looked at the documentations but it's much more complicated than the old "Network" tab.
Thanks a lot for your help!
Cheers.
noar
 

Attachments

  • PXL_20240211_030206329.jpg
    PXL_20240211_030206329.jpg
    62.8 KB · Views: 22
  • PXL_20240214_065525597.jpg
    PXL_20240214_065525597.jpg
    90.2 KB · Views: 24
  • Crash 2024-02-14 10-08-27.txt
    10.8 KB · Views: 12

justedit

Member
Hi @Warmuptill ! First of all, I'd like to thank you for this awesome plugin. I'm using since 2 years in a big forum in Dubaï where I have 2 OBS stations (main + spare) feeding a 6400x1000px LED screen in a lobby.
My OBS main is using macros to time-switch between scenes and the "old" network tab to send websocket commands to slave my OBS spare.
My OBS spare use also the old "network" tab to receive OBS main websocket commands to switch in sync with the main.
It's been running from 4 days 24/24h like a charm. Since 2 days my OBS spare crashes (without any error, just closing OBS) After some investigations, it seems that it could be an Advanced Scene Switcher issue (last line of the crash log attached) but I'm not a coder guy so I might be wrong.

I would like to try do the same master-slave thing with macros. How can I achieve that? I looked at the documentations but it's much more complicated than the old "Network" tab.
Thanks a lot for your help!
Cheers.
noar
I tried to reproduce the crash with verbose log activated. Here are the log attached. Any idea ? The OBS main never crashes, only the spare who receive WebSocket datas from the main.
Hope this helps.
Thanks!
noar
 

Attachments

  • Crash 2024-02-14 13-50-21.txt
    64 bytes · Views: 17
  • 2024-02-14 11-17-47.txt
    393.3 KB · Views: 13

justedit

Member
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.
Hi @Warmuptill ! Here is the sequence export. Sorry by saying macro I meant "Sequence" (old tab).
I think it's not really a ASS plugin related issue but more a WebSocket / GPU issue.
I've just posted in the general forum : https://obsproject.com/forum/thread...switcher-1-24-1-websocket.173297/#post-638540
Thanks!
noar
 

Attachments

  • ASS_SEQUENCE.txt
    1.4 KB · Views: 15

AaronD

Active Member
My OBS main is using macros to time-switch between scenes and the "old" network tab to send websocket commands to slave my OBS spare.
My OBS spare use also the old "network" tab to receive OBS main websocket commands to switch in sync with the main.
...
I would like to try do the same master-slave thing with macros. How can I achieve that? I looked at the documentations but it's much more complicated than the old "Network" tab.
The old Network tab only does one thing with limited logic, and the Macros do EVERYTHING! So yes, there's a lot more to wrap your head around if you really want to understand *all* of it before doing *any* of it. But you don't have to. Just start playing with it and find things that work.

To send WebSocket messages from one to another, first set up the WebSocket server in the Master instance of OBS. Tools -> WebSocket Server Settings (outside of Adv. SS)
1707917818303.png

Then in Adv. SS on that Master instance, you can send events, with any text that you want to differentiate them:
1707917687585.png

And receive them in the Slave, which is connected to the server in the Master, and filter that text.
1707917766367.png

You have to set up that connection, of course, but only once, by choosing the Add new connection option in the drop-down of which one to use.
1707918685609.png


.
 

Haifeng

New Member
If the "changed" condition works, then instead of a separate "not changed", maybe you could use "not macro" instead, and point it to the one that works:
View attachment 101704
Or you might combine both into a single macro by using the "else" clause, which is in a later version than you or I have.
By the way, I found a alternative way to deal with this. I used "scene item viservility" change the visibility of source page, and it worked well. One more thing,uses the preview window as the input of virtual camera.

And thank you once again.
 

vanawesome

New Member
would anyone have a good tutorial or example of a python script that is sending commands to OBS via websocket? I am having a hell of a time getting it to work.

I see the commands successfully coming into OBS via the websocket server Session Messages in/out, but for whatever reason, the commands i'm sending aren't actually doing anything. I can send the same commands via streamerbot and they work. So it must be something in my script. Sorry if this is the wrong place to ask this.

I'm remotely sending a sound triggered websocket command and hoping to trigger a macro via hotkey.

Python:
import sounddevice as sd
import numpy as np
from obswebsocket import obsws, requests

# OBS WebSocket server settings
obs_host = "localhost"
obs_port = 4456
obs_password = "guTHv2GACgEz7lvq"  # Change this to your OBS WebSocket password

# Connect to OBS WebSocket
ws = obsws(obs_host, obs_port, obs_password)
ws.connect()

# Set the scene name you want to switch to when the microphone input exceeds the threshold
scene_to_switch = "Replay State"

def calculate_decibel_level(data):
    # Calculate the decibel level of the audio data
    rms = np.sqrt(np.mean(data**2))
    decibel = 20 * np.log10(rms)
    return decibel

def switch_scene():
    # Switch to the specified scene in OBS
    ws.call(requests.SetCurrentScene(scene_name=scene_to_switch))

def callback(indata, frames, time, status):
    if status:
        print('Error:', status)
    # Calculate decibel level
    decibel = calculate_decibel_level(indata)
    print(f"Decibel level: {decibel} dB")
    # If decibel level exceeds -30 dB, switch scene
    if decibel > -30:
        switch_scene()

# Open microphone stream
with sd.InputStream(callback=callback):
    print('Listening... Press Ctrl+C to exit')
    # Keep the script running
    sd.sleep(1000000)

# Disconnect from OBS WebSocket
ws.disconnect()
 

ukie

Member
My "Tray Notification" macros are not showing on Mac OSX 14.3.1 (m2 chip).
Running OBS 30.0.2 and ASS 1.24.2.
Other notifications are working, but ASS does not. Anyone having the same issue?
 

Warmuptill

Active Member
My "Tray Notification" macros are not showing on Mac OSX 14.3.1 (m2 chip).
Running OBS 30.0.2 and ASS 1.24.2.
Other notifications are working, but ASS does not. Anyone having the same issue?
You might have to tweak your OBS notification settings in "System Preferences".

First check if they are enabled at all.
Then select the type of notification - If you always want it to "pop up", select "Alerts".
Depending on how frequent you send those messages they might also be grouped, which you can disable in the "Notification grouping" section.

1708109001613.png


I hope that helps!
 

ukie

Member
You might have to tweak your OBS notification settings in "System Preferences".

First check if they are enabled at all.
Then select the type of notification - If you always want it to "pop up", select "Alerts".
Depending on how frequent you send those messages they might also be grouped, which you can disable in the "Notification grouping" section.

View attachment 101804

I hope that helps!
I have all that enabled. Set as Alerts. They simply stopped showing. I can’t figure out what changed.
 

alpineowl

New Member
I am trying to start and stop my live owl cam every 12 hours, so it will record on the YouTube side. With the Advanced Scene Switcher 1.24.2, I can start and stop stream based on a timer. I am having troubles with the broadcast feature, which seems to be a manual process, it looks like I need to utilize this feature to get YouTube to record the previous 12 hour block. I see some similar questions on this topic, but not the solutions. Thank you.
 

AaronD

Active Member
I am trying to start and stop my live owl cam every 12 hours, so it will record on the YouTube side. With the Advanced Scene Switcher 1.24.2, I can start and stop stream based on a timer. I am having troubles with the broadcast feature, which seems to be a manual process, it looks like I need to utilize this feature to get YouTube to record the previous 12 hour block. I see some similar questions on this topic, but not the solutions. Thank you.
I run a church stream. We don't schedule anything. Just start throwing data at it, and stop the data when we're done. YT records that, and makes it available to watch later. Easy as that.

The schedule is to tell your subscribers when you'll be on next, but if you're predictable already, you probably don't need that. Save yourself the trouble, and don't bother.

If you only want to split the recording and keep going, you'll need to have it down long enough that YT times out and calls it done. Too short, and it calls it a hiccup in the same stream and resumes that one. I've done back-to-back streams that way: stop, let it time out, change some data in the web browser (OBS is NOT logged in: we use the stream key instead), and start again with the same key.
 

alpineowl

New Member
I run a church stream. We don't schedule anything. Just start throwing data at it, and stop the data when we're done. YT records that, and makes it available to watch later. Easy as that.

The schedule is to tell your subscribers when you'll be on next, but if you're predictable already, you probably don't need that. Save yourself the trouble, and don't bother.

If you only want to split the recording and keep going, you'll need to have it down long enough that YT times out and calls it done. Too short, and it calls it a hiccup in the same stream and resumes that one. I've done back-to-back streams that way: stop, let it time out, change some data in the web browser (OBS is NOT logged in: we use the stream key instead), and start again with the same key.
Aaron,
Thank you for your reply, but I am doing something wrong after multiple tries and different configurations.
- If I set auto-stop to on, after the YT timeout period, it wants to kill my stream entirely after a minute or so. When I restart the feed, it goes into the abyss of null I guess.
- If I set auto-stop to off, YT does not time it out and I end up with a hiccup. I tried renaming it and did not see any changes, less the name change.

Start the stream settings:
- Enable auto-start: on or off?
- Enable auto-stop: on or off?

- Enable DVR - Assuming this is on.
- Using key not logging into YT
- Using if statement on date, the start and stop commands work appropriately
- My version: OBS 30.0.2.

Any help would be appreciated.
 

AaronD

Active Member
Aaron,
Thank you for your reply, but I am doing something wrong after multiple tries and different configurations.
- If I set auto-stop to on, after the YT timeout period, it wants to kill my stream entirely after a minute or so. When I restart the feed, it goes into the abyss of null I guess.
- If I set auto-stop to off, YT does not time it out and I end up with a hiccup. I tried renaming it and did not see any changes, less the name change.

Start the stream settings:
- Enable auto-start: on or off?
- Enable auto-stop: on or off?

- Enable DVR - Assuming this is on.
- Using key not logging into YT
- Using if statement on date, the start and stop commands work appropriately
- My version: OBS 30.0.2.

Any help would be appreciated.
Someone else in a different thread said that the key was my changing something between streams. Haven't actually tried not changing something in a short time, but I do know that not changing it after a week of not streaming does work. (Oops!) Maybe there's another timeout that I don't know about?

Anyway, I'm pretty sure Adv. SS is doing its job just fine, and the problem is somewhere else.
 
Top