HLS Monitoring API Overview
HLSAnalyzer.com is an online HLS analyzer and monitoring service. We follow the official HTTP Live Streaming specification (RFC 8216) and check for a variety of error conditions as well as HLS conformance points. For any HLS stream, we initialize the playlist buffer with segment durations that are greater than 3 times the target duration. We maintain this buffer with the arrival of each new segment while taking to account the real elapsed time in the playlist refresh cycle.
For private monitoring of streams, we provide an API for adding, removing, and alerting on outages of Live and VOD HLS Streams. With our simple HTTP-Based API, your team can monitor Live HLS streams and receive alerts when a stream stops publishing playlists or segments. These APIs also allow for automated testing of streams in CI/CD development environments.
All API-based streams are private, and can only be accessed and monitored with a corresponding API key.
The HLSAnalyzer.com browser-based UI can be used to add and remove streams, check the current API status, add files from a .csv file, and configure alert parameters. The interface utilizes the same API calls that are documented in the next section, ensuring a consistent experience while interacting with the HLS Analyzer monitoring server. The browser can also be used to monitor the state of all links associated with an API key in realtime.
For the best experience, the use of Google Chrome, Firefox, or Microsoft Edge is recommended.
Description: All streams associated with the particular API key will be available for inspection, via an interface similar to the following:
All of the important parameters of the API can be monitored, including the current alert configuration state.
HLS streams can be added and removed from this interface. LinkIDs may be supplied for each stream, to make their identification easier. When not supplied, LinkIDs will automatically be assigned by the server when adding streams. Alerts may be individually enabled or disabled for each stream.
The different alert parameters can be configured via this interface. This panel will utilize the existing API calls (/api/alertlimits, /api/alertsetup) to configure the alerting functionality of the analyzer. Please refer to the documentation for the API calls for additional information.
Batch processing functions perform functions that involve a large set of streams:
The monitoring interface consists of a unique API key assigned to each client. The API key will be configured with a total number of available monitoring streams and an expiration date, based on the client’s specifications.
All commands may be issued via URL query strings, with the specified formats. All responses from the analyzer will be in JSON format, with an appropriate HTML response code.
Behavior: blocking, 15-second timeout
Description: Add a Master or Media HLS Playlist (.m3u8). Monitoring will start immediately after the link has been added. An internal LinkID will be generated, unless it has been specified on the query string (between 6 and 16 alphanumeric characters), in which case it will be applied to the Master playlist. All variants and their generated LinkIDs will be returned in the JSON response. The available monitoring quota for the API key will be updated.
Behavior: blocking, 15-second timeout
Description: Remove a Master or Media HLS Playlist by specifying either the m3u8 or the LinkID. Removing the Master playlist will also remove all its associated variants. The available monitoring quota for the API key will be updated. Only the top-level LinkID for a stream can be specified (individual variants cannot be removed).
A timeout condition is expected in the case of playlists with large segment durations. If a timeout error occurs, simply retry the remove command, or use the status command to confirm the removal of the link.
Behavior: non-blocking, use the status command to confirm the removal of all links
Description: Remove all streams associated with the API key.
"links": "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8, https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8, "
Description: List all associated information about the API, such as the number of variants being monitored, API key expiration, remaining variant quota, etc.
"TimeRemaining": "30 days",
Description: Get the current status of individual Master or Media playlists. LinkIDs for individual Media playlists, or the top-level Master playlist can be specified.
. . . .
Description: Get the current status of all Master or Media playlists associated with the API key, including any alerts.
"link": "All available links",
. . . .
Description: Specify the global alert limits for stream outages. An outage condition is entered when the stream playback buffer reaches 0 seconds, or if the Media Playlist contains an “#EXT-X-ENDLIST” tag. If an outage condition continues for more than outage_seconds, an alert will be raised. The alert condition must be cleared for a contiguous clear_seconds, before a new alert may be raised for the same stream. If the command is issued with no options, the current settings are returned.
Description: Specify the global alert destinations, which will be used in case an alert is raised. When specified, the parameters will be tested for validity: a test email will be sent to the address provided, and the callback link will be confirmed via an HTTP POST. Alerts may also be enabled and disabled using this command:
The alert descriptions will be in JSON format, which will be emailed and POSTed when an alarm is triggered. If the command is issued with no options, the current settings are returned.
To avoid excessive email communication, for any single stream only 10 email “outage” alerts will be sent in 24 hours, with an additional 10 “clear” email messages when enabled. No limits shall exist for HTTP callbacks.
Description: Set the alert mode for an individual link (mode 0: alerts disabled, mode 1: alerts enabled). If alerts are globally disabled, individual alerts cannot be enabled. Once a link is removed, its alert state will also be erased.
Description: Download the log associated with the specified LinkID and the duration between start and end UTC timestamps, for up to the previous 14 days. LinkIDs may only be specified for individual Media playlists. This API may take up to 30 seconds to complete.
"heading": " Time,MediaSequence,PlaylistState,SegmentState, BufferLevel, Outage, SegmentName,SegmentDuration,SegmentBytes,SegmentDownloadTime",
" 1580989097, 0, VOD, Monitoring, 7.62, 0.00, seq-4.ts, 2.0, 147204, 0.12",
" 1580989099, 0, VOD, Monitoring, 7.61, 0.00, seq-5.ts, 2.0, 146264, 0.12",
" 1580989101, 0, VOD, Monitoring, 7.62, 0.00, seq-6.ts, 2.0, 122200, 0.11",
" 1580989103, 0, VOD, Monitoring, 7.62, 0.00, seq-7.ts, 2.0, 104716, 0.11",
" 1580989105, 0, VOD, Monitoring, 7.55, 0.00, seq-8.ts, 2.0, 119568, 0.18"
Description: Enable or disable downloading of segments for all streams of the specified API key. When disabled, only HLS playlists are monitored for outages and underflows. Segment downloading must be enabled to monitor VOD streams.
The API returns the current state when no parameters are specified.
Description: Get the health status of the various system services, in addition to information about the number of streams being monitored and the aggregate download rate of all segments in kilobits per second (KBPS). This API can be called at most once every 30 seconds.
Description: Download all current errors and warnings associated with the specified LinkID and the duration between start and end UTC timestamps, for up to the 1000 most recent occurrences. LinkIDs may only be specified for both Master as well as Media playlists.
"code": " WA-1001",
"warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 34.90 seconds"
"code": " WA-1001",
"warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 27.08 seconds"
"code": " WA-1001",
"warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 19.27 seconds"
HLSAnalyzer.com continually downloads both media playlists as well as segments. When playlists or segments are not delivered on time, then alerts may be received according to configuration parameters. Media playlists may be in any of the following states:
Media Playlist State
Playlist does not have an ENDLIST and is progressing by adding new segments.
New segments are not added to the playlist (stale playlist).
The playlist cannot be downloaded due to HTTP errors.
The steam was in Live state, but has transitioned to ENDLIST. When in this state, no segment monitoring will be performed until the playlist returns to Live state again.
The stream was never in Live state and has an ENDLIST.
The starting state of the stream, which will transition to any of the states described above.
When either media playlist or segments arrive at a slower rate than the expected time duration, the playlist buffer will be depleted and eventually reach zero, which would indicate a rebuffering event at the player. The total time spent while the player is rebuffering is considered as the amount of outage and is reported by the analyzer. Alerts are based on the time that the player is in a rebuffering state (e.g. the hypothetical playback buffer is zero), which can help track both complete stream outages, as well as intermittent delivery issues. As a result of this, the actual outage amount (where no data was theoretically available for playback) may be smaller than the period where data experienced inconsistent delivery. For example, if 10-second segments are delivered at non real time rates and the playback buffer was already at or near zero, both outage and inconsistent delivery durations would be incurred. However, the accumulated outages would be 2 seconds for each segment, where the inconsistent delivery period would be accounted for the entire duration of the slower than real-time delivery times, as shown in the following diagram:
In general, users interested in total stream outages are encouraged to configure alert parameters to a minimum outage time of 300 seconds to avoid alerts based on transitionary delivery problems.
Alerts may be programmed to report the inconsistent delivery times, as well as when those conditions have been cleared. Alert email messages will generally have the following format:
Subject: OUTAGE: HLSAnalyzer Outage Alert for 5fa1ab24559c
This is an alert update from HLSAnalyzer.com for:
[5fa1ab24559c] Outage Time (UTC): 1610541723.00, Alert Condition Duration: 125.00 (sec), Total Accumulated Stream Outage: 128.3 (sec), Status: Stalled , Variant: https://hlsanalyzer.com/bunny.m3u8
[5fa1ab24559c] This stream experienced inconsistent delivery for 125.00 seconds.
Subject: OK: HLSAnalyzer Clear Alert for 5fa1ab24559c
This is an alert update from HLSAnalyzer.com for:
[5fa1ab24559c] Outage Time (UTC): 1610542123.00, Alert Condition Duration: 305.00 (sec), Total Accumulated Stream Outage: 386.0 (sec), Status: Live , Variant: https://hlsanalyzer.com/bunny.m3u8
[5fa1ab24559c] This stream's alert condition has been cleared after a consistent delivery period of 305.00 seconds.
The HLSAnalyzer.com service is monitored 24x7 to ensure continuous monitoring for our customers. The health of our system is continually monitored by:
Our list of internal monitoring tools is always expanding to ensure that our service remains up and available and continuously monitors our clients’ HLS streams.
General Error or Warning
Link quota limit reached
Invalid API Key
This feature requires a paid subscription
API Key has expired
Error condition with a specific text message
Warning condition with a specific text message
Invalid or missing LinkID
Invalid alert limit value specified
Invalid alert setup value specified
Media playlist has become a master playlist
A URI previously associated with a media playlist has become a master playlist. This is generally an unexpected condition.
An unusually large jump in media playlist progression
Media sequence numbers are expected to increase by 1, per RFC 8216 Section 6.2.2.
Media sequence wraparound
According to RFC 8216 Section 6.2.2, media sequence numbers MUST not wrap.
Negatively increasing media sequence
According to RFC 8216 Section 6.2.2, media sequence numbers MUST not decrease.
Extra player buffer accumulation
This error indicates the arrival of new segments faster than in realtime. This condition may eventually lead to skipped segment playback.
Negative segment duration
Segment duration must always be greater than zero.
Segment duration is greater than the target duration
Segment duration is greater than the target duration by more than 150%.
An unusually large segment duration
Any segment duration greater than 120 seconds is considered to be an error condition.
Invalid target or segment duration
The server could not decipher the segment or target duration in the playlist.
Bandwidth parameter not specified for media Playlist
According to RFC 8216 Section 18.104.22.168: “ Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute.”
The ratio of measured Peak Bitrate exceeds the specified bitrate
The measured peak bitrate must be less than the specified bitrate from the Master playlist
Could not download the segment
The segment specified by the media playlist could not be downloaded
Playlist and stream mismatch
The parameter specified in the Master playlist does not match the stream's characteristics
Could not download the playlist
An HTTP error is reported by the operating system when trying to read the link
Other HLS conformance error
A specific error was encountered; refer to the error message for details
Some operations, such as downloading high-bitrate streams, require a subscription
A rebuffering event experienced by the monitoring server, due to the slow arrival of media playlist segments.
Slow segment download time
Downloading of the segment took longer than the specified segment duration.
Media sequence number increment mismatch
Media sequence number differences do not match the expected segment counts in a live playlist.
Master playlist feature not supported
Media playlists that change resolution or are added or removed are not yet supported.
Copyright © 2021 Task One, LLC. All Rights Reserved.