Skip to content

v4.0.0-beta1

Pre-release
Pre-release

Choose a tag to compare

@tinodo tinodo released this 27 Oct 18:54
· 40 commits to main since this release
7064aa2

The first prerelease of OBSClient 4.0: the client is brought up to obs-websocket 5.7.6 (3.x implemented 5.5.2), a number of long-standing connection and protocol bugs are fixed, and the library now comes with a test suite, CI/CD and a test app.

Important

This is a prerelease. It is meant to be tried, and its public API can still change before 4.0.0. A plain dotnet add package OBSClient keeps installing 3.0.1 until 4.0.0 is out.

Install

dotnet add package OBSClient --version 4.0.0-beta1

OBSClient 4.0.0-beta1 on NuGet | Documentation | Moving from 3.x to 4.0

What's new

  • obs-websocket 5.7.6, including the multi-canvas support of 5.7.0: GetCanvasList, the CanvasCreated, CanvasRemoved and CanvasNameChanged events, and a canvasUuid on every request that looks up a scene or a source by name. The library targets net8.0 and net10.0.
  • One argument for a name or a UUID. SceneRef, InputRef and SourceRef replace the pairs of overloads. A string, a Guid, or the Scene or Input that OBS Studio gave you convert implicitly, so SetCurrentProgramScene("Gaming Scene") still reads the same.
  • Part of a transform. SceneItemTransformUpdate changes some members of the transform of a scene item without sending the others: current.ToUpdate() with { ScaleX = 2 }.
  • Generated from the protocol. The requests, responses, events and enums come from obs-websocket's own protocol.json, and conformance tests check every request and event against it, together with captures of a real OBS Studio. It is still one assembly.
  • A test app (WinUI 3, Fluent 2) to try every request and event by hand against your own OBS Studio. It shows what the client returned, what OBS Studio sent, and a comparison of the two.

Fixes that matter

  • SetInputSettings no longer ends the connection. No response type was registered for it, so reading the answer threw inside the receive loop: the connection was dead while ConnectionState kept saying Connected (#17, and the symptoms of #15). A receive loop that ends for any reason now always cleans up, so ConnectionClosed is raised and AutoReconnect works.
  • Requests that are waiting when the connection is lost fail at once. ConnectAsync no longer hangs when the connection is lost during the handshake. A response that arrives after its request timed out can no longer take the connection down.
  • haltOnFailure of a request batch takes effect, the data of a CustomEvent arrives, state changes of inputs and scene items are no longer dropped, and a password with a non-ASCII character authenticates.
  • Requests that could never succeed now do: SetInputMute by UUID, GetInputDeinterlaceFieldOrder, GetInputAudioMonitorType, CreateRecordChapter, and GetSceneSceneTransitionOverride for a scene without an override.

Breaking changes

Most code that compiled against 3.x still compiles, but it has to be recompiled. What does break: named arguments (inputName: and sceneName: are now input: and scene:), a method group converted to a delegate, the settings type of CreateInput and SetCurrentSceneTransitionSettings, Scene (a UUID is required and the index is nullable), CreateRecordChapter (it returns Task), and a few members that are nullable now. Moving from 3.x to 4.0 lists all of it, with the fix for each, and the CHANGELOG has the complete history.

Assets

File What it is
OBSClient.4.0.0-beta1.nupkg The package: the exact file that was pushed to nuget.org and to GitHub Packages.
OBSClient.TestApp-4.0.0-beta1-win-x64.zip The test app. Unzip it and start OBSClient.TestApp.exe. It is self-contained (nothing else has to be installed), built for Windows 10 version 1809 and later, x64. It is not code signed, so Windows may warn that the publisher is unknown; compare the checksum below.

SHA-256:

c69971d3899bca85c8e21b161e2d2483de0174f084577c946ef0df338a9927d3  OBSClient.4.0.0-beta1.nupkg
9a30e9fea7e3718a12cfe261dd257bb80981a0084f8e5067bbf760f91d6c7ff9  OBSClient.TestApp-4.0.0-beta1-win-x64.zip

Please report what you find in an issue. Thanks to @Kenshin9977, @FaNim21 and @gdantuono for the reports that led to the connection fixes.