Saturday, March 8, 2025

OBS PLUGIN - Advanced Scene Switcher

 Advanced Scene Switcher


Advanced Scene Switcher | OBS Forums

The basis of Advanced scene switcher is to detect the presence (or lack thereof) of a condition in OBS and follow a set of subsequent steps


Here are some examples:

SCENE

If a Specific Scene is Displayed -> Setup something in Preview
A real world condition might be if you go to a camera that is setup as a close up some someone, perhaps you would want to automatically set the preview screen with their name at the bottom.

If Advanced scene Switcher detects a specific scene in program, it can automatically ensure a specific scene is put into the preview monitor.  

Here we have 2 scenes, a closeup shot in preview (left) and a wide shot in program (right)


Useing AsS we can have a 3rd scene set into preview automatically with their name ready to be cut in using a rule like this:


This rule is 
If the current (program) scene matches (IE Camera 1 Closeup) 
then
Put the scene "Camera 1 Closeup with Name" into the preview window. 

So with out AsS running, when you go to the closeup shot in program, the prewiew window will switch to the old program window. 


BUT with AsS running with the rule as above, you will get this instead happen:


CLIPBOARD

Here we've created a scene with a wideshot and the text "This is a news flash"

Now we'll create a rule that if the computers clipboard contains the next "Breaking News", this scene will automatically be displayed.





CURSOR

Trigger something to happen depending on where the cursor is, if it detects motion or if a left, middle or right mouse button is selected.

In this example, we will set OBS to automatically go to the wide shot if the cursor is put into the upper left corner of the screen.

If the cursor moves to position X=0 and Y=0  (upper left corner of screen), it will automatically switch to the wide shot.


Current view



Mouse pointer goes to upper left corner

The shot becomes this:



DATE

   Have something occur at a specific date


In this example, at 13.:44 everyday, the system will start recording.

You could then have another macro that would stop the recording everyday at 15:00

DISPLAY

If OBS detects a certain display to be part of the system, it can send a specific video to that monitor.



FILE

You can have something occur in OBS if a file is present, or contains data. 
 In this example, we have a file called Closeup Activation.txt in the folder
C:\OBS Advanced Scene Switcher

If the content of this file has "Present" in it, OBS will automatically switch to the "Camera 1 Closeup"



The file looks like:




FILTER

Trigger an event if the "FILTER" on a specific scene or Source is active 

In this example, if the chroma filter is applied to the source called "Closeup Chroma" (which is an image in front of a green screen) then it will switch to a new scene applying a background (winter snow) to the image.  If its not there, it will disable it.   This uses the "ELSE" fuction.

The result:


FOLDER WATCH

If an event happens in a folder, have it do something in OBS.

In this example, although we show several specific options, if OBS detects ANY change in a folder, it will switch the scene to a wideshot.

HOTKEY

This allows a macro to be triggered based on a hotkey.  When selected, the hotkey NAME in the macro will match to a hotkey entry in the settings portion of OBS.

IDLE

If the system detects no key or mouse movements, it will trigger.  

In this example, after 5 seconds, OBS will goto a Wideshot.

WEBSOCKETS

Here's some info about sending a request from one OBS to another OBS using Websockets.  
We'll use the integration that is in Advanced Scene switcher that can help you get things working

Websockets is built into OBS.
You need to enable it (on the receiving computer), set a port and password.


In this example, the main OBS is sending a command to the "GraphicsComputer" to change the scene to "Game-Normal"
After selecting a "Websocket", the gear icon will let you create a name for this connection, and allow you to enter in the IP, port and password.


The Code is:
This sets the program to a specific scene

{

"d":

{

"requestData" : {"sceneName": "Main Follow"},

"requestId": "someUniqueIdHere",

"requestType" : "SetCurrentProgramScene"

},

"op": 6

}


This sets the preview to a specific scene


{

"d":

{

"requestData" : {"sceneName": "Main Follow"},

"requestId": "someUniqueIdHere",

"requestType" : "SetCurrentPreviewScene"

},

"op": 6

}


On your receiving end, the graphics computer, you want to have Websockets running, and the Gear Icon allows you to ensure you have a proper connection IP, port and password.


It doesn't need Advanced sceneswitcher running.


Here's a link to the github site with all the commands that you could potentially use.

obs-websocket/docs/generated/protocol.md at master · obsproject/obs-websocket · GitHub


Here are a couple of examples

START RECORDING


{

"d": 

{

"requestData" : {},

"requestId": "someUniqueIdHere",

"requestType" : "StartRecord"

},

"op": 6

}


STOP RECORDING

{

"d":

{

"requestData" : {},

"requestId": "someUniqueIdHere",

"requestType" : "StopRecord"

},

"op": 6

}


HTML


I wanted to send a command from OBS to Vmix.  In this situation, OBS is the switcher, vMIX is the replay, so during a replay, i wanted to remote trigger vmix without needing an operator to do it.


vMIX can take web requests.  So in this example, I'm triggering the request using an HTTP request in the Advanced Scene Switcher.


The configuration looks like this. 


This is the syntax
http://VMIX-IP:PORT/api/?Function=COMMAND

Here's a list of possible commands that could be sent.

No comments:

Post a Comment

Feel free to leave a comment! If you have any information that you think should be included, please do so here and I'll get it added in.