Advanced Scene Switcher

Advanced Scene Switcher 1.37.2

I believe this is the relevant portion of the log for "start commercial" being attempted. It failed again:


14:04:28.681: [adv-ss] performed action "AdvSceneSwitcher.action.twitch.type.commercial.start" with token for "[REDACTED]"
14:04:28.682: [adv-ss] Twitch POST request to https://api.twitch.tv/helix/channels/commercial? began
14:04:28.850: [adv-ss] Failed to start commercial! (400)
 
I believe this is the relevant portion of the log for "start commercial" being attempted. It failed again:


14:04:28.681: [adv-ss] performed action "AdvSceneSwitcher.action.twitch.type.commercial.start" with token for "[REDACTED]"
14:04:28.682: [adv-ss] Twitch POST request to https://api.twitch.tv/helix/channels/commercial? began
14:04:28.850: [adv-ss] Failed to start commercial! (400)
According to the API documentation this could be caused by at least one of the following:

400 Bad Request
  • The broadcaster_id query parameter is required.
  • The length query parameter is required.
  • The ID in broadcaster_id is not valid.
  • To start a commercial, the broadcaster must be streaming live.
  • The broadcaster may not run another commercial until the cooldown period expires. The retry_after field in the previous start commercial response specifies the amount of time the broadcaster must wait between running commercials.

Looking at the code I would expect there to be more information about what caused the problem after the last log line you shared:

Code:
    if (result.status != 200) {
        OBSDataArrayAutoRelease replyArray =
            obs_data_get_array(result.data, "data");
        OBSDataAutoRelease replyData =
            obs_data_array_item(replyArray, 0);
        blog(LOG_INFO,
             "Failed to start commercial! (%d)\n"
             "length: %lld\n"
             "message: %s\n"
             "retry_after: %lld\n",
             result.status, obs_data_get_int(replyData, "length"),
             obs_data_get_string(replyData, "message"),
             obs_data_get_int(replyData, "retry_after"));
    }

Would you mind sharing that information?
By the way - if you don't want to share it publicly here you can also send me a DM here on the forums.
 
According to the API documentation this could be caused by at least one of the following:

400 Bad Request
  • The broadcaster_id query parameter is required.
  • The length query parameter is required.
  • The ID in broadcaster_id is not valid.
  • To start a commercial, the broadcaster must be streaming live.
  • The broadcaster may not run another commercial until the cooldown period expires. The retry_after field in the previous start commercial response specifies the amount of time the broadcaster must wait between running commercials.

Looking at the code I would expect there to be more information about what caused the problem after the last log line you shared:

Code:
    if (result.status != 200) {
        OBSDataArrayAutoRelease replyArray =
            obs_data_get_array(result.data, "data");
        OBSDataAutoRelease replyData =
            obs_data_array_item(replyArray, 0);
        blog(LOG_INFO,
             "Failed to start commercial! (%d)\n"
             "length: %lld\n"
             "message: %s\n"
             "retry_after: %lld\n",
             result.status, obs_data_get_int(replyData, "length"),
             obs_data_get_string(replyData, "message"),
             obs_data_get_int(replyData, "retry_after"));
    }

Would you mind sharing that information?
By the way - if you don't want to share it publicly here you can also send me a DM here on the forums.

The next few lines following that line in the log are:


14:04:28.850: length: 0

14:04:28.850: message:

14:04:28.850: retry_after: 0

14:04:28.850:

14:04:28.850: [adv-ss] performed action wait

14:04:28.850: [adv-ss] perform action wait with duration of 183.000000

The last line above is to show there's nothing else there about the 'start commercial' action, because that 183 second wait is the macro executing the next command after it.

I notice it says "length: 0" above. That would presumably be an invalid value for "length". But I do indeed have the length set in the plugin, of 180s:

5WFunzd.png


At this point I think it's worthwhile to mention that I always thought it was weird that the ad length was a field like that, that you can set to any integer value from 0 to 180 inclusive (and that goes to two decimal places (though it won't let you modify either the tenths or hundredths)...huh?), because Twitch only allows you to manually run ads from 30s to 180s (3 min) inclusive, and only in multiples of 30s. I have a feeling something was done improperly in implementation here that could very well be related to the bug I encountered. That field where you see "180.00" above should instead be a dropdown that contains a list of choices that are labeled something like this:

  • 30s
  • 60s (1m)
  • 90s (1m30s)
  • 120s (2m)
  • 150s (2m30s)
  • 180s (3m)
I'd be very surprised if these two things were completely unrelated, but even if they aren't, both merit fixing imo.
 
I notice it says "length: 0" above. That would presumably be an invalid value for "length". But I do indeed have the length set in the plugin, of 180s:
Thanks for sharing the additional log lines!

Unfortunately, it seems like I misinterpreted how the Twitch API will return the error message.
The value "0" only indicates that the Twitch API did not return any value for the field "length", because it does not exist in the error reply.

At this point I think it's worthwhile to mention that I always thought it was weird that the ad length was a field like that, that you can set to any integer value from 0 to 180 inclusive (and that goes to two decimal places (though it won't let you modify either the tenths or hundredths)...huh?), because Twitch only allows you to manually run ads from 30s to 180s (3 min) inclusive, and only in multiples of 30s. I have a feeling something was done improperly in implementation here that could very well be related to the bug I encountered. That field where you see "180.00" above should instead be a dropdown that contains a list of choices that are labeled something like this:

  • 30s
  • 60s (1m)
  • 90s (1m30s)
  • 120s (2m)
  • 150s (2m30s)
  • 180s (3m)
I'd be very surprised if these two things were completely unrelated, but even if they aren't, both merit fixing imo.
The Twitch API does not specify anything about the length values having to be a multiple of 30 seconds.
I could verify that the Twitch API does indeed accept those values with an account which is able to run ads.

Code:
[adv-ss] performed action "AdvSceneSwitcher.action.twitch.type.commercial.start" with token for "-----"
[adv-ss] Twitch POST request to https://api.twitch.tv/helix/channels/commercial? began
[adv-ss] Commercial started! (200)
length: 142
message: Starting commercial break. Keep in mind you are still live and not all viewers will receive a commercial.
retry_after: 480

You cannot modify the tenths or hundredths in your case because you have already selected the maximum value of 180 seconds.

One possible root cause came to mind earlier / sorry if I am stating the obvious:
Your Twitch connection must have the necessary permissions to start commercials:
1719858729167.png


A build where I changed the error logging will be available here in a few minutes:
Unfortunately, you will have to be logged into GitHub to be able to download it.
Let me know if that should be an issue and I will try to upload that test build somewhere else.

I would appreciate if you could give reproducing the issue with this build another try and share the corresponding log messages.

Thank you for you support in tracking down the issue!
 
Alright, installed that build, tried again, got the more detailed error, it said I wasn't live yet. I changed the wait between the "start streaming" command and the action to invoke the ad from 5 to 10 seconds, and it worked! The log was descriptive enough to say so, and I tried clicking the 'run ad' button on the website's 'stream manager' and it told me that it was on cooldown, further confirming the ad run was successful. (I could have sworn I did my manual ad run thing inside of 10 seconds, when I noticed it failed before, but maybe I was slower than that).

Gave it one more try with 10 seconds, and it worked again! I guess I was just not waiting long enough before Twitch 'realized' I was streaming, and it failed before because Twitch was telling OBS that I'm not live (yet).

So that solves that! Even though it wasn't a bug in the plugin after all, I think it's still worthwhile in the end, that you improved on the log output for that action--with the new build, I was able to get the rest of the way to the answer myself, easily, because it clearly stated why it failed. That may come in handy in the future, or help another in my position, so they don't have to bug you, lol.

You're welcome for the support, and thank you for the help! :D
 
I'm having an issue that I've never seen before and I've been messing around with this one and others for a bit. I'm guessing reinstalling my Arch Linux will most likely fix the issue but I'm hoping I don't have too! lol So, There is nothing in the log files and no crash report but ultimately this is all I have to provide for information.

Basically, I am unable to access Adv SS when I click tools and then Adv SS. The second I click it, I get this message:

--------
Loading of the following plugin libraries was unsuccessful, which could result in some Advanced Scene Switcher functions not being available:

  • /usr/lib/obs-plugins/adv-ss-plugins/advanced-scene-switcher-opencv.so

Check the OBS logs for details.
This message can be disabled on the General tab.
_____

Only option is to click ok and then because I'm trying to get it to work, I've been starting OBS with terminal with "obs --debug" and after clicking ok OBS closes and in the terminal it says this"

--- fish: Job 1, 'obs --debug' terminated by signal SIGSEGV (Address boundary error) ---

Now I know this has a bit of missing info but I'm hoping its something simple. It's been about 6 months since I install arch and who knows what small thing could be obstructing it's use.

I'm using OBS Studio rc. I'm using a decent amount of plugs but nothing new. It's always played nice with the others.

https://obsproject.com/logs/EapwdYABeK8JGpsm - Here is my last log file. Any help would be splendid. lol Intel 11700k, 6700xt. not overclocked.

Random side note, when i check ldd with root, It told me I didn't have permission for that file or any of the files in the folder. That was new.

ls -l /usr/lib/obs-plugins/adv-ss-plugins/
.rwxr-xr-x 83M root 7 Jul 10:45  advanced-scene-switcher-base.so
.rwxr-xr-x 5.1M root 7 Jul 10:44  advanced-scene-switcher-midi.so
.rwxr-xr-x 7.0M root 7 Jul 10:44  advanced-scene-switcher-opencv.so
.rwxr-xr-x 79M root 7 Jul 10:44  advanced-scene-switcher-twitch.so

I gave myself execute privileges and it didn't affect anything. :P Anyways, any help is appreciated.
 
I'm having an issue that I've never seen before and I've been messing around with this one and others for a bit. I'm guessing reinstalling my Arch Linux will most likely fix the issue but I'm hoping I don't have too! lol So, There is nothing in the log files and no crash report but ultimately this is all I have to provide for information.

Basically, I am unable to access Adv SS when I click tools and then Adv SS. The second I click it, I get this message:

--------
Loading of the following plugin libraries was unsuccessful, which could result in some Advanced Scene Switcher functions not being available:

  • /usr/lib/obs-plugins/adv-ss-plugins/advanced-scene-switcher-opencv.so

Check the OBS logs for details.
This message can be disabled on the General tab.
_____

Only option is to click ok and then because I'm trying to get it to work, I've been starting OBS with terminal with "obs --debug" and after clicking ok OBS closes and in the terminal it says this"

--- fish: Job 1, 'obs --debug' terminated by signal SIGSEGV (Address boundary error) ---

Now I know this has a bit of missing info but I'm hoping its something simple. It's been about 6 months since I install arch and who knows what small thing could be obstructing it's use.

I'm using OBS Studio rc. I'm using a decent amount of plugs but nothing new. It's always played nice with the others.

https://obsproject.com/logs/EapwdYABeK8JGpsm - Here is my last log file. Any help would be splendid. lol Intel 11700k, 6700xt. not overclocked.

Random side note, when i check ldd with root, It told me I didn't have permission for that file or any of the files in the folder. That was new.

ls -l /usr/lib/obs-plugins/adv-ss-plugins/
.rwxr-xr-x 83M root 7 Jul 10:45  advanced-scene-switcher-base.so
.rwxr-xr-x 5.1M root 7 Jul 10:44  advanced-scene-switcher-midi.so
.rwxr-xr-x 7.0M root 7 Jul 10:44  advanced-scene-switcher-opencv.so
.rwxr-xr-x 79M root 7 Jul 10:44  advanced-scene-switcher-twitch.so

I gave myself execute privileges and it didn't affect anything. :P Anyways, any help is appreciated.
journalctl -xe results

dickhead kernel: obs[306200]: segfault at 8 ip 0000720c9d39d025 sp 00007ffdbbd46c80 error 4 in libQt6Core.so.6.7.2[720c9d28a000+3cc000] likely on CPU 8 (core 0, socket 0)
Jul 07 11:46:55 dickhead kernel: Code: 00 00 00 00 00 f3 0f 1e fa 53 48 83 ec 20 64 48 8b 1c 25 28 00 00 00 48 89 5c 24 18 48 89 fb 48 89 e7 48 89 de e8 db f4 fa ff <48> 8b 43 08 48 8b 7c 24 08 0f b6 54 24 10 80 78 30 00 78 >
Jul 07 11:46:55 dickhead kded6[1493]: Service ":1.723" unregistered
Jul 07 11:46:55 dickhead systemd[1084]: app-com.obsproject.Studio@fc32753606f04aa98192d2b5942b2987.service: Main process exited, code=killed, status=11/SEGV
 
I'm having an issue that I've never seen before and I've been messing around with this one and others for a bit. I'm guessing reinstalling my Arch Linux will most likely fix the issue but I'm hoping I don't have too! lol So, There is nothing in the log files and no crash report but ultimately this is all I have to provide for information.

Basically, I am unable to access Adv SS when I click tools and then Adv SS. The second I click it, I get this message:

--------
Loading of the following plugin libraries was unsuccessful, which could result in some Advanced Scene Switcher functions not being available:

  • /usr/lib/obs-plugins/adv-ss-plugins/advanced-scene-switcher-opencv.so

Check the OBS logs for details.
This message can be disabled on the General tab.
_____

Only option is to click ok and then because I'm trying to get it to work, I've been starting OBS with terminal with "obs --debug" and after clicking ok OBS closes and in the terminal it says this"

--- fish: Job 1, 'obs --debug' terminated by signal SIGSEGV (Address boundary error) ---

Now I know this has a bit of missing info but I'm hoping its something simple. It's been about 6 months since I install arch and who knows what small thing could be obstructing it's use.

I'm using OBS Studio rc. I'm using a decent amount of plugs but nothing new. It's always played nice with the others.

https://obsproject.com/logs/EapwdYABeK8JGpsm - Here is my last log file. Any help would be splendid. lol Intel 11700k, 6700xt. not overclocked.

Random side note, when i check ldd with root, It told me I didn't have permission for that file or any of the files in the folder. That was new.

ls -l /usr/lib/obs-plugins/adv-ss-plugins/
.rwxr-xr-x 83M root 7 Jul 10:45  advanced-scene-switcher-base.so
.rwxr-xr-x 5.1M root 7 Jul 10:44  advanced-scene-switcher-midi.so
.rwxr-xr-x 7.0M root 7 Jul 10:44  advanced-scene-switcher-opencv.so
.rwxr-xr-x 79M root 7 Jul 10:44  advanced-scene-switcher-twitch.so

I gave myself execute privileges and it didn't affect anything. :P Anyways, any help is appreciated.
journalctl -xe results

dickhead kernel: obs[306200]: segfault at 8 ip 0000720c9d39d025 sp 00007ffdbbd46c80 error 4 in libQt6Core.so.6.7.2[720c9d28a000+3cc000] likely on CPU 8 (core 0, socket 0)
Jul 07 11:46:55 dickhead kernel: Code: 00 00 00 00 00 f3 0f 1e fa 53 48 83 ec 20 64 48 8b 1c 25 28 00 00 00 48 89 5c 24 18 48 89 fb 48 89 e7 48 89 de e8 db f4 fa ff <48> 8b 43 08 48 8b 7c 24 08 0f b6 54 24 10 80 78 30 00 78 >
Jul 07 11:46:55 dickhead kded6[1493]: Service ":1.723" unregistered
Jul 07 11:46:55 dickhead systemd[1084]: app-com.obsproject.Studio@fc32753606f04aa98192d2b5942b2987.service: Main process exited, code=killed, status=11/SEGV
If you are not using the "Video" condition type I think the simplest solution you can try might be to remove the /usr/lib/obs-plugins/adv-ss-plugins/advanced-scene-switcher-opencv.so file.
I think what might have happened is that the OpenCV libs on your system were updated to a version the plugin is no longer compatible with.
 
If you are not using the "Video" condition type I think the simplest solution you can try might be to remove the /usr/lib/obs-plugins/adv-ss-plugins/advanced-scene-switcher-opencv.so file.
I think what might have happened is that the OpenCV libs on your system were updated to a version the plugin is no longer compatible with.
It totally worth a try. I generally only use the macro's. I'll give it a whirl and if it doesn't make it better, I'll just start playing and organizing my files to do a fresh install. It's over due. I like CachyOS and all but I like to jump around between versions of arch. :P Thank you for the input. I hope it works! LoL
 
If you are not using the "Video" condition type I think the simplest solution you can try might be to remove the /usr/lib/obs-plugins/adv-ss-plugins/advanced-scene-switcher-opencv.so file.
I think what might have happened is that the OpenCV libs on your system were updated to a version the plugin is no longer compatible with.
I deleted it, and OBS didn't really like that idea. It closed as soon as I clicked Adv ss in the tools drop down. O-well, No worries. I figured Id give it a shot I've tried a small plethora of ideas. I musta done did something that made that ol bag OBS angry. lol
 
Hello everyone.

I currently embed friends stream via a nice P2P opensource screen sharing solution : http://screensy.marijn.it

As quite any web video sources, the default state for the video is muted.

A manual solution is to right click the source > Interact > Manually click the unmute button.

But, I wonder if this plugin would help to perform such an automation :

When source is activated, unmute the inner video (and thus... I don't even know how to "code" the unmute action on the <video> ).

Thx everyone :)
 
Hello everyone.

I currently embed friends stream via a nice P2P opensource screen sharing solution : http://screensy.marijn.it

As quite any web video sources, the default state for the video is muted.

A manual solution is to right click the source > Interact > Manually click the unmute button.

But, I wonder if this plugin would help to perform such an automation :

When source is activated, unmute the inner video (and thus... I don't even know how to "code" the unmute action on the <video> ).

Thx everyone :)
Unfortunately, I don't think this is possible with this plugin at the moment.
I started work on adding the option to automate source interactions but wasn't happy with it / never finished it.
1720554023280.png

Just in case it is of use to you I started a build with this functionality based on a more recent release.
It will be available here in a few minutes on GitHub:
You will have to be logged into GitHub to be able to download it - let me know if that should be an issue.

But be warned, this build is might be buggy!
 
Hello everyone.

I currently embed friends stream via a nice P2P opensource screen sharing solution : http://screensy.marijn.it

As quite any web video sources, the default state for the video is muted.

A manual solution is to right click the source > Interact > Manually click the unmute button.

But, I wonder if this plugin would help to perform such an automation :

When source is activated, unmute the inner video (and thus... I don't even know how to "code" the unmute action on the <video> ).

Thx everyone :)
Unfortunately, I don't think this is possible with this plugin at the moment.
I started work on adding the option to automate source interactions but wasn't happy with it / never finished it.
View attachment 105230
Just in case it is of use to you I started a build with this functionality based on a more recent release.
It will be available here in a few minutes on GitHub:
You will have to be logged into GitHub to be able to download it - let me know if that should be an issue.

But be warned, this build is might be buggy!
Generally, automating a user interface as if it were an actual user, has to be considered an option of last resort. If that's all you have, then fine, do it that way, but keep in mind that it can easily decide to break at any time:
  • The reference location and/or scale for mouse clicks might change, and so the same numbers now miss the button.
  • The button itself might move, as part of some "usability improvements", and so the same numbers now miss the button.
  • There might be an additional step involved, as part of some "security improvements", and so the button isn't even there or is ineffective without a step that you now have to add.
  • In the cases where you now miss the button, there might be another button that you hit instead. What does *that* do?
  • Etc.
If it's at all possible to get an API that you can just connect to and tell it directly what you want to do, that's far preferable. Only if there's no other option, should you consider automating a user interface. But it could still be worth having that feature, for those cases where there really is no other option.
 
Hi,
Amazing plugin, very useful! I am using it for lots of macros. I have a question, do you think I can also use this plugin for the following:

I have many audio cues ordered in folders, and I would like to press a hotkey in OBS linked to each folder and to play an audio file, picked randomly from that folder. Can this plugin make it? (basically, hotkey 1 plays any file ABC from folder 1, hotkey 2 plays any file ABC from folder 2 etc). Right now I have many hotkeys, one for each audio file, to turn them visible (and so play them in OBS), then I use Advanced Scene Twitcher for dozens of macro that simply say "if file A is below 5db, make it hidden again" ... so clunky...

Soundboard Dock plugin does not work randomly (nor does it really restart all the sounds, ready to be played again). Any help appreciated!
 
Good day! Please tell me how to configure the plugin, when the donation bar is filled to the maximum, the media file is turned on. is there such a feature in the plugin? Of course, I can put this on the hotkey, but I want automatism. Thanks!
 
Last edited:
Hi,
Amazing plugin, very useful! I am using it for lots of macros. I have a question, do you think I can also use this plugin for the following:

I have many audio cues ordered in folders, and I would like to press a hotkey in OBS linked to each folder and to play an audio file, picked randomly from that folder. Can this plugin make it? (basically, hotkey 1 plays any file ABC from folder 1, hotkey 2 plays any file ABC from folder 2 etc). Right now I have many hotkeys, one for each audio file, to turn them visible (and so play them in OBS), then I use Advanced Scene Twitcher for dozens of macro that simply say "if file A is below 5db, make it hidden again" ... so clunky...

Soundboard Dock plugin does not work randomly (nor does it really restart all the sounds, ready to be played again). Any help appreciated!
There's the Random action, which chooses a *Macro* at random to run. If you don't change your library very much, then it could work to have a macro with no condition (so it doesn't run on its own) for each file, and then put all of the macros that you want to choose from into the Random action.

To streamline the cleanup afterward, you might use this condition, instead of a specific one for each:
1720808270307.png

This works better if you have a separate scene for each thing, so then you can either switch to a specific scene, or to the Previous Scene like I do (play any video, and then this one macro goes back to the same camera that I was on).

Don't be afraid to have lots of scenes! With relatively few things in each. If you're presently using them as folders, try doing that with their naming convention instead, and their order in the list.
 
Good day! Please tell me how to configure the plugin, when the donation bar is filled to the maximum, the media file is turned on. is there such a feature in the plugin? Of course, I can put this on the hotkey, but I want automatism. Thanks!
How would it know about the donation bar? Is there an API for it? Do you *have* to watch that part of the screen? Once you have that answer, you can make it a condition, in place of the hotkey.
 
I really like Advanced Scene Switcher - it's such a powerful tool. I'm wondering, is there any way to use it to bring the "scenes" dock into focus automatically? Is it possible to interact with OBS's UI to simulate a click in a specific window or dock? Or is there another way to do this? I'm using an M1 mac.

I'm helping a with a friend's set up for a theatre show. They are advancing through their scenes one at a time, using the down arrow key on a remote from the stage. At one point they will go to the computer and quickly type something and press a hotkey. This triggers an advanced scene switcher macro that goes through a series of steps. At the end of this, they'll be back onstage, and they want to advance to the next scene with the down arrow on their remote. The problem is, if they forget to click back into the scenes list, there is no way for them to advance to the next scene because the scenes dock is no longer in focus. I want to add a step to the end of the macro that refocuses on the correct dock. Any ideas for how to make this work?
 
I really like Advanced Scene Switcher - it's such a powerful tool. I'm wondering, is there any way to use it to bring the "scenes" dock into focus automatically? Is it possible to interact with OBS's UI to simulate a click in a specific window or dock? Or is there another way to do this? I'm using an M1 mac.

I'm helping a with a friend's set up for a theatre show. They are advancing through their scenes one at a time, using the down arrow key on a remote from the stage. At one point they will go to the computer and quickly type something and press a hotkey. This triggers an advanced scene switcher macro that goes through a series of steps. At the end of this, they'll be back onstage, and they want to advance to the next scene with the down arrow on their remote. The problem is, if they forget to click back into the scenes list, there is no way for them to advance to the next scene because the scenes dock is no longer in focus. I want to add a step to the end of the macro that refocuses on the correct dock. Any ideas for how to make this work?
I wonder if you need to change how it works normally, so that it doesn't need that focus.

OBS can be made to be a slideshow, as you say you're doing, but it's not really meant for that. It's more of a free-form TV studio. My first thought is that a slideshow should probably run from an actual slideshow app, like PowerPoint, LibreOffice Impress, OpenLP, ProPresenter, Keynote, etc... Lots of those to choose from, with a wide variety of functionality and price, that don't necessarily correlate with each other.

I like OpenLP myself. It's free, and has its own remote control interface, so it doesn't need focus at all. Just turn it on in the settings, download a phone app (NOT from the app store, but from the QR code in OpenLP's settings), connect the phone app to the desktop app, and you have a dedicated controller that doesn't lose focus.

If you're only running a local display and speakers, then you can run the show directly from OpenLP, without OBS involved at all. Or you can capture it in OBS as part of a larger production.

I expect other apps to follow a similar idea, with variations on how the remote works if at all, how you set it up, what you can do with it, etc.
 
Back
Top