Node.js binding for libobs – OBS studio's internal library
github.com
github.com
Streamlabs OBS is a fork of OBS Studio with an added Electron wrapper. Streamlabs' primary focus for their OBS fork is to integrate directly with their paid services and other integrations. Due to the electron wrapper, "SLOBS" is known to underperform and crash unexpectedly.
Personally I'm concerned for the direction of Streamlabs OBS, with more and more of it's code becoming closed source or otherwise unavailable. They are also declining new streaming services be added to the tool, unless the service pays money, or has enough clout. For their business, the direction makes complete sense however I can't help but feel this is hurting the overall open source community.
Somehow this is the first time that I'm learning that OBS has a documented internal interface that can be separated from its UI at all, let alone imported into other projects. It's not really Streamlab's product that makes this interesting, so much as that there are a number of other scenarios where it might be nice to build a tool around OBS without building an extension into the app itself.
https://obsproject.com/docs/backend-design.html
I'm kind of curious now to see what would be possible here. Maybe it would be overkill, but it would be interesting to try and get OBS's backend working as, say, a quick command line gif tool. OBS also supports setting itself up as a virtual camera, which is really useful, but it's a little cumbersome to manage that through the UI itself, maybe a smaller wrapper would be more useful. Or even if it's possible to embed libobs and use it headlessly on a Raspberry Pi with a couple of webcams as the source.
Maybe people have already done this stuff and I'm just out of the loop.
I think the only concern is taking attention away from an opensourse solution when they could get more funding/attention to keep it current. Though I doubt it will ever go away, since once you deal with a crash or something weird with SLOBS you immediately go back to OBS.
Its OBS on training wheels, shiny pay for more shiny training wheels.
For example, it can't tolerate WHITESPACES in paths, and the pull request for the fix been sitting rotting for years.
1. a (typically) non-compiled language wrapper around the internal library
2. a (normally) non-compiled language used for scripting inside the application
Guess which one is easier to do? For bonus points, present a case for one of them being better than the other
I'm guessing 2) would be easier to implement as 1) would require using the FFI of the wrapping language, which can be challenging. Also, the scripting language is likely to be well-documented as I assume it's core functionality readily available from the GUI. (Although, as a counter-example to this, I found GIMP's Scheme scripting terribly under-documented, so not always.)
> For bonus points, present a case for one of them being better than the other
2) is clearly better because it treats the whole OBS application as a black box and just pipes (or whatever) scripting command strings to OBS.
1) is clearly better because performance. Ee're talking about a video streaming app, so performance is essential.
OBS is open source software and various third parties have tried to wrap it up into a commercial services offering. They embed it in something like an Electron app and then have it talk with their paid-for services, all through node.
I run a few channels similar to this one, which provide value by showcasing how the top-end League of Legends players play the game:
https://www.youtube.com/channel/UCMvtjPFhJR0BeErid-s1Zbg/vid...
Manually curating all of these videos would take a lot of time and effort.
In order to record these videos, I have scripts set up that load high level games ready to spectate, start watching via the League of Legends spectator client, play the replay back, start recording using OBS, programmatically adding an overlay to the videos showcasing information (which would be much harder to do post-production as this would require re-encoding a full 25-50 minute video each time), stop recording with OBS, and then upload to YouTube with relevant title / description / thumbnail.
I could (and have looked into) hooking directly into windows APIs to do the recording, and editing of the videos, but it is much easier with OBS.
But I'm also using this code in a consumer focused desktop client, for gamers to record their own gameplay and review it back (replays.lol)
The obs-studio-node integration code can be found here: https://github.com/davidweatherall/replayslol-obs-recorder/b...
The purpose of this code is to find the active league of legends executable, create a 'Game Capture' source with the league of legends window as the input, and then add that source to a 'Scene', and then start recording when triggered, and stop recording when triggered.
The function (setupScene) on line 55 is the interesting OBS stuff.
Unfortunately this doesn't include any overlay stuff, but it's all done in a similar way, where I add a source with a locally hosted server as a 'Browser' Source on top of the gameplay, with the parameters of the URL telling the server what information I want to be displayed on the website.
The overlay is just a website, with a transparent background, and content determined by the parameters. - Here is what the website base code looks like - https://gist.github.com/davidweatherall/68e6d4422ce4c0b6fbcc...
So that’s one use case; building bloated Electron based software where a native application was doing the job excellently already.
https://obsproject.com/forum/resources/obs-websocket-remote-...
NodeJS lib: