mediapackagev2 / Client / create_channel
create_channel¶
- mediapackagev2.Client.create_channel(**kwargs)¶
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.
See also: AWS API Documentation
Request Syntax
response = client.create_channel( ChannelGroupName='string', ChannelName='string', ClientToken='string', InputType='HLS'|'CMAF'|'MULTIVIEW', Description='string', InputSwitchConfiguration={ 'MQCSInputSwitching': True|False, 'PreferredInput': 123 }, OutputHeaderConfiguration={ 'PublishMQCS': True|False }, MultiviewConfiguration={ 'AvailableSources': [ 'string', ], 'AvailableLayouts': [ 'LAYOUT_2EH'|'LAYOUT_2PL'|'LAYOUT_3EL'|'LAYOUT_3PL'|'LAYOUT_4E'|'LAYOUT_4PL', ] }, OutputLockingMode='EPOCH_LOCKED'|'NON_EPOCH_LOCKED', Tags={ 'string': 'string' } )
- Parameters:
ChannelGroupName (string) –
[REQUIRED]
The 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.
ChannelName (string) –
[REQUIRED]
The 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. You can’t change the name after you create the channel.
ClientToken (string) –
A unique, case-sensitive token that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
InputType (string) –
The input type is an immutable field. It defines whether the channel allows CMAF ingest, HLS ingest, or server-side multiview output. Multiview channels receive no ingest of their own. If unprovided, the value defaults to HLS.
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).MULTIVIEW– Server-side multiview. The channel receives no ingest of its own. Instead, it composites video from the source channels in itsMultiviewConfigurationinto a single tiled output stream.
Description (string) – Enter any descriptive text that helps you to identify the channel.
InputSwitchConfiguration (dict) –
The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when
InputTypeisCMAF.MQCSInputSwitching (boolean) –
When true, AWS Elemental MediaPackage performs input switching based on the MQCS. Default is false. This setting is valid only when
InputTypeisCMAF.PreferredInput (integer) –
For CMAF inputs, indicates which input MediaPackage should prefer when both inputs have equal MQCS scores. Select
1to prefer the first ingest endpoint, or2to prefer the second ingest endpoint. If you don’t specify a preferred input, MediaPackage uses its default switching behavior when MQCS scores are equal.
OutputHeaderConfiguration (dict) –
The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when
InputTypeisCMAF.PublishMQCS (boolean) –
When true, AWS Elemental MediaPackage includes the MQCS in responses to the CDN. This setting is valid only when
InputTypeisCMAF.
MultiviewConfiguration (dict) –
The multiview configuration for the channel. This setting is required when
InputTypeisMULTIVIEW, and can’t be set for any other input type.AvailableSources (list) – [REQUIRED]
The channels that players can use as tiles in this multiview channel’s output. Each source channel must be in the same channel group as the multiview channel, and must have an
InputTypeofCMAF. Only the channels that you list here are available as tiles.(string) –
AvailableLayouts (list) – [REQUIRED]
The tile layouts that players can request from this multiview channel’s origin endpoints. Only the layouts that you list here are available. Each layout must appear at most once.
(string) –
A tile layout for a multiview channel. Each layout determines how many source tiles are composited into the output and how those tiles are arranged.
The allowed values are:
LAYOUT_SINGLE– One tile at full resolution. Use this to serve a single source as a standard stream.LAYOUT_2EH– Two tiles of equal size, arranged horizontally.LAYOUT_2PL– Two tiles, with one larger primary tile.LAYOUT_3EB– Three tiles of equal size, with two on top and one below.LAYOUT_3EL– Three tiles of equal size, arranged in two columns.LAYOUT_3PL– Three tiles, with one larger primary tile on the left and two stacked on the right.LAYOUT_4E– Four tiles of equal size, arranged in a two-by-two grid.LAYOUT_4PL– Four tiles, with one larger primary tile on the left and three stacked on the right.
OutputLockingMode (string) –
The output locking mode for the channel. This setting is only valid when
InputTypeisCMAF. This value is immutable after channel creation. If you don’t specify a value, the default isEPOCH_LOCKED.The allowed values are:
EPOCH_LOCKED- The channel uses epoch-locked behavior with deterministic sequence numbering and fixed segment boundaries aligned to epoch time. This mode supports cross-region synchronization and failover.NON_EPOCH_LOCKED- The channel uses non-epoch-locked behavior with duration-based segment combining and monotonically increasing sequence numbers starting from 0. This mode does not support cross-region synchronization or failover.
Tags (dict) –
A comma-separated list of tag key:value pairs that you define. For example:
"Key1": "Value1","Key2": "Value2"(string) –
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'MultiviewConfiguration': { 'AvailableSources': [ 'string', ], 'AvailableLayouts': [ 'LAYOUT_2EH'|'LAYOUT_2PL'|'LAYOUT_3EL'|'LAYOUT_3PL'|'LAYOUT_4E'|'LAYOUT_4PL', ] }, 'AttachedMultiviewChannels': [ 'string', ], 'Arn': 'string', 'ChannelName': 'string', 'ChannelGroupName': 'string', 'CreatedAt': datetime(2015, 1, 1), 'ModifiedAt': datetime(2015, 1, 1), 'Description': 'string', 'IngestEndpoints': [ { 'Id': 'string', 'Url': 'string' }, ], 'InputType': 'HLS'|'CMAF'|'MULTIVIEW', 'ETag': 'string', 'Tags': { 'string': 'string' }, 'InputSwitchConfiguration': { 'MQCSInputSwitching': True|False, 'PreferredInput': 123 }, 'OutputHeaderConfiguration': { 'PublishMQCS': True|False }, 'OutputLockingMode': 'EPOCH_LOCKED'|'NON_EPOCH_LOCKED' }
Response Structure
(dict) –
MultiviewConfiguration (dict) –
The multiview configuration for the channel. This is present only when
InputTypeisMULTIVIEW.AvailableSources (list) –
The channels that players can use as tiles in this multiview channel’s output. Each source channel must be in the same channel group as the multiview channel, and must have an
InputTypeofCMAF. Only the channels that you list here are available as tiles.(string) –
AvailableLayouts (list) –
The tile layouts that players can request from this multiview channel’s origin endpoints. Only the layouts that you list here are available. Each layout must appear at most once.
(string) –
A tile layout for a multiview channel. Each layout determines how many source tiles are composited into the output and how those tiles are arranged.
The allowed values are:
LAYOUT_SINGLE– One tile at full resolution. Use this to serve a single source as a standard stream.LAYOUT_2EH– Two tiles of equal size, arranged horizontally.LAYOUT_2PL– Two tiles, with one larger primary tile.LAYOUT_3EB– Three tiles of equal size, with two on top and one below.LAYOUT_3EL– Three tiles of equal size, arranged in two columns.LAYOUT_3PL– Three tiles, with one larger primary tile on the left and two stacked on the right.LAYOUT_4E– Four tiles of equal size, arranged in a two-by-two grid.LAYOUT_4PL– Four tiles, with one larger primary tile on the left and three stacked on the right.
AttachedMultiviewChannels (list) –
The multiview channels, in the same channel group, that list this channel as an available source. This is a read-only field. You can’t delete a channel while any multiview channel still lists it as a source. Use this field to find the multiview channels that you need to update first.
(string) –
Arn (string) –
The Amazon Resource Name (ARN) associated with the resource.
ChannelName (string) –
The 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.
ChannelGroupName (string) –
The 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.
CreatedAt (datetime) –
The date and time the channel was created.
ModifiedAt (datetime) –
The date and time the channel was modified.
Description (string) –
The description for your channel.
IngestEndpoints (list) –
The list of ingest endpoints.
(dict) –
The ingest domain URL where the source stream should be sent.
Id (string) –
The system-generated unique identifier for the IngestEndpoint.
Url (string) –
The ingest domain URL where the source stream should be sent.
InputType (string) –
The input type is an immutable field. It defines whether the channel allows CMAF ingest, HLS ingest, or server-side multiview output. Multiview channels receive no ingest of their own. If unprovided, the value defaults to HLS.
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).MULTIVIEW– Server-side multiview. The channel receives no ingest of its own. Instead, it composites video from the source channels in itsMultiviewConfigurationinto a single tiled output stream.
ETag (string) –
The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.
Tags (dict) –
The comma-separated list of tag key:value pairs assigned to the channel.
(string) –
(string) –
InputSwitchConfiguration (dict) –
The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when
InputTypeisCMAF.MQCSInputSwitching (boolean) –
When true, AWS Elemental MediaPackage performs input switching based on the MQCS. Default is false. This setting is valid only when
InputTypeisCMAF.PreferredInput (integer) –
For CMAF inputs, indicates which input MediaPackage should prefer when both inputs have equal MQCS scores. Select
1to prefer the first ingest endpoint, or2to prefer the second ingest endpoint. If you don’t specify a preferred input, MediaPackage uses its default switching behavior when MQCS scores are equal.
OutputHeaderConfiguration (dict) –
The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when
InputTypeisCMAF.PublishMQCS (boolean) –
When true, AWS Elemental MediaPackage includes the MQCS in responses to the CDN. This setting is valid only when
InputTypeisCMAF.
OutputLockingMode (string) –
The 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.
Exceptions
mediapackagev2.Client.exceptions.ConflictExceptionmediapackagev2.Client.exceptions.ThrottlingExceptionmediapackagev2.Client.exceptions.AccessDeniedExceptionmediapackagev2.Client.exceptions.InternalServerExceptionmediapackagev2.Client.exceptions.ValidationExceptionmediapackagev2.Client.exceptions.ResourceNotFoundExceptionmediapackagev2.Client.exceptions.ServiceQuotaExceededException