HTTP Streaming Tasks - Version 1.8

This document describes the HTTP Streaming Tasks, provided as custom tasks that must be installed with PureLoad/PureTest for each installation using these tasks.

Before you use the tasks, read more about installing and how to load custom tasks.

HTTP Streaming Protocol Support

The HTTP streaming task is used to simulate Adaptive Streaming over HTTP. Supported protocols are HLS (Apple), HSS (Microsoft), HDS (Adobe) and DASH (MPEG). See Supported HTTP Streaming Protocols for details. The word "adaptive" refers to the ability to shift between different bitrates of the media to compensate for changes in the available bandwidth. This is covered in more detail in the Introduction to HTTP Streaming and Load Testing document.

Task Overview

HTTP Support

All tasks are based on the generic PureLoad HTTP support. This means, for example, that a standard HttpInitTask may be used to set up bandwidth limitation, SSL etc.

HTTP Streaming Tasks

There are three types of custom tasks for HTTP Streaming:

HttpStreamingXyzInitTask
This is an initialisation task that requests stream meta data (i.e. information about how to run the stream). This task is media type specific, "Xyz" is to be replaced with "Hls", "Hss", "Hds" or "Dash".

Files containing meta data are called "Manifests". The first downloaded manifest is called the "Master Playlist Manifest".

HttpStreamingXyzSetQualityTask.
This task sets the media quality of the following media segment downloads. This quality will be used until a new HttpStreamingXyzSetQualityTask is run. The "Media Quality" translates to the file size of the downloaded segments.

For some media types (Hls and Hds) stream meta data may be split into several manifests. For these media types the HttpStreamingXyzSetQualityTask may make an additional HTTP request for a media quality specific manifest.

This task takes the media quality as a parameter. Media quality is given as an integer. Alternatively, the media quality parameter can be given as "low", "medium" or "high" for convenience.

Adaptive bitrate can be automatically simulated by specifying an expected bitrate and threshold values for when to perform a shift in quality.

HttpStreamingMediaSegmentTask
This task downloads one media segment. The task is intended to be used in a "Sequence" and in conjunction with a "SleepTask" to simulate the play time of the segment.

HttpStreamingMediaSegmentTask is generic for all media types.

Setting Up Scenarios

An HTTP streaming scenario basically consists of:

URL

The HttpStreamingXyzInitTask has a URL parameter. This must be an address to a Master Playlist Manifest file. This manifest represents the entire media and the URL is usually seen as the address to the actual media (e.g. a movie).

Media Quality

The initial media quality to use must be set in a HttpStreamingXyzSetQualityTask. Quality is measured differently for different media. It can be given as bandwidth, resolution, bitrate or something else, but it is always given as an integer. A list of available media qualities can be found in the "Execution Log" after running the HttpStreamingXyzInitTask.
Look for something similar to this to learn about available qualities:

[INFO] This stream is available in the following qualities:
200000 (low)
311111 (medium)
484444
737777 (high)

Note that the media quality can also be given as one of "low", "medium" or "high".

Remaining Segments

After having read the meta data manifests, the number of media segments to be played is determined. One or more sequences has to be created that iterates over these media segments. In the sequence, set the "Iterations" parameter to either a specified number of iterations or to ${remainingSegments} to iterate over all the remaining tasks. If you specify a number of iterations that exceeds the number of media segments, a TaskExecutionException will be thrown and the Scenario will stop execution.

Play Time Slack

To make the Scenario simulate an actual media player you can add a SleepTask after the HttpStreamingMediaSegmentTask. The SleepTask sleeps the time an actual media player would have spent playing the downloaded Media Segment. In the SleepTask set the "Sleep Time" parameter to ${playtimeSlack}. To understand play time slack see here.

After the last media segment has been downloaded the scenario ends without sleeping the remaining playing time, i.e. "playTimeSlack" is set to zero.

Max Running Time

If set (i.e. when given a value > -1) a variable "endOfStream" will be set to true before running a segment that will run past the maxRunningTime. This can be used to conditionally break sequences when (or actually right before) the maxRunningTime is reached.

Reuse Redirect

There is an option to reuse the address of a 302 redirect in subsequent calls instead of always using the original address and get a new redirect for each request. When chosen (set to true), this option will cause requests for media segments following a redirected request for a media playlist to reuse the redirect address of the media playlist request.

For LIVE streams, subsequent requests for the same media playlist will also reuse the redirect.

Example Scenario

Example Scenario


This example shows a scenario running HSS Media, simulating buffering of media before playing. The scenario also simulates "adaptive" changes to the media quality.

HSS media may be divided into different streams for audio and video. If the media contains separate audio, it is handled automatically by PureLoad and it will not affect the structure of the scenario. Quality settings and sequence iterations concern the video stream only. PureLoad will download the audio concurrently.

The "HttpStreamingXyzSetQualityTask" may need to download a further media quality specific manifest (stream meta data). The optional HTTP request is handled automatically and requires no extra setup.

Provided tasks

The following is a complete list of the tasks provided in the HTTP Streaming package:


HttpStreamingHlsInitTask

This task reads an HLS master playlist manifest specified by the given "URL" and makes the master playlist available to subsequent tasks.

To set proxy, verbose flag and other common parameters use the HttpInitTask before this task.

Parameters

URL - URL to streaming manifest
Query String - Optional additional parameter(s) to add to all URLs (specified in URL format: name1=value1&name2=value2 ..)
Query String Main Manifest Only - Flag indicating if query string should be used only for the main manifest or for all requests.
Reuse Redirect URL - Reuse redirect URL when requesting media segment (only Apple HLS)
Max Running Time - The time in ms until the ${endOfStream} variable will be set to true. Use it to conditionally break sequence.
Remaining Segments Variable Name
- Name of the variable containing the number of remaining iterations to do over Media Segments.
Expected Response Codes - Comma separated list of valid response codes.


HttpStreamingHlsSetQualityTask

This task chooses the media playlist to play based on the "Media Quality" parameter.

This task exports a variable "remainingSegments" that can be set as the number of iterations in a following Sequence.

This task reads the HLS media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.

Parameters

Media Quality - The Media Quality to be used for the following media segment downloads. Quality can either be defined as one of "low", "medium" or "high" or it can be given as an exact integer. See the execution log to see available qualities.
Expected Bitrate - Expected segment download bitrate in kilobit per second. If set, this will enable adaptive bitrate and shift quality as needed. (Set to 0 to disable adaptive bitrate and only set quality manually.)
Downshift Threshold (%) - Threshold in percent of expected bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of expected bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of consecutive times a threshold must be exceeded before a shift of quality is done.


HttpStreamingHssInitTask

This task reads an HSS master playlist manifest specified by the given "URL" and makes the master playlist available to subsequent tasks.

To set proxy, verbose flag and other common parameters use the HttpInitTask before this task.

Parameters

URL - URL to streaming manifest
Query String - Optional additional parameter(s) to add to all URLs (specified in URL format: name1=value1&name2=value2 ..)
Query String Main Manifest Only - Flag indicating if query string should be used only for the main manifest or for all requests.
Reuse Redirect URL - Reuse redirect URL when requesting media segment (only Apple HLS)
Max Running Time - The time in ms until the ${endOfStream} variable will be set to true. Use it to conditionally break sequence.
Remaining Segments Variable Name
- Name of the variable containing the number of remaining iterations to do over Media Segments.
Expected Response Codes - Comma separated list of valid response codes.

HttpStreamingHssSetQualityTask

This task chooses the media playlist to play based on the "Media Quality" parameter.

This task exports a variable "remainingSegments" that can be set as the number of iterations in a following Sequence.

This task reads the HSS media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.

Parameters

Media Quality - The Media Quality to be used for the following media segment downloads. Quality can either be defined as one of "low", "medium" or "high" or it can be given as an exact integer. See the execution log to see available qualities.
Expected Bitrate - Expected segment download bitrate in bit/s. If set, this will enable adaptive bitrate and shift quality as needed. (Set to 0 to disable adaptive bitrate and only set quality manually.)
Downshift Threshold (%) - Threshold in percent of expected bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of expected bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of consecutive times a threshold must be exceeded before a shift of quality is done.


HttpStreamingHdsInitTask

This task reads an HDS master playlist manifest specified by the given "URL" and makes the master playlist available to subsequent tasks.

To set proxy, verbose flag and other common parameters use the HttpInitTask before this task.

Parameters

URL - URL to streaming manifest
Query String - Optional additional parameter(s) to add to all URLs (specified in URL format: name1=value1&name2=value2 ..)
Query String Main Manifest Only - Flag indicating if query string should be used only for the main manifest or for all requests.
Reuse Redirect URL - Reuse redirect URL when requesting media segment (only Apple HLS)
Max Running Time - The time in ms until the ${endOfStream} variable will be set to true. Use it to conditionally break sequence.
Remaining Segments Variable Name
- Name of the variable containing the number of remaining iterations to do over Media Segments.
Expected Response Codes - Comma separated list of valid response codes.


HttpStreamingHdsSetQualityTask

This task chooses the media playlist to play based on the "Media Quality" parameter.

This task exports a variable "remainingSegments" that can be set as the number of iterations in a following Sequence.

This task reads the HDS media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.

Parameters

Media Quality - The Media Quality to be used for the following media segment downloads. Quality can either be defined as one of "low", "medium" or "high" or it can be given as an exact integer. See the execution log to see available qualities.
Expected Bitrate - Expected segment download bitrate in bit/s. If set, this will enable adaptive bitrate and shift quality as needed. (Set to 0 to disable adaptive bitrate and only set quality manually.)
Downshift Threshold (%) - Threshold in percent of expected bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of expected bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of consecutive times a threshold must be exceeded before a shift of quality is done.


HttpStreamingDashInitTask

This task reads an DASH master playlist manifest specified by the given "URL" and makes the master playlist available to subsequent tasks.

To set proxy, verbose flag and other common parameters use the HttpInitTask before this task.

Parameters

URL - URL to streaming manifest
Query String - Optional additional parameter(s) to add to all URLs (specified in URL format: name1=value1&name2=value2 ..)
Query String Main Manifest Only - Flag indicating if query string should be used only for the main manifest or for all requests.
Reuse Redirect URL - Reuse redirect URL when requesting media segment (only Apple HLS)
Max Running Time - The time in ms until the ${endOfStream} variable will be set to true. Use it to conditionally break sequence.
Remaining Segments Variable Name
- Name of the variable containing the number of remaining iterations to do over Media Segments.
Expected Response Codes - Comma separated list of valid response codes.


HttpStreamingDashSetQualityTask

This task chooses the media playlist to play based on the "Media Quality" parameter.

This task exports a variable "remainingSegments" that can be set as the number of iterations in a following Sequence.

This task reads the DASH media playlist manifest for the chosen media quality, sets the number of media segments and constructs URLs for all the media segments to download.

Parameters

Media Quality - The Media Quality to be used for the following media segment downloads. Quality can either be defined as one of "low", "medium" or "high" or it can be given as an exact integer. See the execution log to see available qualities.
Expected Bitrate - Expected segment download bitrate in bit/s. If set, this will enable adaptive bitrate and shift quality as needed. (Set to 0 to disable adaptive bitrate and only set quality manually.)
Downshift Threshold (%) - Threshold in percent of expected bitrate when a downshift of quality will be done.
Upshift Threshold (%) - Threshold in percent of expected bitrate when an upshift of quality will be done.
Consecutive Threshold Exceedings - Number of consecutive times a threshold must be exceeded before a shift of quality is done.



HttpStreamingMediaSegmentTask

This task downloads a media segment and calculates the "slack" time, i.e. the segment playtime left after subtracting the time for the download (slack = segmentPlaytime - timeToDownloadSegment). The slack time is stored in the "Playtime Slack variable".

Parameters

Playtime Slack Variable - The name of the variable carrying the "Playtime Slack", or the time to sleep by the subsequent Sleep Task . Default: playtimeSlack .



HttpStreamingReportTask

This task to collects additional HTTP streaming results in background and write them to a CSV file at a specified time slot interval.

The CSV will have the following columns:

Parameters

CVS File Path - Path to streaming report CSV file.
Time Slot Interval (s) - Time in seconds between each time streaming information is written to disk.
Media Qualities - Comma separated list of video media qualities to count segments for (qualities not in list is reported as 'other').