Skip to main content

outputs

Creates, updates, deletes, gets or lists an outputs resource.

Overview

Nameoutputs
TypeResource
Idcloudflare.streams.outputs

Fields

The following fields are returned by SELECT queries:

List all outputs associated with a specified live input response.

NameDatatypeDescription
enabledbooleanWhen 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.
streamKeystringThe streamKey used to authenticate against an output's target. (example: uzya-f19y-g2g9-a2ee-51j2)
uidstringA unique identifier for the output. (example: baea4d9c515887b80289d5c33cf01145)
urlstringThe URL an output uses to restream. (example: rtmp://a.rtmp.youtube.com/live2)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectlive_input_identifier, account_idRetrieves all outputs associated with a specified live input.
createinsertlive_input_identifier, account_id, url, streamKeyCreates 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.
updatereplaceoutput_identifier, live_input_identifier, account_id, enabledUpdates the state of an output.
deletedeleteoutput_identifier, live_input_identifier, account_idDeletes 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
live_input_identifierstring
output_identifierstring

SELECT examples

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

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
;

REPLACE examples

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

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
;