https://github.com/tinodo/obsclient
A Complete .NET Client for OBS Studio 28 and up.
https://github.com/tinodo/obsclient
obs obs-studio obs-websocket websocket websockets
Last synced: 11 months ago
JSON representation
A Complete .NET Client for OBS Studio 28 and up.
- Host: GitHub
- URL: https://github.com/tinodo/obsclient
- Owner: tinodo
- License: mit
- Created: 2022-12-07T08:12:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T19:15:20.000Z (about 2 years ago)
- Last Synced: 2025-06-28T05:05:15.390Z (12 months ago)
- Topics: obs, obs-studio, obs-websocket, websocket, websockets
- Language: C#
- Homepage:
- Size: 437 KB
- Stars: 20
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ObsClient
A Complete cross platform .NET WebSocket Client for OBS Studio version 28 and up.
Currently implementing: [**obs-websocket 5.3.0 Protocol**](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md)
Our intent is to create a complete and easy to use client for OBS Studio.
## Installation
Install from the [NuGet Gallery](https://www.nuget.org/packages/OBSClient)
Or through the NuGet CLI: `NuGet\Install-Package OBSClient -Version 2.1.1`
From the command line: `dotnet add package OBSClient --version 2.1.1`
## Sample usage
### Simple
```
ObsClient client = new();
bool isConnected = await client.ConnectAsync();
if (isConnected)
{
await client.SetCurrentProgramScene("Gaming Scene");
Monitor[] monitors = await client.GetMonitorList();
client.Disconnect();
}
client.Dispose();
```
### Request Batch
```
ObsClient client = new();
bool isConnected = await client.ConnectAsync(true, "P@ssw0rd", "localhost", 4455, EventSubscriptions.Filters | EventSubscriptions.Scenes);
if (isConnected)
{
RequestBatchMessage batchRequest = new();
batchRequest.AddToggleVirtualCamRequest();
batchRequest.AddSetStudioModeEnabledRequest(true);
batchRequest.AddSleepRequest(5000, null);
batchRequest.AddToggleVirtualCamRequest();
batchRequest.AddSetStudioModeEnabledRequest(false);
var result = await _client.SendRequestBatchAsync(batchRequest, 6000);
client.Disconnect();
}
client.Dispose();
```
[](https://sonarcloud.io/summary/new_code?id=tinodo_obsclient)

[](https://www.nuget.org/packages/obsclient)