tinodo / obsclient

A Complete .NET Client for OBS Studio 28 and up.
MIT License
10 stars 2 forks source link

Cannnot Get StreamStatus #2

Closed Parfaitomcat closed 10 months ago

Parfaitomcat commented 11 months ago

I have One(1) trouble on ObsClient

After failing to connect to Stream Server with OBS, Connection Timeout occurs when OBSClient GetStreamStatus() method is called. This problem persists until OBS is restarted.

Parfaitomcat commented 10 months ago

self follow

As a result of analyzing the above problem, it was found that the JSON syntax shown below differs depending on whether OBS was able to connect to the streaming server or not.

According to the OBS-WebSocket protocol sheet, this syntax is non-nullable. On the other hand, since null is actually assigned, it is thought that an error occurred when parsing the JSON syntax.

GetStreamStatus( ) incorrect data :21:39.024: "d": { 10:21:39.024: "requestData": null, 10:21:39.024: "requestId": "bef203bd-4a40-4a9b-bac8-a5b1af1ea86e", 10:21:39.024: "requestType": "GetStreamStatus" 10:21:39.024: }, 10:21:39.024: "op": 6 10:21:39.024: } 10:21:39.024: [obs-websocket] [debug] [WebSocketServer::onMessage] Outgoing message: 10:21:39.024: { 10:21:39.024: "d": { 10:21:39.024: "requestId": "bef203bd-4a40-4a9b-bac8-a5b1af1ea86e", 10:21:39.024: "requestStatus": { 10:21:39.024: "code": 100, 10:21:39.024: "result": true 10:21:39.024: }, 10:21:39.024: "requestType": "GetStreamStatus", 10:21:39.024: "responseData": { 10:21:39.024: "outputActive": false, 10:21:39.024: "outputBytes": 0, 10:21:39.024: "outputCongestion": null, 10:21:39.024: "outputDuration": 0, 10:21:39.024: "outputReconnecting": false, 10:21:39.024: "outputSkippedFrames": 0, 10:21:39.024: "outputTimecode": "00:00:00.000", 10:21:39.024: "outputTotalFrames": 0 10:21:39.024: } 10:21:39.024: }, 10:21:39.024: "op": 7 10:21:39.024: }

Normal data 12:55:12.264: [obs-websocket] [debug] [WebSocketServer::onMessage] Incoming message (decoded): 12:55:12.264: { 12:55:12.264: "d": { 12:55:12.264: "requestData": null, 12:55:12.264: "requestId": "5c3cbc12-438e-4e52-8438-9a1c633ceb0b", 12:55:12.264: "requestType": "GetStreamStatus" 12:55:12.264: }, 12:55:12.264: "op": 6 12:55:12.264: } 12:55:12.265: [obs-websocket] [debug] [WebSocketServer::onMessage] Outgoing message: 12:55:12.265: { 12:55:12.265: "d": { 12:55:12.265: "requestId": "5c3cbc12-438e-4e52-8438-9a1c633ceb0b", 12:55:12.265: "requestStatus": { 12:55:12.265: "code": 100, 12:55:12.265: "result": true 12:55:12.265: }, 12:55:12.265: "requestType": "GetStreamStatus", 12:55:12.265: "responseData": { 12:55:12.265: "outputActive": false, 12:55:12.265: "outputBytes": 0, 12:55:12.265: "outputCongestion": 0.0,
12:55:12.265: "outputDuration": 0, 12:55:12.265: "outputReconnecting": false, 12:55:12.265: "outputSkippedFrames": 0, 12:55:12.265: "outputTimecode": "00:00:00.000", 12:55:12.265: "outputTotalFrames": 0 12:55:12.265: } 12:55:12.265: }, 12:55:12.265: "op": 7 12:55:12.265: }

tinodo commented 10 months ago

I will check it out shortly. See how we fix this...

tinodo commented 10 months ago

It appears that the OBS Websockets component is not adhere to it's on specs. According to the protocol definition indeed, the OuputCongestion should be a number and not be null. But apparently it is. Easiest way to 'fix' the issue is to make the property nullable. The other is to use a custom converter. I will create a custom converter.

It will be fixed in 1.2.1

Parfaitomcat commented 10 months ago

Thank you for your prompt correction. It is true that OBS-WebSocket's JSON syntax did not satisfy the protocol definition. However, I believe that OBS-WebSocket is just converting the information it gets from OBS into JSON syntax, and that OBS is probably passing null to OBS-WebSocket.

Parfaitomcat commented 10 months ago

Please Close this issue