Skip to content

Commit 625fe20

Browse files
Add documentation
1 parent 7ddb292 commit 625fe20

3 files changed

Lines changed: 87 additions & 3 deletions

File tree

README.md

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,88 @@
1-
# obs-controller-api
1+
# OBS-Controller API
22

3-
This is a simple API for controlling OBS Studio.
4-
Still under development.
3+
This is an API for controlling OBS Studio via HTTP requests.
4+
It is written in Java with Spring Boot and uses
5+
the [obs-websocket](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#startrecord)
6+
plugin.
7+
8+
![OBS Controller API.png](assets/OBS Controller API.png)
9+
10+
## Installation
11+
12+
1. Clone this repository.
13+
2. Run `mvn clean install` in the root directory.
14+
3. Run `java -jar obs-controller-api-0.0.1-SNAPSHOT.jar` in the `target` directory.
15+
4. The API is now running on port 8080.
16+
5. You can access Documentation via Swagger UI at `http://localhost:8080/docs.html`.
17+
18+
## Usage
19+
20+
1. Start OBS Studio.
21+
2. Enable the Websocket Server in OBS Studio.
22+
3. Copy the ipAdresse, port and password of the Websocket Server.
23+
4. Send `POST` requests to `http://localhost:8080/obs/connect` with the following required parameters to connect to the
24+
Websocket Server:
25+
- `ipAdresse`: The ipAdresse of the Websocket Server.
26+
- `port`: The port of the Websocket Server.
27+
- `password`: The password of the Websocket Server.
28+
5. Send a `POST` request to `http://localhost:8080/obs/authenticate` with the following required parameters to
29+
authenticate to the Websocket Server:
30+
- `ipAdresse`: The ipAdresse of the Websocket Server.
31+
- `port`: The port of the Websocket Server.
32+
6. Send a `POST` request to `http://localhost:8080/obs/startRecording` with the following required parameters to start
33+
recording:
34+
- `ipAdresse`: The ipAdresse of the Websocket Server.
35+
- `port`: The port of the Websocket Server.
36+
7. Send a `POST` request to `http://localhost:8080/obs/stopRecording` with the following required parameters to stop
37+
recording:
38+
- `ipAdresse`: The ipAdresse of the Websocket Server.
39+
- `port`: The port of the Websocket Server.
40+
8. Send a `POST` request to `http://localhost:8080/obs/disconnect` with the following required parameters to disconnect
41+
from the Websocket Server:
42+
- `ipAdresse`: The ipAdresse of the Websocket Server.
43+
- `port`: The port of the Websocket Server.
44+
45+
## Available Endpoints
46+
47+
This section lists the available API endpoints for the OBS integration service. Each endpoint is a `POST` request and
48+
requires specific parameters as part of the query string.
49+
50+
### OBS Connection Management
51+
52+
1. **Connect to OBS**
53+
- `POST /obs/connect`
54+
- Parameters: `ipAdresse`, `port`, `password`
55+
- Example: `POST http://localhost:8080/obs/connect?ipAdresse=<ipAdresse>&port=<port>&password=<password>`
56+
57+
2. **Authenticate with OBS**
58+
- `POST /obs/authenticate`
59+
- Parameters: `ipAdresse`, `port`
60+
- Example: `POST http://localhost:8080/obs/authenticate?ipAdresse=<ipAdresse>&port=<port>`
61+
62+
3. **Disconnect from OBS**
63+
- `POST /obs/disconnect`
64+
- Parameters: `ipAdresse`, `port`
65+
- Example: `POST http://localhost:8080/obs/disconnect?ipAdresse=<ipAdresse>&port=<port>`
66+
67+
4. **Reconnect to OBS**
68+
- `POST /obs/reconnect`
69+
- Parameters: `ipAdresse`, `port`
70+
- Example: `POST http://localhost:8080/obs/reconnect?ipAdresse=<ipAdresse>&port=<port>`
71+
72+
### OBS Recording Control
73+
74+
1. **Start Recording**
75+
- `POST /obs/startRecording`
76+
- Parameters: `ipAdresse`, `port`
77+
- Example: `POST http://localhost:8080/obs/startRecording?ipAdresse=<ipAdresse>&port=<port>`
78+
79+
2. **Stop Recording**
80+
- `POST /obs/stopRecording`
81+
- Parameters: `ipAdresse`, `port`
82+
- Example: `POST http://localhost:8080/obs/stopRecording?ipAdresse=<ipAdresse>&port=<port>`
83+
84+
![swagger-doc.png](assets/swagger-doc.png)
85+
86+
## License
87+
88+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

assets/OBS Controller API.png

620 KB
Loading

assets/swagger-doc.png

133 KB
Loading

0 commit comments

Comments
 (0)