Skip to content

Commit e337b0b

Browse files
committed
docs: Move obs-websocket vendor request reference to API.md
- Relocate the vendor request section from README to API.md / API_ja.md - README now points to the API reference for details - Trim internal implementation notes; keep only user-facing limitations
1 parent afda888 commit e337b0b

4 files changed

Lines changed: 194 additions & 2 deletions

File tree

API.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,99 @@ Reads the value of a text input and applies it to the stream recording filename
277277
#### replay-buffer-filename-from-text
278278

279279
Reads the value of a text input and applies it to the replay buffer save filename format. The override takes effect on the next save; the replay buffer itself is not restarted.
280+
281+
## obs-websocket Vendor Requests
282+
283+
The same filename-override operations (and the filter listing helper) are also exposed as **obs-websocket vendor requests**, so external tools, bots, or Stream Deck integrations can drive the plugin over obs-websocket without running an in-process OBS script.
284+
285+
- **Vendor name:** `osi_branch_output`
286+
- **Transport:** obs-websocket 5.x `CallVendorRequest`
287+
- **Requirement:** obs-websocket must be installed. If not, these requests are unavailable.
288+
289+
### Security
290+
291+
Vendor requests require a client authenticated with obs-websocket. The obs-websocket password grants full access to every request below — treat it as a credential equivalent to OBS user authority. When exposing obs-websocket beyond `localhost`, use a strong password and a trusted network.
292+
293+
### Limitations
294+
295+
- `filter_uuid` must be a 36-character hyphenated UUID string. Other shapes are rejected with `"filter_uuid must be a UUID string"`.
296+
- `format` cannot exceed 1024 bytes. Longer strings are rejected with `"format too long"`.
297+
- `filter_uuid` must resolve to a Branch Output filter source. Any other source (including non-existent UUIDs) is rejected with `"Filter not found"`.
298+
- Do not send bursts of requests while a recording transition (file split, restart) is in progress — a request may block until the transition completes.
299+
300+
### `get_filter_list`
301+
302+
Enumerates every Branch Output filter currently loaded in OBS.
303+
304+
| Item | Description |
305+
|------|-------------|
306+
| Request type | `get_filter_list` |
307+
| Request data | *(none)* |
308+
| Response | `{ "success": bool, "error"?: string, "filters": array }` |
309+
310+
Each element of the `filters` array:
311+
312+
| Field | Description |
313+
|-------|-------------|
314+
| `source_name` | Name of the parent source/scene to which the Branch Output filter is applied |
315+
| `source_uuid` | UUID of the parent source/scene |
316+
| `filter_name` | Name of the Branch Output filter |
317+
| `filter_uuid` | UUID of the Branch Output filter (used with the override requests below) |
318+
319+
Filters applied to **private sources** are excluded, matching the Status Dock's visibility rules.
320+
321+
### `override_recording_filename_format`
322+
323+
Overrides the stream-recording filename format for a specific Branch Output filter.
324+
325+
| Item | Description |
326+
|------|-------------|
327+
| Request type | `override_recording_filename_format` |
328+
| Request data | `{ "filter_uuid": string, "format": string }` |
329+
| Response | `{ "success": bool, "error"?: string }` |
330+
| Clearing the override | Pass an empty string for `format`. |
331+
332+
Behavior during recording is identical to the proc handler — see [Overriding the Stream Recording Filename Format](#overriding-the-stream-recording-filename-format) above.
333+
334+
### `override_replay_buffer_filename_format`
335+
336+
Overrides the replay buffer save filename format for a specific Branch Output filter.
337+
338+
| Item | Description |
339+
|------|-------------|
340+
| Request type | `override_replay_buffer_filename_format` |
341+
| Request data | `{ "filter_uuid": string, "format": string }` |
342+
| Response | `{ "success": bool, "error"?: string }` |
343+
| Clearing the override | Pass an empty string for `format`. |
344+
345+
The override takes effect on the next replay buffer save.
346+
347+
### Example
348+
349+
Request:
350+
351+
```json
352+
{
353+
"requestType": "CallVendorRequest",
354+
"requestData": {
355+
"vendorName": "osi_branch_output",
356+
"requestType": "override_recording_filename_format",
357+
"requestData": {
358+
"filter_uuid": "87654321-4321-4321-4321-cba987654321",
359+
"format": "%CCYY-%MM-%DD %hh-%mm-%ss MyScene"
360+
}
361+
}
362+
}
363+
```
364+
365+
Successful response:
366+
367+
```json
368+
{ "success": true }
369+
```
370+
371+
Failure response (invalid UUID):
372+
373+
```json
374+
{ "success": false, "error": "filter_uuid must be a UUID string" }
375+
```

API_ja.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,99 @@ Windows の場合、スクリプトは OBS インストールパスの `data\obs
277277
#### replay-buffer-filename-from-text
278278

279279
テキストインプットの値を読み取ってリプレイバッファー保存時のファイル名フォーマットに反映します。オーバーライドは次回の保存時に反映され、リプレイバッファー自体は再起動しません。
280+
281+
## obs-websocket vendor request
282+
283+
上記のファイル名オーバーライドおよびフィルター一覧取得機能は、**obs-websocket の vendor request** としても公開されています。OBS のスクリプト機構を使わず、外部ツールやボット、Stream Deck 連携から obs-websocket 経由で直接操作できます。
284+
285+
- **ベンダー名 (vendor name):** `osi_branch_output`
286+
- **トランスポート:** obs-websocket 5.x の `CallVendorRequest`
287+
- **必要条件:** obs-websocket がインストールされていること。未インストールの場合は以下のリクエストは利用できません。
288+
289+
### セキュリティ
290+
291+
vendor request は obs-websocket に認証済みのクライアントからのみ受け付けられます。obs-websocket のパスワードは以下のすべてのリクエストに対するフルアクセス権と等価であり、OBS ユーザー相当の資格情報として扱ってください。obs-websocket を `localhost` 以外に公開する場合は、強固なパスワードと信頼できるネットワークを使用してください。
292+
293+
### 制限事項
294+
295+
- `filter_uuid` は 36 文字のハイフン付き UUID 文字列である必要があります。それ以外の形式は `"filter_uuid must be a UUID string"` で拒否されます。
296+
- `format` は 1024 バイトを超えられません。超過した場合は `"format too long"` で拒否されます。
297+
- `filter_uuid` は Branch Output フィルターソースに解決される必要があります。他種別のソースや存在しない UUID は `"Filter not found"` で拒否されます。
298+
- 録画遷移中(ファイル分割、リスタート)にリクエストを連続送信すると、遷移完了までリクエストがブロックされることがあります。
299+
300+
### `get_filter_list`
301+
302+
現在 OBS にロードされている Branch Output フィルター一覧を列挙します。
303+
304+
| 項目 | 内容 |
305+
|------|------|
306+
| リクエストタイプ | `get_filter_list` |
307+
| リクエストデータ | *(なし)* |
308+
| レスポンス | `{ "success": bool, "error"?: string, "filters": array }` |
309+
310+
`filters` 配列の各要素:
311+
312+
| フィールド | 内容 |
313+
|-----------|------|
314+
| `source_name` | Branch Output フィルターが適用されている親ソース/シーン名 |
315+
| `source_uuid` | 親ソース/シーンの UUID |
316+
| `filter_name` | Branch Output フィルターの名前 |
317+
| `filter_uuid` | Branch Output フィルターの UUID(下記のオーバーライドリクエストで使用) |
318+
319+
**プライベートソース**に適用されたフィルターは、ステータスドックの表示ルールに合わせて結果から除外されます。
320+
321+
### `override_recording_filename_format`
322+
323+
指定した Branch Output フィルターのストリーム録画ファイル名フォーマットをオーバーライドします。
324+
325+
| 項目 | 内容 |
326+
|------|------|
327+
| リクエストタイプ | `override_recording_filename_format` |
328+
| リクエストデータ | `{ "filter_uuid": string, "format": string }` |
329+
| レスポンス | `{ "success": bool, "error"?: string }` |
330+
| オーバーライド解除 | `format` に空文字列を指定 |
331+
332+
録画中の挙動はプロシージャハンドラと同一です。上記の[録画中の挙動](#ストリーム録画ファイル名フォーマットのオーバーライド)を参照してください。
333+
334+
### `override_replay_buffer_filename_format`
335+
336+
指定した Branch Output フィルターのリプレイバッファ保存ファイル名フォーマットをオーバーライドします。
337+
338+
| 項目 | 内容 |
339+
|------|------|
340+
| リクエストタイプ | `override_replay_buffer_filename_format` |
341+
| リクエストデータ | `{ "filter_uuid": string, "format": string }` |
342+
| レスポンス | `{ "success": bool, "error"?: string }` |
343+
| オーバーライド解除 | `format` に空文字列を指定 |
344+
345+
オーバーライドは次回のリプレイバッファ保存時に反映されます。
346+
347+
### 呼び出し例
348+
349+
リクエスト:
350+
351+
```json
352+
{
353+
"requestType": "CallVendorRequest",
354+
"requestData": {
355+
"vendorName": "osi_branch_output",
356+
"requestType": "override_recording_filename_format",
357+
"requestData": {
358+
"filter_uuid": "87654321-4321-4321-4321-cba987654321",
359+
"format": "%CCYY-%MM-%DD %hh-%mm-%ss MyScene"
360+
}
361+
}
362+
}
363+
```
364+
365+
成功時のレスポンス:
366+
367+
```json
368+
{ "success": true }
369+
```
370+
371+
失敗時のレスポンス(UUID 形式不正の場合):
372+
373+
```json
374+
{ "success": false, "error": "filter_uuid must be a UUID string" }
375+
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Branch Output exposes public procedures that let external scripts override the s
119119

120120
Sample scripts (`recording-filename-from-text` and `replay-buffer-filename-from-text`) are bundled with the plugin in both **Python** (`.py`) and **Lua** (`.lua`) variants, and can be loaded from OBS Tools → Scripts.
121121

122-
See the [API reference](./API.md) for procedure signatures, sample code, and usage instructions for the bundled scripts.
122+
See the [API reference](./API.md) for procedure signatures, sample code, and usage instructions for the bundled scripts. The same filename-override operations are also exposed as **obs-websocket vendor requests** for integration with external tools, bots, and Stream Deck plugins — see the API reference for details.
123123

124124
# Development
125125

README_ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Branch Output は、外部スクリプトから実行時にストリーム録画
121121

122122
サンプルスクリプト(`recording-filename-from-text` および `replay-buffer-filename-from-text`)は、**Python**`.py`)版と **Lua**`.lua`)版の両方がプラグインに同梱されており、OBS の Tools → Scripts からロードして使用できます。
123123

124-
プロシージャのシグネチャ、サンプルコード、同梱スクリプトの使用方法については [API リファレンス](./API_ja.md) を参照してください。
124+
プロシージャのシグネチャ、サンプルコード、同梱スクリプトの使用方法については [API リファレンス](./API_ja.md) を参照してください。同じファイル名オーバーライド機能は **obs-websocket の vendor request** としても公開されており、外部ツールやボット、Stream Deck 連携から利用できます。詳細は API リファレンスを参照してください。
125125

126126
# Development
127127

0 commit comments

Comments
 (0)