obs-websocket - Remote-control OBS Studio using WebSockets

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

Markimoos

New Member
Hello, I'm using OBS version 25.0.8 and I just installed the websocket version 4.8 that's supposed to be working for OBS Studio 25 or above. Problem is, I can't seem to find the "Websocket Server Settings" option under "Tools". Did I install a wrong websocket version? Any help would be greatly appreciated!
 

PeteyGrrr

New Member
I have OBS 27.0.1 installed on Mint Linux 20. I've d/l'ed 4.9.1-1 but I get this error when I try to install it: "Error: Dependency is not satisfiable: obs-studio (>= 26.1.0)" and I'm at a loss to proceed. Suggestions?
 

NicoPlaysThings

New Member
I am on OBS 27.0.1 while using obs.live and for some reason, after installing obs websocket, it doesn't show up in tools, am I doing something wrong?
 

Notinasnaid

New Member
(Duplicate of post at https://obsproject.com/forum/thread...al-analysis-web-sockets-also-involved.145612/)
I'm not quite sure of the best way to report this crash. I have done a certain amount of source code analysis, and it seems to lie in a grey area between OBS itself and the OBS web sockets plug-in, but I'm leaning more towards it being a core OBS issue. The crash has shown itself in the final OBS 26.x and in 27.0 on Mac (M1, Big Sur). It happens during change of Scene Collection. This is what seems to be happening in one particular crash.

- Nothing is written to the OBS log from this point
- The Scene Collection change starts
- All current sources are destroyed. Notifications are sent (from OBS events to OBS web sockets events) showing this has happened.
- About 0.2 seconds pass. The scene collection has not yet loaded and the UI is locked.
- An external app sends a request via OBS web sockets "GetSceneList". It does this every second, so it's likely to hit a lot of scene item collection changes.
- This results in a call to obs_frontend_get_scenes, and this function crashes. Details SYSSEGV, offset + 120 (version 27.0).

I speculate that the data structures in the UI are not in a good state at this point in the scene collection change. It would be better to lock out requests if they are going to cause crashes. Perhaps an event OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING could also be sent; this could also clue in monitor processes to just not bother themselves until OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED is sent, because even if all the requests are ok, there is likely to be a lot of redundant work.

I am working with a customised OBS websockets plug-in and would happily add tests to avoid this problem, but I can't really see what to look for. (The only other plug-in loaded is OBS Audio Monitor).
 

enge

New Member
I know that, :P
You can't even target the password text box without that checkbox checked. ;)
What I am saying that it does not save. Below is a link to an animated GIF that shows that there is something in there, but when I type in there to change it to something that I actually know, it will not save, it just defaults to the 8 characters.

https://www.headshotdomain.net/modules/Image_Repository/files/10002/pM2PW0xH4D.gif

I have tried using shorter passwords, larger passwords like I did in that animation, I tried alphanumerical, just numbers, just letters, caps and no caps, and a mix of caps and alphanumerical, and nothing worked. It just won't let me change the password. As for the password that is in there, I do not know what it is because I did not enter a password when I installed this.

Having 100% the same issue. On Mac, reinstalled obs-websocket pluging with brew. Just going to carry forward developing without password and loop back around when there's an explanation. But I'm also at a loss
 

coRpSE

Member
Having 100% the same issue. On Mac, reinstalled obs-websocket pluging with brew. Just going to carry forward developing without password and loop back around when there's an explanation. But I'm also at a loss

Okay, I figured it out, well, got it working on my end, sort of. Don't use alphanumeric, just use a string of numbers. Overall, the password should use more than just numbers, it should be alphanumeric along with alt characters if they actually want it to be secured, but for me, I found just doing a string of 10 numbers worked. I don't know the character limit, but I hope that helps.

For the Dev, think about making it at least alphanumeric, and if it is, then, there is a problem
 

Technologywell

New Member
I still think `heartbeat` is a superfluous function. Most of the data in it has been moved to `streamstatus`, which is great. But not everything.

There are still a few pieces of data that need to get moved over:
It is indeed a superfluous function. I want to get rid of it, but I don't want to break compatibility with existing applications. I'll get rid of it in 5.0.
 

bcoyle

Member
One thing that developers fear is depending on a function and then having it disappear, which could cause app failure
 

YashinskiDev

New Member
Hello everyone,

TLDR;
Cant call SetFilenameFormatting and SetRecordingFolder whlile advnced output mode is set.

I have been using this plugin for a while now and it's pretty amazing.
Though I have recently arrived at an "unsurpassable wall" of some sort.
Up until today my setup was using the "Simple" setting at the Settings->Output->Output Mode and I was able to set the recording location and name of my files remotely with ease.
Today, I have decided to update my output to DnxHd, which requires an "Advanced" output mode setting.
Activating this setting prevents me from setting the recording folder and file name remotely.

Am I missing something or should I settle with the "Simple" output mode?

Thanks :)
 
Hello there,

I have a question about connecting to obs websocket and status information. I'm making a web page that can control scenes from my phone but after a while if the page isn't focussed/active it will disconnect. So as a prevention i have added some code that reconnects every time the page is refocussed just in case. This isn't the most elegant solution as I would rather just check to see if the connection is still active but I'm having trouble with that as well. Now this could be something I have missed but I cant seem to see any method or what have you to check the connection status while using the JavaScript library. I'm looking to basically check the connection is active and if it is then skip trying to connect to it again. Is that possible? If not is it ok to keep making connections to the obs websocket? Like it wont get to the point it will stop working becuase it thinks too many connections are being made? Is there a better way or reconnecting than just using obs.connect again?

Hope that makes sense!

Thanks a lot in advance :)

All the best,
Will :)
 

Barabba

Member
If it may sound interesting for someone, it's possibile to change scenes from an http page though clicking an http link, I've realized a mosaic on a static web page and I can swtich cameras from any device, by browser.
The client and server (websoket obs) should be present on the same network, or on internet if you properly NAT the websocket port (I suggest you to use higher unknow port namber against attacks.
In the http server there should be placed the websockets client, a .js file, I attach it here. In the html should be present:

Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <script type="text/javascript" src="http://192.168.24.2/OBS-WebSocket.js"></script>
    <title>WEBSOCKET TEST</title>
</head>


<body>

    <a align="center" href="#" onclick="setCurrentScene('SCENE-NAME-ON-OBS')">TEST</a>

<script>
function setCurrentScene(scenename) {
const obs = new OBSWebSocket();
    obs.connect({address: '192.168.24.2:4444'
    });
    obs.on('ConnectionOpened', () => {
        obs.send('SetCurrentScene', {
                'scene-name': scenename
         });
    });
    }
</script>
</body>
</html>
 

Attachments

  • obs-websocket.zip
    29 KB · Views: 248
In your example, does “192.168.24.2” represent the server that the HTML is launched from?

if there are any other bits that need to change for MY use, can you change your example to use something like “your_scene_name”, etc?
 

Barabba

Member
In your example, does “192.168.24.2” represent the server that the HTML is launched from?

if there are any other bits that need to change for MY use, can you change your example to use something like “your_scene_name”, etc?
Hi, yes, it's web server (I use "small server") and also runs OBS with Websockets running on port 4444
 

oosman

New Member
I know that, :P
You can't even target the password text box without that checkbox checked. ;)
What I am saying that it does not save Descargar Whatsapp Aero APK. Below is a link to an animated GIF that shows that there is something in there, but when I type in there to change it to something that I actually know, it will not save, it just defaults to the 8 characters.

https://www.headshotdomain.net/modules/Image_Repository/files/10002/pM2PW0xH4D.gif

I have tried using shorter passwords, larger passwords like I did in that animation, I tried alphanumerical, just numbers, just letters, caps and no caps, and a mix of caps and alphanumerical, and nothing worked. It just won't let me change the password. As for the password that is in there, I do not know what it is because I did not enter a password when I installed this.
I copied the files and dropped them into the subfolder for OBS plugins. VOILA - it appears to be working. True test will be when I'm on site and on the same network to see if my mobile devices will connect. Fingers cross.
 

awezmtv

New Member
Hello any way of doing a 2 PC setup with the websocket with Loupedeck (LD) Live? no way of putting ip in but it works if OBS is installed on my PC with hte LD plugged into
 

Mateusz1990

New Member
Hi three,
I have major problem. I run OBS with websocket on windows pc. When I try to execute button in bitfocus companion triggering hotkey (change to scene) OBS crashes, sometimes executes hotkey once then freeze sometimes freeze immediately. I really need this working, do you have any solutions?
 

bcoyle

Member
Hi three,
I have major problem. I run OBS with websocket on windows pc. When I try to execute button in bitfocus companion triggering hotkey (change to scene) OBS crashes, sometimes executes hotkey once then freeze sometimes freeze immediately. I really need this working, do you have any solutions?
Hi. This might not apply to you. I'm writing a 3rd party app and have had a number of obs crashes. I experimented and found that if I give a command to change a source (i know you said scene) that obs seems to get busy doing that and if I send another command (over websocket) too soon (within 60ms on my computer) it will crash "sometimes". So, I make sure to space out such commands by at least 100ms. I found that 0 ms , the crash happens (with less trys) quickly, 40ms takes more trys to crash it and 50 even more. Then at 60ms, maybe not at all. So if you are sending multiple commands, then maybe you should space them out. Like I said, this may not apply to you. If your scene is ffmpeg and it is set to release the file when finished, it may be loading the new file, which is where I have trouble.
 

Mateusz1990

New Member
Hi. This might not apply to you. I'm writing a 3rd party app and have had a number of obs crashes. I experimented and found that if I give a command to change a source (i know you said scene) that obs seems to get busy doing that and if I send another command (over websocket) too soon (within 60ms on my computer) it will crash "sometimes". So, I make sure to space out such commands by at least 100ms. I found that 0 ms , the crash happens (with less trys) quickly, 40ms takes more trys to crash it and 50 even more. Then at 60ms, maybe not at all. So if you are sending multiple commands, then maybe you should space them out. Like I said, this may not apply to you. If your scene is ffmpeg and it is set to release the file when finished, it may be loading the new file, which is where I have trouble.
I'm trying to execute just one command. I tried to offset even that but always crashing. My setup below
 

Attachments

  • received_538220030785627.jpeg
    received_538220030785627.jpeg
    55.7 KB · Views: 110
Top