

# Working with packaging configurations in AWS Elemental MediaPackage
Working with packaging configurations

A packaging configuration defines a single delivery point for an asset. The configuration holds all of the information that's needed for AWS Elemental MediaPackage to integrate with a player or content delivery network (CDN), such as Amazon CloudFront. Configure the configuration to output content in one of the available stream formats:
+ Apple HLS – Packages content to Apple HTTP Live Streaming (HLS) 
+ Microsoft Smooth – Packages content for Microsoft Smooth Streaming players
+ Common Media Application Format (CMAF) – Packages content to devices that support Apple HLS fragmented MP4 (fMP4)
+ DASH-ISO – Packages content for the DASH-ISO ABR streaming protocol

The packaging configuration also holds information about digital rights management (DRM) and encryption integration, bitrate presentation order, and more.

**Topics**
+ [

# Creating a packaging configuration
](pkg-cfig-create.md)
+ [

# Viewing packaging configuration details
](pkg-cfig-view.md)
+ [

# Editing a packaging configuration
](pkg-cfig-edit.md)
+ [

# Deleting a packaging configuration
](pkg-cfig-delete.md)

# Creating a packaging configuration


Create a packaging configuration to define how AWS Elemental MediaPackage prepares content for delivery from an asset. 

To create a packaging configuration, you can use the MediaPackage console, the AWS CLI, or the MediaPackage API. For information about creating a packaging configuration with the AWS CLI or MediaPackage API, see [Packaging\$1configurations](https://docs.aws.amazon.com/mediapackage-vod/latest/apireference/packaging_configurations.html) in the *AWS Elemental MediaPackage VOD API Reference*.

When you're creating a packaging configuration, don't put sensitive identifying information like customer account numbers into free-form fields, such as the **ID** field. This applies when you're using the MediaPackage console, MediaPackage API, AWS CLI, or AWS SDKs. Any data that you enter into MediaPackage might get picked up for inclusion in diagnostic logs or Amazon CloudWatch Events.

**Topics**
+ [

# Creating an HLS packaging configuration
](pkg-cfig-create-hls.md)
+ [

# Creating a DASH packaging configuration
](pkg-cfig-create-dash.md)
+ [

# Creating a Microsoft Smooth packaging configuration
](pkg-cfig-create-mss.md)
+ [

# Creating a CMAF packaging configuration
](pkg-cfig-create-cmaf.md)

# Creating an HLS packaging configuration


Create a packaging configuration that formats content for devices that support Apple HLS.

**To create an Apple HLS packaging configuration (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Packaging groups**.

1. On the **Packaging groups** page, choose the group that will contain the configuration that you're creating.

1. On the details page for the packaging group, under **Packaging configurations**, choose **Manage configurations**.

1. On the **Manage packaging configurations** page, under **Packaging configurations**, choose **Add** and select **New config**.

1. Complete the fields as described in the following topics:
   + [General settings fields](cfigs-hls-new.md)
   + [Manifest settings fields](cfigs-hls-manset.md)
   + [Stream selection fields](cfigs-hls-include-streams.md)
   + [Encryption fields](cfigs-hls-encryption.md)

1. Choose **Save**.

If you exceed the quotas for your account when you're creating a packaging configuration, you get an error. If you get an error similar to Too many requests, please try again. Resource limit exceeded, either you have exceeded the API request quotas, or you have already reached the maximum number of packaging groups allowed on your account. If this is your first group, or if you think you mistakenly received this error, use the Service Quotas console to [request quota increases](https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/mediapackage/quotas). For more information about quotas in MediaPackage, see [Quotas in AWS Elemental MediaPackage](quotas.md).

# General settings fields


Provide general settings that apply to the entire packaging configuration.

1. For **ID**, enter a name that describes the configuration. The ID is the primary identifier for the configuration, and must be unique for your account in the AWS Region.

1. For **Package type**, choose **Apple HLS**.

1. (Optional) For **Segment duration**, enter the duration (in seconds) of each segment. Enter a value equal to, or a multiple of, the input segment duration. If the value that you enter is different from the input segment duration, AWS Elemental MediaPackage rounds segments to the nearest multiple of the input segment duration.

# Manifest settings fields
New DVB subtitle option

MediaPackage can now passthrough DVB subtitles into the HLS outputs.

Specify the format of the manifest that AWS Elemental MediaPackage delivers from an asset that uses this packaging configuration.

1. (Optional) For **Manifest name**, enter a short string that will be appended to the endpoint URL. The manifest name creates a unique path to this endpoint. If you don't enter a value, MediaPackage uses the default manifest name, *index*.

1. (Optional) Select **Include IFrame-only streams** to include an additional I-frame only stream along with the other tracks in the manifest. MediaPackage generates an I-frame only stream from the first rendition in the manifest. The service inserts `EXT-I-FRAMES-ONLY` tags in the output manifest, and then generates and includes an I-frames only playlist in the stream. This playlist enables player functionality like fast forward and rewind.

1. (Optional) Select **Use audio rendition groups** to group all audio tracks into a single HLS rendition group. For more information about rendition groups, see [Rendition groups reference in AWS Elemental MediaPackage](rendition-groups.md).

1. (Optional) Select **Repeat EXT-X-KEY** if you want the service to repeat the key before every segment of the manifest. By default, the key is written just once, after the header and before the segments. If you select **Repeat EXT-X-KEY**, the manifest is written as header, key, segment, key, segment, key, and so on, with every segment preceded by the key. Set this according to the needs of the player. Selecting this option might result in an increase in client requests to the DRM server.

1. (Optional) Select **Include DVB subtitles** to passthrough digital video broadcasting (DVB) subtitles into the output.

1. (Optional) For **Program date/time interval** enter the interval (in seconds) at which MediaPackage should insert the `EXT-X-PROGRAM-DATE-TIME` tags in the manifest.

   The `EXT-X-PROGRAM-DATE-TIME` tag synchronizes the stream to the wall clock, enabling functionality like viewer seek in the playback timeline and time display on the player.

1. (Optional) For **Ad markers**, choose how ad markers are included in the packaged content. 

   Choose from the following:
   + **None** – Omit all SCTE-35 ad markers from the output.
   + **Passthrough** – Copy the SCTE-35 ad markers directly from the input HLS input stream to the output.
   + **SCTE-35 Enhanced** – Generate ad markers and blackout tags based on the SCTE-35 input messages from the input stream.

# Stream selection fields


Limit what incoming bitrates are available for playback and sort the streams in the output of an asset that uses this packaging configuration. 

The minimum and maximum values take into account only the video bitrates. If the video bitrate is *below the minimum* specified rate, it's *not* included in the output, regardless of the sum of the bitrates for other tracks. Likewise, if the video bitrate is *below the maximum *specified rate, it *is* included in the output, regardless of the sum of the bitrates for other tracks.

To set minimum and maximum bitrates and sort the output, select **Enable stream selection** and complete the additional fields as follows:

1. (Optional) For **Stream order**, choose from the following:
   + **Original** to sort the output streams in the same order that the incoming source uses.
   + **Ascending** to sort the output streams starting with the lowest bitrate and ending with the highest.
   + **Descending** to sort the output streams starting with the highest bitrate and ending with the lowest.

1. (Optional) For **Min video bitrate**, enter the minimum bitrate threshold (in bits per second) that video tracks must must be at or above to be available for playback from this endpoint. This ensures that tracks are *at least* a certain bitrate.

1. (Optional) For **Max video bitrate**, enter the maximum bitrate threshold (in bits per second) that video tracks must be at or below to be available for playback from this endpoint. This ensures that tracks are *no more than* a certain bitrate.

# Encryption fields


Protect your content from unauthorized use through content encryption and digital rights management (DRM). AWS Elemental MediaPackage uses the [AWS Secure Packager and Encoder Key Exchange (SPEKE) API](https://aws.amazon.com/media/tech/speke-basics-secure-packager-encoder-key-exchange-api/) to facilitate content encryption and decryption by a DRM provider. Using SPEKE, the DRM provider supplies encryption keys to MediaPackage through the SPEKE API. The DRM provider also supplies licenses to supported media players for decryption. For more information about how SPEKE is used with services and features running in the cloud, see [AWS cloud-based architecture](https://docs.aws.amazon.com/speke/latest/documentation/what-is-speke.html#services-architecture) in the *Secure Packager and Encoder Key Exchange API Specification guide*.

**Note**  
To encrypt content, you must have a DRM solution provider, and be set up to use encryption. For information, see [Content encryption and DRM in AWS Elemental MediaPackage](using-encryption.md). 

To serve content with copyright protection, select **Enable encryption ** and complete the additional fields as follows:

1. For **Encryption method**, choose **Sample-AES** for Apple HLS FairPlay or choose **AES-128** for Apple HLS AES-128. 

1. (Optional) For **Constant initialization vector** enter a 128-bit, 16-byte hex value represented by a 32-character string, to be used with the key for encrypting content.

1. For **URL**, enter the URL of the API Gateway proxy that you set up to talk to your key server. The API Gateway proxy must reside in the same AWS Region as MediaPackage.

   The following example shows a URL. 

   ```
   https://1wm2dx1f33.execute-api.us-west-2.amazonaws.com/SpekeSample/copyProtection
   ```

1. For **Role ARN**, enter the Amazon Resource Name (ARN) of the IAM role that provides you access to send your requests through API Gateway. Get this from your DRM solution provider.

   The following example shows a role ARN. 

   ```
   arn:aws:iam::444455556666:role/SpekeAccess
   ```

1. For **System IDs**, enter unique identifiers for your streaming protocol and DRM system. Provide up to three IDs for CMAF, two IDs for DASH, and exactly one for the other streaming protocols. If you provide more than one system ID, enter one per line and choose **Add**. For a list of common system IDs, see [DASH-IF System IDs](https://dashif.org/identifiers/content_protection/). If you don't know your IDs, ask your DRM solution provider.

# Creating a DASH packaging configuration


Create a packaging configuration that formats content for devices that support DASH-ISO.

**To create a DASH-ISO packaging configuration (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Packaging groups**.

1. On the **Packaging groups** page, choose the group that will contain the configuration that you're creating.

1. On the details page for the packaging group, under **Packaging configurations**, choose **Manage configurations**.

1. On the **Manage packaging configurations** page, under **Packaging configurations**, choose **Add** and **New config**.

1. Complete the fields as described in the following topics:
   + [General settings fields](cfigs-dash-new.md)
   + [Manifest settings fields](cfigs-dash-manset.md)
   + [Stream selection fields](cfigs-dash-include-streams.md)
   + [Encryption fields](cfigs-dash-encryption.md)

1. Choose **Save**.

If you exceed the quotas for your account when you're creating a packaging configuration, you get an error. If you get an error similar to Too many requests, please try again. Resource limit exceeded, either you have exceeded the API request quotas, or you have already reached the maximum number of packaging groups allowed on your account. If this is your first group, or if you think you mistakenly received this error, use the Service Quotas console to [request quota increases](https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/mediapackage/quotas). For more information about quotas in MediaPackage, see [Quotas in AWS Elemental MediaPackage](quotas.md).

# General settings fields


Provide general settings that apply to the entire packaging configuration.

1. For **ID**, enter a name that describes the configuration. The ID is the primary identifier for the configuration, and must be unique for your account in the Region.

1. For **Package type**, choose **DASH-ISO**.

1. (Optional) For **Segment duration**, enter the duration (in seconds) of each segment. Enter a value equal to, or a multiple of, the input segment duration. If the value that you enter is different from the input segment duration, AWS Elemental MediaPackage rounds segments to the nearest multiple of the input segment duration.

# Manifest settings fields
New DASH manifest setting

Added the **DRM top level compact** manifest settings option.New DASH manifest setting

Added the **Include IFrame-only streams** manifest settings option.New DASH and CMAF manifest setting

Added the **Include encoder configuration in segments** manifest settings option. If you turn on this option, MediaPackage places Sequence Parameter Set (SPS), Picture Parameter Set (PPS), and Video Parameter Set (VPS) metadata in each video segment instead of in the init fragment.New VOD DASH-ISO manifest console settings

Added new DASH-ISO manifest console settings for VOD packaging configurations. Compact DASH, new segment template formats, and period trigger options are now available.

Specify the format of the manifest that AWS Elemental MediaPackage delivers from an asset that uses this packaging configuration.

1. (Optional) For **Manifest name**, enter a short string that will be appended to the endpoint URL. The manifest name helps to create a unique path to this endpoint. If you don't enter a value, the default manifest name is *index*.

1. (Optional) For **Min buffer time**, enter the minimum amount of time (in seconds) that a player must keep in the buffer. If network conditions interrupt playback, the player will have additional buffered content before playback fails, allowing for recovery time before the viewer's experience is affected.

1. (Optional) For **Profile**, specify a DASH profile.

   Choose from the following:
   + **None** – the output doesn't use a DASH profile
   + **Hbbtv 1.5** – the output is compliant with HbbTV v1.5. For information about HbbTV v1.5, see the [HbbTV specification website](https://www.hbbtv.org/resource-library/specifications/).

1. (Optional) For **Manifest layout**, choose if you want MediaPackage to serve a full, compact, or DRM top level compact manifest in response to playback requests.
   + If you choose **Full**, MediaPackage presents the `SegmentTemplate` and `SegmentTimeline` tags for every `Representation` in the manifest.
   + If you choose **Compact**, MediaPackage combines duplicate `SegmentTemplate` tags and presents them at the start of the manifest. This shortens the manifest and makes it easier for some devices to process it.
   + If you choose **DRM top level compact**, MediaPackage places content protection elements at the media presentation description (MPD) level and are referenced at the `AdaptationSet` level. You can choose this option only if you're using the SPEKE Version 1.0 or 2.0 SHARED preset.

   For more information about the manifest layout options, see [Compacted DASH manifests](compacted.md).

1. (Optional) For **Segment template format**, choose how MediaPackage and playback requests refer to each segment.
   + If you choose **Number with timeline**, MediaPackage uses the `$Number$` variable to refer to the segment in the `media` attribute of the `SegmentTemplate` tag. The value of the variable is the sequential number of the segment. `SegmentTimeline` is included in each segment template.
   + If you choose **Time with timeline**, MediaPackage uses the `$Time$` variable to refer to the segment. The value of the variable is the timestamp of when on the manifest timeline the segment starts. `SegmentTimeline` is included in each segment template.
   + If you choose **Number with duration**, MediaPackage uses the `$Number$` variable and replaces the `SegmentTimeline` objects with a `duration` attribute in the segment template. 
**Note**  
This option isn't supported in combination with multi-period DASH.

   For more information about the formatting options of the `SegmentTemplate` tag, see [DASH manifest segment template format](segtemp-format.md).

1. (Optional) Select **Include IFrame-only streams** to include an additional I-frame only stream along with the other tracks in the manifest. MediaPackage generates an I-frame only stream from the first rendition in the manifest. This playlist enables player functionality like fast forward and rewind.

1. For **Period triggers**, select how MediaPackage creates MPD periods in the DASH output manifest.
   + **None** – MediaPackage doesn't create additional periods. It formats the manifest as a single period and doesn't include SCTE-35 markers in the segments.
   + **Trigger new periods on ads** – MediaPackage creates and inserts in the manifest multiple periods based on SCTE-35 ad markers from the input content. These periods separate portions of the content, such as setting boundaries between the main content and ad content. For more information about how MediaPackage configures periods in the manifest, see [DASH manifest options in AWS Elemental MediaPackageMulti-period DASH in AWS Elemental MediaPackage](multi-period.md).
**Important**  
Multiple periods are required if you use AWS Elemental MediaTailor for personalized ad insertion in DASH content. For more information about this service, see the [AWS Elemental MediaTailor User Guide](https://docs.aws.amazon.com/mediatailor/latest/ug/).

1. For **SCTE markers source**, specify the source of SCTE-35 markers to use from your input HLS content. 
   +  Select **Segments** to use SCTE-35 markers from input HLS media segments.
   +  Select **Manifest** to use SCTE-35 markers, formatted using SCTE-35 Enhanced syntax (`#EXT-OATCLS-SCTE35` tags), from input HLS child manifests. SCTE-35 Elemental and SCTE-35 Daterange syntaxes are not supported.

1. (Optional) Select **Include encoder configuration in segments** for MediaPackage to place your encoder's Sequence Parameter Set (SPS), Picture Parameter Set (PPS), and Video Parameter Set (VPS) metadata in every video segment instead of in the init fragment. This lets you use different SPS/PPS/VPS settings for your assets during content playback.

# Stream selection fields


Limit which incoming bitrates are available for playback and sort the streams in the output of an asset that uses this packaging configuration. 

The minimum and maximum values take into account only the video bitrates. If the video bitrate is *below the minimum* specified rate, it's *not* included in the output, regardless of the sum of the bitrates for other tracks. Likewise, if the video bitrate is *below the maximum *specified rate, it *is* included in the output, regardless of the sum of the bitrates for other tracks.

To set minimum and maximum bitrates and sort the output, select **Enable stream selection** and complete the additional fields as follows:

1. (Optional) For **Stream order**, choose from the following:
   + **Original** to sort the output streams in the same order that the incoming source uses.
   + **Ascending** to sort the output streams starting with the lowest bitrate and ending with the highest.
   + **Descending** to sort the output streams starting with the highest bitrate and ending with the lowest.

1. (Optional) For **Min video bitrate**, enter the minimum bitrate threshold (in bits per second) that video tracks must be at or above to be available for playback from this endpoint. This ensures that tracks are *at least* a certain bitrate.

1. (Optional) For **Max video bitrate**, enter the maximum bitrate threshold (in bits per second) that video tracks must be at or below to be available for playback from this endpoint. This ensures that tracks are *no more than* a certain bitrate.

# Encryption fields
New SPEKE option for DASH

MediaPackage now supports DASH SPEKE Version 2.0 for VOD.

Protect your content from unauthorized use through content encryption and digital rights management (DRM). AWS Elemental MediaPackage uses the [AWS Secure Packager and Encoder Key Exchange (SPEKE) API](https://aws.amazon.com/media/tech/speke-basics-secure-packager-encoder-key-exchange-api/) to facilitate content encryption and decryption by a DRM provider. Using SPEKE, the DRM provider supplies encryption keys to MediaPackage through the SPEKE API. The DRM provider also supplies licenses to supported media players for decryption. For more information about how SPEKE is used with services and features running in the cloud, see [AWS cloud-based architecture](https://docs.aws.amazon.com/speke/latest/documentation/what-is-speke.html#services-architecture) in the *Secure Packager and Encoder Key Exchange API Specification guide*.

**Note**  
To encrypt content, you must have a DRM solution provider, and be set up to use encryption. For information, see [Content encryption and DRM in AWS Elemental MediaPackage](using-encryption.md). 

To serve content with copyright protection, select **Enable encryption** and complete the additional fields as follows:

1. For **URL**, enter the URL of the API Gateway proxy that you set up to talk to your key server. The API Gateway proxy must reside in the same AWS Region as MediaPackage.

   The following example shows a URL. 

   ```
   https://1wm2dx1f33.execute-api.us-west-2.amazonaws.com/SpekeSample/copyProtection
   ```

1. For **Role ARN**, enter the Amazon Resource Name (ARN) of the IAM role that provides you access to send your requests through API Gateway. Get this from your DRM solution provider.

   The following example shows a role ARN. 

   ```
   arn:aws:iam::444455556666:role/SpekeAccess
   ```

1. For **System IDs**, enter unique identifiers for your streaming protocol and DRM system. Provide up to three IDs for CMAF, two IDs for DASH, and exactly one for the other streaming protocols. If you provide more than one system ID, enter one per line and choose **Add**. For a list of common system IDs, see [DASH-IF System IDs](https://dashif.org/identifiers/content_protection/). If you don't know your IDs, ask your DRM solution provider.

1. (Optional) For **SPEKE version**, choose the SPEKE version that you'd like to use for encryption. SPEKE Version 1.0 is the legacy version that uses CPIX Version 2.0, and supports single key encryption. SPEKE Version 2.0 uses CPIX Version 2.3, and supports multiple key encryption. For more information about using SPEKE with MediaPackage, see [Content encryption and DRM in MediaPackage](https://docs.aws.amazon.com/mediapackage/latest/ug/using-encryption.html). 

   If you select **SPEKE Version 2.0**, then also choose a **Video encryption preset** and an **Audio encryption preset**. The video and audio presets determine which content keys MediaPackage uses to encrypt the audio and video tracks in your stream. For more information about these presets, see [SPEKE Version 2.0 presets](drm-content-speke-v2-presets.md).

    When using SPEKE Version 2.0, MediaPackage disables key rotation.

# Creating a Microsoft Smooth packaging configuration


Create a packaging configuration that formats content for devices that support Microsoft Smooth.

**To create a Microsoft Smooth packaging configuration (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Packaging groups**.

1. On the **Packaging groups** page, choose the group that will contain the configuration that you're creating.

1. On the details page for the packaging group, under **Packaging configurations**, choose **Manage configurations**.

1. On the **Manage packaging configurations** page, under **Packaging configurations**, choose **Add** and select **New config**.

1. Complete the fields as described in the following topics:
   + [General settings fields](cfigs-mss-new.md)
   + [Manifest settings fields](cfigs-mss-manset.md)
   + [Stream selection fields](cfigs-mss-include-streams.md)
   + [Encryption fields](cfigs-mss-encryption.md)

1. Choose **Save**.

If you exceed the quotas for your account when you're creating a packaging configuration, you get an error. If you get an error similar to Too many requests, please try again. Resource limit exceeded, either you have exceeded the API request quota, or you have already reached the maximum number of packaging groups allowed on your account. If this is your first group, or if you think you mistakenly received this error, use the Service Quotas console to [request quota increases](https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/mediapackage/quotas). For more information about quotas in MediaPackage, see [Quotas in AWS Elemental MediaPackage](quotas.md).

# General settings fields


Provide general settings that apply to the entire packaging configuration.

1. For **ID**, enter a name that describes the configuration. The ID is the primary identifier for the configuration, and must be unique for your account in the Region.

1. For **Package type**, choose **Microsoft Smooth**.

1. (Optional) For **Segment duration**, enter the duration (in seconds) of each segment. Enter a value equal to, or a multiple of, the input segment duration. If the value that you enter is different from the input segment duration, AWS Elemental MediaPackage rounds segments to the nearest multiple of the input segment duration.

# Manifest settings fields


Specify the format of the manifest that AWS Elemental MediaPackage delivers from an asset that uses this packaging configuration.
+ (Optional) For **Manifest name**, enter a short string that will be appended to the endpoint URL. The manifest name helps to create a unique path to this endpoint. If you don't enter a value, the default manifest name is *index*.

# Stream selection fields


Limit which incoming bitrates are available for playback and sort the streams in the output of an asset that uses this packaging configuration. 

The minimum and maximum values take into account only the video bitrates. If the video bitrate is *below the minimum* specified rate, it's *not* included in the output, regardless of the sum of the bitrates for other tracks. Likewise, if the video bitrate is *below the maximum *specified rate, it *is* included in the output, regardless of the sum of the bitrates for other tracks.

To set minimum and maximum bitrates and sort the output, select **Enable stream selection** and complete the additional fields as follows:

1. (Optional) For **Stream order**, choose from the following:
   + **Original** to sort the output streams in the same order that the incoming source uses.
   + **Ascending** to sort the output streams starting with the lowest bitrate and ending with the highest.
   + **Descending** to sort the output streams starting with the highest bitrate and ending with the lowest.

1. (Optional) For **Min video bitrate**, enter the minimum bitrate threshold (in bits per second) that video tracks must be at or above to be available for playback from this endpoint. This ensures that tracks are *at least* a certain bitrate.

1. (Optional) For **Max video bitrate**, enter the maximum bitrate threshold (in bits per second) that video tracks must be at or below to be available for playback from this endpoint. This ensure that tracks are *no more than* a certain bitrate.

# Encryption fields


Protect your content from unauthorized use through content encryption and digital rights management (DRM). AWS Elemental MediaPackage uses the [AWS Secure Packager and Encoder Key Exchange (SPEKE) API](https://aws.amazon.com/media/tech/speke-basics-secure-packager-encoder-key-exchange-api/) to facilitate content encryption and decryption by a DRM provider. Using SPEKE, the DRM provider supplies encryption keys to MediaPackage through the SPEKE API. The DRM provider also supplies licenses to supported media players for decryption. For more information about how SPEKE is used with services and features running in the cloud, see [AWS cloud-based architecture](https://docs.aws.amazon.com/speke/latest/documentation/what-is-speke.html#services-architecture) in the *Secure Packager and Encoder Key Exchange API Specification guide*.

**Note**  
To encrypt content, you must have a DRM solution provider, and be set up to use encryption. For information, see [Content encryption and DRM in AWS Elemental MediaPackage](using-encryption.md). 

To serve content with copyright protection, select **Enable encryption ** and complete the additional fields as follows:

1. For **URL**, enter the URL of the API Gateway proxy that you set up to talk to your key server. The API Gateway proxy must reside in the same AWS Region as MediaPackage.

   The following example shows a URL. 

   ```
   https://1wm2dx1f33.execute-api.us-west-2.amazonaws.com/SpekeSample/copyProtection
   ```

1. For **Role ARN**, enter the Amazon Resource Name (ARN) of the IAM role that provides you access to send your requests through API Gateway. Get this from your DRM solution provider.

   The following example shows a role ARN. 

   ```
   arn:aws:iam::444455556666:role/SpekeAccess
   ```

1. For **System IDs**, enter unique identifiers for your streaming protocol and DRM system. Provide up to three IDs for CMAF, two IDs for DASH, and exactly one for the other streaming protocols. If you provide more than one system ID, enter one per line and choose **Add**. For a list of common system IDs, see [DASH-IF System IDs](https://dashif.org/identifiers/content_protection/). If you don't know your IDs, ask your DRM solution provider.

# Creating a CMAF packaging configuration


Create a packaging configuration that formats content for devices that support Apple HLS fragmented MP4 (fMP4).

**To create a CMAF packaging configuration (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Packaging groups**.

1. On the **Packaging groups** page, choose the group that will contain the configuration that you're creating.

1. On the details page for the packaging group, under **Packaging configurations**, choose **Manage configurations**.

1. On the **Manage packaging configurations** page, under **Packaging configurations**, choose **Add** and select **New config**.

1. Complete the fields as described in the following topics:
   + [General settings fields](cfigs-cmaf-new.md)
   + [Manifest settings fields](cfigs-cmaf-manset.md)
   + [Stream selection fields](cfigs-cmaf-include-streams.md)
   + [Encryption fields](cfigs-cmaf-encryption.md)

1. Choose **Save**.

If you exceed the quotas for your account when you're creating a packaging configuration, you get an error. If you get an error similar to Too many requests, please try again. Resource limit exceeded, either you have exceeded the API request quotas, or you have already reached the maximum number of packaging groups allowed on your account. If this is your first group, or if you think you mistakenly received this error, use the Service Quotas console to [request quota increases](https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/mediapackage/quotas). For more information about quotas in MediaPackage, see [Quotas in AWS Elemental MediaPackage](quotas.md).

# General settings fields


Provide general settings that apply to the entire packaging configuration.

1. For **ID**, enter a name that describes the configuration. The ID is the primary identifier for the configuration, and must be unique for your account in the Region.

1. For **Package type**, choose **Common Media Application Format (CMAF)**.

1. (Optional) For **Segment duration**, enter the duration (in seconds) of each segment. Enter a value equal to, or a multiple of, the input segment duration. If the value that you enter is different from the input segment duration, AWS Elemental MediaPackage rounds segments to the nearest multiple of the input segment duration.

# Manifest settings fields


Specify the format of the manifest that AWS Elemental MediaPackage delivers from an asset that uses this packaging configuration.

1. (Optional) For **Manifest name**, enter a short string that will be appended to the endpoint URL. The manifest name creates a unique path to this endpoint. If you don't enter a value, MediaPackage uses the default manifest name, *index*.

1. (Optional) In stream sets with a single video track, select **Include IFrame-only streams** to include an additional I-frame only stream along with the other tracks in the manifest. MediaPackage inserts `EXT-I-FRAMES-ONLY` tags in the manifest, and then compiles and includes an I-frames only playlist in the stream. This playlist enables player functionality like fast forward and rewind.

1. (Optional) Select **Repeat EXT-X-KEY** if you want the service to repeat the key before every segment of the manifest. By default, the key is written just once, after the header and before the segments. If you select **Repeat EXT-X-KEY**, the manifest is written as header, key, segment, key, segment, key, and so on, with every segment preceded by the key. Set this according to the needs of the player. Selecting this option might result in an increase in client requests to the DRM server.

1. (Optional) For **Program date/time interval**, enter the interval at which MediaPackage should insert the `EXT-X-PROGRAM-DATE-TIME` tags in the manifest.

   The `EXT-X-PROGRAM-DATE-TIME` tag synchronizes the stream to the wall clock, enabling functionality like viewer seek in the playback timeline and time display on the player.

1. (Optional) For **Ad markers**, choose how ad markers are included in the packaged content. 

   Choose from the following:
   + **None** – Omit all SCTE-35 ad markers from the output.
   + **Passthrough** – Copy the SCTE-35 ad markers directly from the input HLS input stream to the output.
   + **SCTE-35 Enhanced** – Generate ad markers and blackout tags based on the SCTE-35 input messages from the input stream.

1. (Optional) Select **Include encoder configuration in segments**, for MediaPackage to place your encoder's Sequence Parameter Set (SPS), Picture Parameter Set (PPS), and Video Parameter Set (VPS) metadata in every video segment instead of in the init fragment. This lets you use different SPS/PPS/VPS settings for your assets during content playback.

# Stream selection fields


Limit which incoming bitrates are available for playback and sort the streams in the output of an asset that uses this packaging configuration. 

The minimum and maximum values take into account only the video bitrates. If the video bitrate is *below the minimum* specified rate, it's *not* included in the output, regardless of the sum of the bitrates for other tracks. Likewise, if the video bitrate is *below the maximum *specified rate, it *is* included in the output, regardless of the sum of the bitrates for other tracks.

To set minimum and maximum bitrates and sort the output, select **Enable stream selection** and complete the additional fields as follows:

1. (Optional) For **Stream order**, choose from the following:
   + **Original** to sort the output streams in the same order that the incoming source uses.
   + **Ascending** to sort the output streams starting with the lowest bitrate and ending with the highest.
   + **Descending** to sort the output streams starting with the highest bitrate and ending with the lowest.

1. (Optional) For **Min video bitrate**, enter the minimum bitrate threshold (in bits per second) that video tracks must be at or above to be available for playback from this endpoint. This ensures that tracks are *at least* a certain bitrate.

1. (Optional) For **Max video bitrate**, enter the maximum bitrate threshold (in bits per second) that video tracks must be at or below to be available for playback from this endpoint. This ensures that tracks are *no more than* a certain bitrate.

# Encryption fields
New SPEKE option for CMAF

MediaPackage now supports CMAF SPEKE Version 2.0 for VOD.New CMAF encryption options

MediaPackage now offers constant IV and multiple system IDs for CMAF packaging configurations.

Protect your content from unauthorized use through content encryption and digital rights management (DRM). AWS Elemental MediaPackage uses the [AWS Secure Packager and Encoder Key Exchange (SPEKE) API](https://aws.amazon.com/media/tech/speke-basics-secure-packager-encoder-key-exchange-api/) to facilitate content encryption and decryption by a DRM provider. Using SPEKE, the DRM provider supplies encryption keys to MediaPackage through the SPEKE API. The DRM provider also supplies licenses to supported media players for decryption. For more information about how SPEKE is used with services and features running in the cloud, see [AWS cloud-based architecture](https://docs.aws.amazon.com/speke/latest/documentation/what-is-speke.html#services-architecture) in the *Secure Packager and Encoder Key Exchange API Specification guide*.

**Note**  
To encrypt content, you must have a DRM solution provider, and be set up to use encryption. For information, see [Content encryption and DRM in AWS Elemental MediaPackage](using-encryption.md). 

To serve content with copyright protection, Select **Enable encryption** and complete the additional fields as follows:

1. For **System IDs**, enter unique identifiers for your streaming protocol and DRM system. Provide up to two system IDs. If you provide more than one system ID, enter one per line. If you do not know your IDs, ask your DRM solution provider.

1. For **URL**, enter the URL of the API Gateway proxy that you set up to talk to your key server. The API Gateway proxy must reside in the same AWS Region as MediaPackage.

   The following example shows a URL. 

   ```
   https://1wm2dx1f33.execute-api.us-west-2.amazonaws.com/SpekeSample/copyProtection
   ```

1. (Optional) For **SPEKE version**, choose the SPEKE version that you'd like to use for encryption. SPEKE Version 1.0 is the legacy version that uses CPIX Version 2.0, and supports single key encryption. SPEKE Version 2.0 uses CPIX Version 2.3, and supports multiple key encryption. For more information about using SPEKE with MediaPackage, see [Content encryption and DRM in MediaPackage](https://docs.aws.amazon.com/mediapackage/latest/ug/using-encryption.html). 

   If you select **SPEKE Version 2.0**, then also choose a **Video encryption preset** and an **Audio encryption preset**. The video and audio presets determine which content keys MediaPackage uses to encrypt the audio and video tracks in your stream. For more information about these presets, see [SPEKE Version 2.0 presets](drm-content-speke-v2-presets.md).

    When using SPEKE Version 2.0, MediaPackage disables key rotation.

1. (Optional) For **Constant initialization vector** enter a 128-bit, 16-byte hex value represented by a 32-character string, to be used with the key for encrypting content.

1. For **Role ARN**, enter the Amazon Resource Name (ARN) of the IAM role that provides you access to send your requests through API Gateway. Get this from your DRM solution provider.

   The following example shows a role ARN. 

   ```
   arn:aws:iam::444455556666:role/SpekeAccess
   ```

# Viewing packaging configuration details
Asset playback status

You can now view playable status information about an asset. This lets you tell whether or not an asset is ready for playback, or if processing has failed.

To ensure that the content is available in all necessary stream formats, view all packaging configurations that are associated with a specific packaging group or with an asset. 

To view packaging configurations, you can use the AWS Elemental MediaPackage console, the AWS CLI, or the MediaPackage API. For information about viewing a packaging configuration with the AWS CLI or MediaPackage API, see [Packaging\$1configurations id](https://docs.aws.amazon.com/mediapackage-vod/latest/apireference/packaging_configurations-id.html) in the *AWS Elemental MediaPackage VOD API Reference*.

**To view packaging configurations in a packaging group (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Packaging groups**.

1. On the **Packaging groups** page, choose the group that contains the configurations that you want to view. 

   The **Packaging configurations** section displays all of the configurations that are in this group.

1. To view the details of a specific packaging configuration, choose the **Id** of that configuration.

MediaPackage displays summary information, such as the assets associated with this packaging configuration.

**To view all packaging configurations associated with an asset (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Assets**.

1. On the **Assets** page, choose the asset that you want to audit. 

   The **Playback details** section displays all of the configurations that are associated with this asset. On this page, you can view the playback status of the asset in the **Status** column. The available statuses are as follows:
+ **Not processed **- The asset hasn't been processed yet.
+ **Processing** - MediaPackage is processing the asset. The asset isn't available for playback yet.
+ **Processed** - The asset has been processed, and is available for playback.
+ **Failed** - Processing failed.

**Note**  
Status information isn't available for most assets ingested before September 30th, 2021.

# Editing a packaging configuration


You can't edit a packaging configuration. If you need to make changes, create a new configuration and delete the original.
+ To create a configuration, see [Creating a packaging configuration](pkg-group-create.md).
+ To delete a configuration, see [Deleting a packaging configuration](pkg-group-delete.md).

# Deleting a packaging configuration


To remove a playback endpoint from an asset, delete the packaging configuration.

To delete a packaging configuration, you can use the AWS Elemental MediaPackage console, the AWS CLI, or the MediaPackage API. For information about deleting a packaging configuration with the AWS CLI or MediaPackage API, see [Packaging\$1configurations id](https://docs.aws.amazon.com/mediapackage-vod/latest/apireference/packaging_configurations-id.html) in the *AWS Elemental MediaPackage VOD API Reference*.

**To delete a packaging configuration (console)**

1. Open the MediaPackage console at [https://console.aws.amazon.com/mediapackage/](https://console.aws.amazon.com/mediapackage/).

1. In the navigation pane, under **Video on demand**, choose **Packaging groups**.

1. On the **Packaging groups** page, choose the group that contains the configuration that you're deleting. 

1. On the details page for the packaging group, under **Packaging configurations**, choose either the packaging configuration ID of the configuration that you're deleting and choose **Delete** or choose **Manage configurations**, **Actions**, **Delete**.

1. On the **Delete packaging configurations** page, choose **Delete**.