obsproject / obs-websocket

Remote-control of OBS Studio through WebSocket
GNU General Public License v2.0
3.86k stars 707 forks source link

Requests: Add SaveOutputScreenshot #1156

Open oleksandrpodran opened 1 year ago

oleksandrpodran commented 1 year ago

Description

Adds a new request called SaveOutputScreenshot which takes a screenshot of the main OBS output.

Motivation and Context

I am currently developing a plugin that utilizes the OBS WebSocket Server. One of the essential commands I need to include is the ability to capture an output screenshot. This command must be made available in the OBS WebSocket Server.

How Has This Been Tested?

Tested OS(s): macOS Ventura 13.4.1 Testing method: Postman After successfully connection, I send this command:

{
    "op": 6,
    "d": {
        "requestType": "SaveOutputScreenshot",
        "requestId": "19b2e224-67b8-470a-a216-fc0f6a87160e"
    }
}

Then I received responses:

{
    "d": {
        "requestId": "19b2e224-67b8-470a-a216-fc0f6a87160e",
        "requestStatus": {
            "code": 100,
            "result": true
        },
        "requestType": "SaveOutputScreenshot"
    },
    "op": 7
}
{
    "d": {
        "eventData": {
            "savedScreenshotPath": "/Users/oooooo/Movies/Screenshot 2023-07-24 15-52-42.png"
        },
        "eventIntent": 1024,
        "eventType": "ScreenshotSaved"
    },
    "op": 5
}

Types of changes

Checklist: