outputs
Creates, updates, deletes, gets or lists an outputs resource.
Overview
| Name | outputs |
| Type | Resource |
| Id | cloudflare.streams.outputs |
Fields
The following fields are returned by SELECT queries:
- list
List all outputs associated with a specified live input response.
| Name | Datatype | Description |
|---|---|---|
enabled | boolean | When enabled, live video streamed to the associated live input will be sent to the output URL. When disabled, live video will not be sent to the output URL, even when streaming to the associated live input. Use this to control precisely when you start and stop simulcasting to specific destinations like YouTube and Twitch. |
streamKey | string | The streamKey used to authenticate against an output's target. (example: uzya-f19y-g2g9-a2ee-51j2) |
uid | string | A unique identifier for the output. (example: baea4d9c515887b80289d5c33cf01145) |
url | string | The URL an output uses to restream. (example: rtmp://a.rtmp.youtube.com/live2) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | live_input_identifier, account_id | Retrieves all outputs associated with a specified live input. | |
create | insert | live_input_identifier, account_id, url, streamKey | Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs. | |
update | replace | output_identifier, live_input_identifier, account_id, enabled | Updates the state of an output. | |
delete | delete | output_identifier, live_input_identifier, account_id | Deletes an output and removes it from the associated live input. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
live_input_identifier | string | |
output_identifier | string |
SELECT examples
- list
Retrieves all outputs associated with a specified live input.
SELECT
enabled,
streamKey,
uid,
url
FROM cloudflare.streams.outputs
WHERE live_input_identifier = '{{ live_input_identifier }}' -- required
AND account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs.
INSERT INTO cloudflare.streams.outputs (
enabled,
streamKey,
url,
live_input_identifier,
account_id
)
SELECT
{{ enabled }},
'{{ streamKey }}' /* required */,
'{{ url }}' /* required */,
'{{ live_input_identifier }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: outputs
props:
- name: live_input_identifier
value: "{{ live_input_identifier }}"
description: Required parameter for the outputs resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the outputs resource.
- name: enabled
value: {{ enabled }}
description: |
When enabled, live video streamed to the associated live input will be sent to the output URL. When disabled, live video will not be sent to the output URL, even when streaming to the associated live input. Use this to control precisely when you start and stop simulcasting to specific destinations like YouTube and Twitch.
default: true
- name: streamKey
value: "{{ streamKey }}"
description: |
The streamKey used to authenticate against an output's target.
- name: url
value: "{{ url }}"
description: |
The URL an output uses to restream.
REPLACE examples
- update
Updates the state of an output.
REPLACE cloudflare.streams.outputs
SET
enabled = {{ enabled }}
WHERE
output_identifier = '{{ output_identifier }}' --required
AND live_input_identifier = '{{ live_input_identifier }}' --required
AND account_id = '{{ account_id }}' --required
AND enabled = {{ enabled }} --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Deletes an output and removes it from the associated live input.
DELETE FROM cloudflare.streams.outputs
WHERE output_identifier = '{{ output_identifier }}' --required
AND live_input_identifier = '{{ live_input_identifier }}' --required
AND account_id = '{{ account_id }}' --required
;