Skip to main content

channels

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

Overview

Namechannels
TypeResource
Idaws.mediapackagev2.channels

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) associated with the resource.
channel_group_namestringThe name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
channel_namestringThe name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
created_atstring (date-time)The date and time the channel was created.
descriptionstringThe description for your channel.
e_tagstringThe current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource. (pattern: <code>[\S]+</code>)
ingest_endpointsarrayThe list of ingest endpoints.
input_switch_configurationobjectThe configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive.
input_typestringThe input type will be an immutable field which will be used to define whether the channel will allow CMAF ingest or HLS ingest. If unprovided, it will default to HLS to preserve current behavior. The allowed values are: HLS - The HLS streaming specification (which defines M3U8 manifests and TS segments). CMAF - The DASH-IF CMAF Ingest specification (which defines CMAF segments with optional DASH manifests). (HLS, CMAF)
modified_atstring (date-time)The date and time the channel was modified.
output_header_configurationobjectThe settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN.
output_locking_modestringThe output locking mode configured for the channel. The allowed values are: EPOCH_LOCKED - The channel uses epoch-locked behavior with deterministic sequence numbering and fixed segment boundaries aligned to epoch time. NON_EPOCH_LOCKED - The channel uses non-epoch-locked behavior with duration-based segment combining and monotonically increasing sequence numbers starting from 0. (EPOCH_LOCKED, NON_EPOCH_LOCKED)
reset_atstring (date-time)The time that the channel was last reset.
tagsobjectThe comma-separated list of tag key:value pairs assigned to the channel.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_channelselectchannel_group_name, channel_name, regionRetrieves the specified channel that's configured in AWS Elemental MediaPackage.
list_channelsselectchannel_group_name, regionmaxResults, nextTokenRetrieves all channels in a specific channel group that are configured in AWS Elemental MediaPackage.
create_channelinsertchannel_group_name, region, ChannelNamex-amzn-client-tokenCreate a channel to start receiving content streams. The channel represents the input to MediaPackage for incoming live content from an encoder such as AWS Elemental MediaLive. The channel receives content, and after packaging it, outputs it through an origin endpoint to downstream devices (such as video players or CDNs) that request the content. You can create only one channel with each request. We recommend that you spread out channels between channel groups, such as putting redundant channels in the same AWS Region in different channel groups.
update_channelupdatechannel_group_name, channel_name, regionx-amzn-update-if-matchUpdate the specified channel. You can edit if MediaPackage sends ingest or egress access logs to the CloudWatch log group, if content will be encrypted, the description on a channel, and your channel's policy settings. You can't edit the name of the channel or CloudFront distribution details. Any edits you make that impact the video output may not be reflected for a few minutes.
delete_channeldeletechannel_group_name, channel_name, regionDelete a channel to stop AWS Elemental MediaPackage from receiving further content. You must delete the channel's origin endpoints before you can delete the channel.
reset_channel_stateexecchannel_group_name, channel_name, regionResetting the channel can help to clear errors from misconfigurations in the encoder. A reset refreshes the ingest stream and removes previous content. Be sure to stop the encoder before you reset the channel, and wait at least 30 seconds before you restart the encoder.

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
channel_group_namestringThe name of the channel group that contains the channel that you are resetting.
channel_namestringThe name of the channel that you are resetting.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return in the response.
nextTokenstringThe pagination token from the GET list request. Use the token to fetch the next page of results.
x-amzn-client-tokenstringA unique, case-sensitive token that you provide to ensure the idempotency of the request.
x-amzn-update-if-matchstringThe expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.

SELECT examples

Retrieves the specified channel that's configured in AWS Elemental MediaPackage.

SELECT
arn,
channel_group_name,
channel_name,
created_at,
description,
e_tag,
ingest_endpoints,
input_switch_configuration,
input_type,
modified_at,
output_header_configuration,
output_locking_mode,
reset_at,
tags
FROM aws.mediapackagev2.channels
WHERE channel_group_name = '{{ channel_group_name }}' -- required
AND channel_name = '{{ channel_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create a channel to start receiving content streams. The channel represents the input to MediaPackage for incoming live content from an encoder such as AWS Elemental MediaLive. The channel receives content, and after packaging it, outputs it through an origin endpoint to downstream devices (such as video players or CDNs) that request the content. You can create only one channel with each request. We recommend that you spread out channels between channel groups, such as putting redundant channels in the same AWS Region in different channel groups.

INSERT INTO aws.mediapackagev2.channels (
ChannelName,
InputType,
Description,
InputSwitchConfiguration,
OutputHeaderConfiguration,
OutputLockingMode,
Tags,
channel_group_name,
region,
`x-amzn-client-token`
)
SELECT
'{{ ChannelName }}' /* required */,
'{{ InputType }}',
'{{ Description }}',
'{{ InputSwitchConfiguration }}',
'{{ OutputHeaderConfiguration }}',
'{{ OutputLockingMode }}',
'{{ Tags }}',
'{{ channel_group_name }}',
'{{ region }}',
'{{ x-amzn-client-token }}'
RETURNING
arn,
channel_group_name,
channel_name,
created_at,
description,
e_tag,
ingest_endpoints,
input_switch_configuration,
input_type,
modified_at,
output_header_configuration,
output_locking_mode,
tags
;

UPDATE examples

Update the specified channel. You can edit if MediaPackage sends ingest or egress access logs to the CloudWatch log group, if content will be encrypted, the description on a channel, and your channel's policy settings. You can't edit the name of the channel or CloudFront distribution details. Any edits you make that impact the video output may not be reflected for a few minutes.

UPDATE aws.mediapackagev2.channels
SET
Description = '{{ Description }}',
InputSwitchConfiguration = '{{ InputSwitchConfiguration }}',
OutputHeaderConfiguration = '{{ OutputHeaderConfiguration }}'
WHERE
channel_group_name = '{{ channel_group_name }}' --required
AND channel_name = '{{ channel_name }}' --required
AND region = '{{ region }}' --required
AND `x-amzn-update-if-match` = '{{ x-amzn-update-if-match}}'
RETURNING
arn,
channel_group_name,
channel_name,
created_at,
description,
e_tag,
ingest_endpoints,
input_switch_configuration,
input_type,
modified_at,
output_header_configuration,
output_locking_mode,
tags;

DELETE examples

Delete a channel to stop AWS Elemental MediaPackage from receiving further content. You must delete the channel's origin endpoints before you can delete the channel.

DELETE FROM aws.mediapackagev2.channels
WHERE channel_group_name = '{{ channel_group_name }}' --required
AND channel_name = '{{ channel_name }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Resetting the channel can help to clear errors from misconfigurations in the encoder. A reset refreshes the ingest stream and removes previous content. Be sure to stop the encoder before you reset the channel, and wait at least 30 seconds before you restart the encoder.

EXEC aws.mediapackagev2.channels.reset_channel_state
@channel_group_name='{{ channel_group_name }}' --required,
@channel_name='{{ channel_name }}' --required,
@region='{{ region }}' --required
;