Skip to main content

live_inputs

Creates, updates, deletes, gets or lists a live_inputs resource.

Overview

Namelive_inputs
TypeResource
Idcloudflare.streams.live_inputs

Fields

The following fields are returned by SELECT queries:

Retrieve a live input response.

NameDatatypeDescription
createdstring (date-time)The date and time the live input was created. (example: 2014-01-02T02:20:00Z)
deleteRecordingAfterDaysnumberIndicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a null value to remove an existing scheduled deletion.
enabledbooleanIndicates whether the live input is enabled and can accept streams.
metaobjectA user modifiable key-value store used to reference other systems of record for managing live inputs.
modifiedstring (date-time)The date and time the live input was last modified. (example: 2014-01-02T02:20:00Z)
recordingobjectRecords the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.
rtmpsobjectDetails for streaming to an live input using RTMPS.
rtmpsPlaybackobjectDetails for playback from an live input using RTMPS.
srtobjectDetails for streaming to a live input using SRT.
srtPlaybackobjectDetails for playback from an live input using SRT.
statusstringThe connection status of a live input. (, connected, reconnected, reconnecting, client_disconnect, ttl_exceeded, failed_to_connect, failed_to_reconnect, new_configuration_accepted)
uidstringA unique identifier for a live input. (example: 66be4bf738797e01e1fca35a7bdecdcd)
webRTCobjectDetails for streaming to a live input using WebRTC.
webRTCPlaybackobjectDetails for playback from a live input using WebRTC.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlive_input_identifier, account_idRetrieves details of an existing live input.
listselectaccount_idinclude_countsLists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.
createinsertaccount_idCreates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.
updatereplacelive_input_identifier, account_idUpdates a specified live input.
deletedeletelive_input_identifier, account_idPrevents a live input from being streamed to and makes the live input inaccessible to any future API calls.
disableexeclive_input_identifier, account_idPrevents a live input from being streamed to and makes the live input inaccessible to any future API calls until enabled.
enableexeclive_input_identifier, account_idAllows a live input to be streamed to and makes the live input accessible to any future API calls.

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
include_countsboolean

SELECT examples

Retrieves details of an existing live input.

SELECT
created,
deleteRecordingAfterDays,
enabled,
meta,
modified,
recording,
rtmps,
rtmpsPlayback,
srt,
srtPlayback,
status,
uid,
webRTC,
webRTCPlayback
FROM cloudflare.streams.live_inputs
WHERE live_input_identifier = '{{ live_input_identifier }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.

INSERT INTO cloudflare.streams.live_inputs (
defaultCreator,
deleteRecordingAfterDays,
enabled,
meta,
recording,
account_id
)
SELECT
'{{ defaultCreator }}',
{{ deleteRecordingAfterDays }},
{{ enabled }},
'{{ meta }}',
'{{ recording }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Updates a specified live input.

REPLACE cloudflare.streams.live_inputs
SET
defaultCreator = '{{ defaultCreator }}',
deleteRecordingAfterDays = {{ deleteRecordingAfterDays }},
enabled = {{ enabled }},
meta = '{{ meta }}',
recording = '{{ recording }}'
WHERE
live_input_identifier = '{{ live_input_identifier }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.

DELETE FROM cloudflare.streams.live_inputs
WHERE live_input_identifier = '{{ live_input_identifier }}' --required
AND account_id = '{{ account_id }}' --required
;

Lifecycle Methods

Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls until enabled.

EXEC cloudflare.streams.live_inputs.disable
@live_input_identifier='{{ live_input_identifier }}' --required,
@account_id='{{ account_id }}' --required
;