Working with manifest filters in AWS Elemental MediaPackage
When you use a manifest filter, the resulting manifest from MediaPackage includes only the audio and video streams that match the characteristics that you specify in your query. If no manifest filter is used, then all of the ingested streams are present in the endpoint output stream. The exception to this is if you have set stream filters for the endpoint, such as minimum video bitrate. In that case, the manifest filter is applied after the stream filter, which could skew your output, and is not recommended.
Manifest filtering can be used on all origin endpoint types supported by MediaPackage:
-
TS
-
CMAF
To use manifest filtering, append aws.manifestfilter
query parameters to your playback request to MediaPackage. MediaPackage evaluates the query, and serves a
client manifest based on those query parameters. Manifest queries are not case-sensitive and can be up to 1024 characters long. If
the query is malformed, or if it there aren't streams that match the query parameters, MediaPackage returns an incomplete or empty manifest. For query syntax, see the following section.
Note
If you are using TS or CMAF origin endpoints, special conditions apply. For information about these conditions, see Special conditions for TS and CMAF manifests in MediaPackage.
Query syntax
The base query parameter is aws.manifestfilter
, which is followed by optional parameter name and value pairs. To construct the query, append
?aws.manifestfilter=
to the end of the MediaPackage endpoint URL, followed by parameter names and values. For a list of all of the available parameters, see Manifest filter query
parameters in AWS Elemental MediaPackage.
An Apple HLS filter query might look like this:
https://example-mediapackage-endpoint.mediapackage.us-west-2.amazonaws.com/out/v1/examplemediapackage/index.m3u8
?aws.manifestfilter=audio_sample_rate:0-44100;video_bitrate:0-2147483647;video_codec:h265;audio_language:fr,en-US,de
The query syntax is listed in the following table.
Query string component | Description |
---|---|
? |
A restricted character that marks the beginning of a query. |
aws.manifestfilter= |
The base query, which is followed by parameters constructed of name and value pairs. For a list of all of the available parameters, see Manifest filter query parameters in AWS Elemental MediaPackage. |
: |
Used to associate the parameter name with a value. For example, . |
; |
Separates parameters in a query that contains multiple parameters. For example, . |
, |
Separates a list of values. For example, parameter_name: .
Comma-separated values in a list imply an OR
relationship. |
- |
Used to define a parameter's minimum - maximum value range. For example,
audio_sample_rate:0-44100 . When a numerical value is
used in a range, it is included in the range definition. This means that
streams must be greater than or equal to the minimum value, and less
than or equal to the maximum value. With ranges, the minimum and maximum
values are mandatory. The supported range values are 0 -
2147483647 . |
Note
If you use Amazon CloudFront as your CDN, you might need to set additional configurations. For more information, see Configure cache behavior for all endpoints.