a8d27ede9e
A new `executionType` field has been added to the `RequestBatch` Op Types added: - `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_REALTIME`(default) - `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_FRAME` - `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_PARALLEL` `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_REALTIME`: - Same as how request batches have always worked. - Requests are processed in-order - Requests are processed as soon as possible by one worker thread - The `Sleep` request blocks execution for a specified amount of real world time `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_FRAME`: - New! - Requests are processed in-order - Requests are processed on the graphics thread. BE VERY CAREFUL NOT TO OVERLOAD THE GRAPHICS THREAD WITH LARGE REQUESTS. A general rule of thumb is for your request batches to take a maximum of 2ms per frame of processing. - Requests processing starts right before the next frame is composited. This functionality is perfect for things like `SetSceneItemTransform` - The `Sleep` request will halt processing of the request batch for a specified number of frames (ticks) - To be clear: If you do not have any sleep requests, all requests in the batch will be processed in the span of a single frame - For developers: The execution of requests gets profiled by the OBS profiler under the `obs-websocket-request-batch-frame-tick` name. This value (shown in the OBS log after OBS shutdown) represents the amount of time that the graphics thread spent actively processing requests per frame. This tool can be used to determine the amount of load that your request batches are placing on the graphics thread. `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_PARALLEL`: - New! - Requests are processed asynchronously at the soonest possible time. - Requests are processed by the core obs-websocket thread pool, where the number of workers == the number of threads on your machine. - If you have 12 threads on your machine, obs-websocket will be able to process 12 requests at any given moment. - The `results` array is populated by order of request completion. Consider the order to be random. - The `Sleep` request will return an error if attempted to be used in this mode. - Note: This feature is experimental and can increase the chances of causing race conditions (crashes). While the implementation is fully thread-safe, OBS itself is not. Usage of this is only recommended if you are processing very large batches and need the performance benefit. - Example use case: Performing `SaveSourceScreenshot` on 8 sources at once. |
||
---|---|---|
.github | ||
CI | ||
cmake | ||
data/locale | ||
deps | ||
docs | ||
installer | ||
src | ||
.editorconfig | ||
.gitignore | ||
.gitmodules | ||
BUILDING.md | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
crowdin.yml | ||
LICENSE | ||
README.md | ||
SSL-TUNNELLING.md |
obs-websocket
YOU HAVE STUMBLED UPON THE DEV BRANCH FOR V5.0.0
- You can find the main protocol spec here: PROTOCOL.md.
- You can find the planned requests sheet here
WebSockets API for OBS Studio.
Downloads
Binaries for Windows, MacOS, and Linux are available in the Releases section.
Homebrew
If you're using MacOS you can use Homebrew for installation as well:
brew install obs-websocket
Using obs-websocket
Here is a list of available web clients: (compatible with tablets and other touch interfaces)
- (No known clients supporting 5.0.0)
It is highly recommended to protect obs-websocket with a password against unauthorized control. To do this, open the "Websocket server settings" dialog under OBS' "Tools" menu. In the settings dialogs, you can enable or disable authentication and set a password for it.
(Psst. You can use --websocket_port
(value), --websocket_password
(value), and --websocket_debug
(flag) on the command line to override the configured values.)
Possible use cases
- Remote control OBS from a phone or tablet on the same local network
- Change your stream overlay/graphics based on the current scene
- Automate scene switching with a third-party program (e.g. : auto-pilot, foot pedal, ...)
For developers
The server is a typical Websockets server running by default on port 4444 (the port number can be changed in the Settings dialog). The protocol understood by the server is documented in PROTOCOL.md.
Here's a list of available language APIs for obs-websocket :
- Python 3.7+ (Asyncio): simpleobsws by IRLToolkit
We'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in #project-showoff
in the discord server!
Securing obs-websocket (via TLS/SSL)
If you are intending to use obs-websocket outside of a LAN environment, it is highly recommended to secure the connection using a tunneling service.
See the SSL tunnelling guide for easy instructions on how to encrypt your websocket connection.
Compiling obs-websocket
See the build instructions.
Translations
Your help is welcome on translations.
Please join the localization project on Crowdin
Contributors
Code Contributors
This project exists thanks to all the people who contribute. Contribute.
Financial Contributors
Become a financial contributor and help us sustain our community. Contribute
Individuals
Organizations
Support this project with your organization. Your logo will show up here with a link to your website. Contribute