diff --git a/PROTOCOL.md b/PROTOCOL.md new file mode 100644 index 00000000..df97d66c --- /dev/null +++ b/PROTOCOL.md @@ -0,0 +1,92 @@ +obs-websocket protocol reference +================================ + +## General introduction +**This document is still a WIP. Some things are missing (but won't stay like this for long).** + +Messages exchanged between the client and the server are JSON objects. +The protocol in general in based on the OBS Remote protoctol created by Bill Hamilton, with new commands specific to OBS Studio. + +## Events + +### Description +Events are sent exclusively by the server and broadcasted to every client connected to the server. +An event message has at least one field : +- **update-type** (string) : the type of event +Additional fields will be present in the event message if the event type requires it. + +### Event types +#### "SwitchScenes" +OBS is switching to another scene. +Additional fields : +- **scene-name** : the name of the scene being switched to + +#### "ScenesChanged" +The scene list has been modified (scenes added, removed or moved). + +#### "StreamStarting" +Streaming is starting but isn't completely started yet. + +#### "StreamStarted" +*New in OBS Studio* +Streaming has been started successfully. + +#### "StreamStopping" +Streaming is stopping but isn't completely stopped yet. + +#### "StreamStopped" +*New in OBS Studio* +Streaming has been stopped successfully. + +#### "RecordingStarting" +*New in OBS Studio* +Recording is starting but isn't completely started yet. + +#### "RecordingStarted" +*New in OBS Studio* +Recording has been started successfully. + +#### "RecordingStopping" +*New in OBS Studio* +Recording is stopping but isn't completely stopped yet. + +#### "RecordingStopped" +*New in OBS Studio* +Recording has been stopped successfully. + +#### "Exiting" +*New in OBS Studio* +OBS is exiting. + +## Requests + +### Description +Requests are sent by the client and have at least two fields : +- **"request-type"** (string) : one of the request types listed in the sub-section "Requests". +- **"message-id"** (unsigned integer) : an integer number defined by the client that will be embedded in the response from the server. +Depending on the request type, additional fields are needed in the request message (see the "Request types" section below for more informations). + +Once a request is sent, the server processes it and sends a JSON response to the client with the following fields in it : +- **"message-id"** (unsigned integer) : the unsigned integer you specified in the request. +- **"status"** (string) : two possible values : "ok" or "error". +- **"error"** (string) : the error message associated with an error reponse (when "status" equals "error"). +Additional fields can be sent in the response if a request type requires it. + +### Request types +#### "GetVersion" +#### "GetAuthRequired" +#### "Authenticate" +#### "GetCurrentScene" +#### "SetCurrentScene" +#### "GetSceneList" +#### "SetSourceRender" +#### "StartStopStreaming" +#### "StartStopRecording" +*New in OBS Studio* +#### "GetStreamingStatus" +#### "GetTransitionList" +*New in OBS Studio* +#### "GetCurrentTransition" +*New in OBS Studio* +#### "SetCurrentTransition" +*New in OBS Studio* \ No newline at end of file diff --git a/README.md b/README.md index 69b54dce..c84bb8ec 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,14 @@ Websocket API for OBS Studio. You need QT 5.7 (with QtWebSockets), CMake, and a working development environment for OBS Studio installed on your computer. ## How to build -You'll need to fill these CMake variables : +In CMake, you'll need to fill these CMake variables : - **QTDIR** (path) : location of the Qt environment suited for your compiler and architecture - **LIBOBS_INCLUDE_DIR** (path) : location of the libobs subfolder in the source code of OBS Studio - **LIBOBS_LIB** (filepath) : location of the obs.lib file - **OBS_FRONTEND_LIB** (filepath) : location of the obs-frontend-api.lib file + +After building the obs-websocket plugin's binary, copy its Qt dependencies (QtCore, QtNetwork and QtWebSockets library binaries)in the same folder. + +## How to use +There's currently no frontend or language API available for obs-websocket. However, the full protocol reference is documented in the [PROTOCOL.md](PROTOCOL.md) file. +A simple websocket client can connect to the plugin's embedded server. \ No newline at end of file