Manifest filtering query parameters in AWS Elemental MediaPackage
To use manifest filtering query parameters, append aws.manifestfilter
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 filtering 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.
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.
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 filtering 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,
.
When used in a list of parameters for the same query, implies an
AND operation. |
, |
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 . |
Query value formats
The following query parameters support expanded value formats:
-
audio_bitrate
-
audio_channels
-
audio_sample_rate
-
trickplay_height
-
video_bitrate
-
video_framerate
-
video_height
For all of these parameters, you can format your values as single values or ranges, one or more ranges, or a combination of both.
- Individual values and ranges
-
Filter manifests by single values or ranges.
Syntax
-
Individual single values:
aws.manifestfilter=
parameter
:value
-
Individual range:
aws.manifestfilter=
parameter
:min1-max1
Example individual value
The following example filters for videos with a bitrate of 8000000 bps.
stream.mpd?aws.manifestfilter=video_bitrate:8000000
Note
When you filter for a single
video_framerate
value, MediaPackage uses an approximate equals comparison with an epsilon tolerance of 0.0005. MediaPackage uses this tolerance because the query allows only up to three decimal places, and there could be a small difference in accuracy between the stored framerates and the specified framerate.For example, if your filter is
video_framerate:30.000
, MediaPackage matches framerates in the range of 29.9995 to 30.0005. -
- Multiple values and ranges
-
Filter manifests by multiple single values or multiple ranges.
Syntax
-
Multiple single values:
aws.manifestfilter=
parameter
:value
,value
-
Multiple ranges:
aws.manifestfilter=
parameter
:min1-max1
,min2-max2
Example multiple ranges
The following example filters for videos that are either 240p-360p OR 720p-1080p.
stream.mpd?aws.manifestfilter=video_height:240-360,720-1080
-
- Combination
-
Filter manifests by a combination of ranges and values.
Syntax
-
Multiple ranges and single values:
aws.manifestfilter=
parameter
:min1-max1
,min2-max2
,value1
,value2
Example multiple ranges and values
The following example filters for videos that are either 240p-360p, 720p-1080p, 1440p, OR 2160p.
stream.mpd?aws.manifestfilter=video_height:240-360,720-1080,1440,2160
-
Query parameters
MediaPackage supports the following query parameters.
You can set one or more filters. For example, to restrict all manifests from this endpoint to 0 to 44000 Hz audio sample rate, 0 to 2147483647 video bitrate, H265 video codec, and French and English languages, enter the following key and value pairs on the origin endpoint:
Filter key
audio_sample_rate
| Filter value:
0-44100
Filter key
video_bitrate
| Filter value:
0-2147483647
Filter key
video_codec
| Filter value: H265
Filter key
audio_language
| Filter value:
fr,en-US
Category | Name | Description | Example |
---|---|---|---|
Audio | audio_bitrate |
|
stream.mpd?aws.manifestfilter=audio_bitrate:0-2147483647 |
Audio | audio_channels |
|
stream.mpd?aws.manifestfilter=audio_channels:1-8 |
Audio | audio_codec |
|
stream.mpd?aws.manifestfilter=audio_codec:AACL,AC-3 |
Audio | audio_language |
|
stream.mpd?aws.manifestfilter=audio_language:fr,en-US,de |
Audio | audio_sample_rate |
|
stream.mpd?aws.manifestfilter=audio_sample_rate:0-44100 |
Subtitle | subtitle_language |
|
stream.mpd?aws.manifestfilter=subtitle_language:en-US, hi |
Video | trickplay_height |
|
stream.mpd?aws.manifestfilter=trickplay_height:200-1200 |
Video | trickplay_type |
|
stream.mpd?aws.manifestfilter=trickplay_type:iframe |
Video | video_bitrate |
|
stream.mpd?aws.manifestfilter=video_bitrate:0-2147483647 |
Video | video_codec |
|
stream.mpd?aws.manifestfilter=video_codec:h264 |
Video | video_dynamic_range |
|
stream.mpd?aws.manifestfilter=video_dynamic_range:hdr10 |
Video | video_framerate |
|
stream.mpd?aws.manifestfilter=video_framerate:23.976-30 |
Video | video_height |
|
stream.mpd?aws.manifestfilter=video_height:720-1080 |