obs-websocket - Remote-control OBS Studio using WebSockets

obs-websocket - Remote-control OBS Studio using WebSockets 5.0.1

Kevin Ross

New Member
Hi everyone
I am currently making a small software to my obs.I am working in VisualBasic
I would like to list my Sources In The Scenes.
Can anyone help for me with this problem because I dont know how to do it.
Thanks for any kind of help

GetCurrentScene will include the sources that are in the scene. Or if you're in studio mode, GetPreviewScene will do the same, for the currently previewed scene.

I don't know of a way to get the sources for just any arbitrary scene, other than making it active first.
 

Kevin Ross

New Member
Hi, I have this installed and working on my streaming PC, but I use a Elgato stream deck on my main PC. Is there anyway that something can be linked to one of the buttons on my stream deck to control things like muting, scene switching, starting/stopping, etc? Also, I am using the web browser, and when I add a column for audio, it does not show the audio from the NDi sources I have from Scan Converter. Is there any fix for this? Thanks.

Yes, I am using this plugin with the Stream Deck. It requires a small helper program (that I wrote) that gets called when you push a button on the Stream Deck, it sends off the appropriate command to the websocket, which can be on the same computer, or a different computer, if your Stream Deck and OBS are on different computers.

WARNING, don't run programs from random people on the internet! But if you want to live dangerously, you can use the small helper program I wrote, which will link the Stream Deck buttons to actions in OBS.

This program depends on the Visual C++ 2017 Runtime, which you might already have installed. If not, you can download it from https://aka.ms/vs/15/release/VC_redist.x86.exe

Extract it someplace on your computer that has the Stream Deck (for example, for me I would put it in c:\users\kevin), then in the Stream Deck software, go to System -> Open, and drag that to a button. For "App / File" paste in the following:

To change to a scene:
C:\users\kevin\ws_send.exe localhost 4444 "{\"request-type\":\"SetCurrentScene\",\"scene-name\":\"Camera 2\",\"message-id\":\"\"}"

Replace c:\users\kevin with the location where you stored the file.
Replace localhost with the IP address of your streaming computer, if it isn't on the same computer as the Stream Deck.
Replace Camera 2 with the name of the scene you want to switch to.
Replace SetCurrentScene with SetPreviewScene if you're using studio mode.

To execute a transition if you're in studio mode:
C:\users\kevin\ws_send.exe localhost 4444 "{\"request-type\":\"TransitionToProgram\",\"with-transition\":{\"name\":\"Cut\"},\"message-id\":\"\"}"

Replace "Cut" with the name of the transition you want to use, e.g. "Fade"

There are many, many more things you can do. The complete list is at https://github.com/Palakis/obs-websocket/blob/master/docs/generated/protocol.md
 

Attachments

  • ws_send.zip
    111.7 KB · Views: 386
Last edited:

DLE5EL

New Member
Is it possible to use obs remote/websocket to enable twitch chat to trigger key strokes?

Example - Viewer types in chat !jump ... (space bar key stroke activated) ... result = character jumps in-game.
 

Kevin Ross

New Member
Use a chat bot (e.g. deepbot) that monitors the chat, and can execute custom commands, such as sending keystrokes to the game. This actually has nothing to do with obs websocket or obs remote.
 

vvbash

New Member
Hello! I apologize for my English, but I hope you understand me. :)
I am broadcasting with a large number of scenes (5 video cameras, plus various PIP combinations, plus opening credits and titres). All this is controlled by man in the editing room. For his and my convenience, I developed and assembled two hardware devices: indicators of the selected scene (which is installed in the studio) and an autonomous keyboard for switching scenes. There is a video of how this works, but only in Russian.

But there is a problem: the obs-websocket transmits quite a lot of “extra” information and the memory capacity of my devices is not always enough to receive such large packages.

I hope the plugin author will read it: it would be good to provide in the new version the possibility to include an abbreviated version of the packages. For example, when requesting a list of scenes, transfer only the names of the scenes, without their description. At the moment, to get a list of scenes, I have to initialize the device by simply to switch them all in turn, in order to receive information in relatively small packets.
 

Lanpingner

New Member
GetCurrentScene will include the sources that are in the scene. Or if you're in studio mode, GetPreviewScene will do the same, for the currently previewed scene.

I don't know of a way to get the sources for just any arbitrary scene, other than making it active first.

Dear Rose
I found a way but my problem is thats only can show if i give the number of the source.
Do you know I can show all the sources.
here is my code
0 mean the first socues I want to list out all

For Each scene In obs.ListScenes
ListBox2.Items.Add(scene.Items.ToList.Item(0).SourceName.ToString)

Next
 

DLE5EL

New Member
Use a chat bot (e.g. deepbot) that monitors the chat, and can execute custom commands, such as sending keystrokes to the game. This actually has nothing to do with obs websocket or obs remote.
Do you know where i could find an example of this kind of command?
 

Kevin Ross

New Member
Dear Rose
I found a way but my problem is thats only can show if i give the number of the source.
Do you know I can show all the sources.
here is my code
0 mean the first socues I want to list out all

For Each scene In obs.ListScenes
ListBox2.Items.Add(scene.Items.ToList.Item(0).SourceName.ToString)

Next

I figured out that GetSceneList will return an array of scene objects, which will include the list of sources for each scene. So one single call, GetSceneList, will give you all the scenes, as well as all the sources for each scene. Formatted as JSON, of course.

From the code sample you posted, it looks like you already have a list of sources for each scene (the scene.Items collection). I suppose you can do something like "For Each item in scene.Items" or maybe "For Each item in scene.Items.ToList"
 

peejaygee

New Member
All of a sudden my OBS Remote (using OBS Websocket 4.4.0) is causing OBS Studio (22.0.2, 64 bit) - to 'Not Respond' and all I've done is done a windows update, the ones that automatically come down. I don't know were to start to look. I've tried checking a few things, like the firewall to see if it blocked a port (for some reason) I've tried adding the port back into the firewall (even though I shouldn't need too over a local network). I can manually switch scenes at the moment, but I prefer to use my cell phone or remote software to change scenes, etc. Also commands from Streamlabs Chatbot won't work.

Edit1 also based on another post about a 'not responding' issue, I made sure my graphics drivers were the latest version.
Edit2 I have also tried with and without authentication, and also changing the default port I was using to another one.
Edit3 I notice that I'm getting a lot, and I mean a lot of 'obs-broswer-page.exe' generated in the task manager.
Edit4, so 24 hours later, I tried again, it worked once, and then it went back to 'not responding' after I tried it again, I did nothing with the machine/software except restart it and wait once while the 'not responding' was there.
Edit5, so I waited, maybe 3 minutes, then it connected? weird.

Anybody else having this issue, or at least what log file should I be looking for, or trying some tests while I'm offline and not streaming.

Can anybody help me please?
 
Last edited:

Palakis

Developer
Palakis updated obs-websocket - Remote control of OBS Studio made easy with a new update entry:

[Pre-Release] obs-websocket 4.5.0

Only use this release with OBS 22 or above!

Changes since 4.4.0
  • New request types:
    • Filter management:
      • GetSourceFilters
      • AddFilterToSource
      • RemoveFilterFromSource
      • ReorderSourceFilter
      • MoveSourceFilter
      • SetSourceFilterSettings
    • Scene Items:
      • DeleteSceneItem
      • DuplicateSceneItem
      • ReorderSceneItems
    • Source settings:
      • GetTextFreetype2Properties
      • SetTextFreetype2Properties
  • Updated...

Read the rest of this update entry...
 

vugs

New Member
I find your work amazing. I'm working currently on creating an API to be able to control OBS remotely and your WebSocket is simply amazing, but I want to know if there's a way to interact with other plugins.
 

OBSnewby

Member
Hi.Ive just intalled the plugin. how do I know if it is installed correctly? There is some kind of message or button in OBS? In my older (20.0.2) obs version I could see a websocket button under TOOLS, but Im with the latest obs version and that button is gone.
Really thanks
 
Last edited:

devomate

New Member
Hi,

Awesome plugin, allows for so much more to be done with OBS.

I am having the same experience as OBSnewby using version 22.0.3 (which to be fair is in beta) so I can use the NVENC implementation. This plugin does not appear under "Tools"

If I revert back to 22.0.2 (currently GA version) it appears. Do we just have to wait for 22.0.3 to go live in Feb for plugins to start working?

Thanks!
 

TAG

New Member
Plugin not working with OBS23-RC2 Any chance for a hotfix? My stream misses my bot scripts...
 

Narcogen

Active Member
Workaround suggested is to delete Qt5Network.dll from bin/64bit. If you do that it should work in RC2. (Doublecheck in the test build forum, near the end of that thread, to be sure, but this suggestion did work for me).
 

delphisaurus

New Member
Also, I could be paranoid, or maybe missing something, but isn't it dangerous to make the stream key available via this plugin - for example, in theory, when accessed from a web browser the javascript could fetch the key after user connects/authenticates and do anything it wants with it without the user knowing, no?
 
Top