Precision API User Guide

 

Conviva Precision allows video publishers to maximize the value of their multi CDN/multi resource video delivery strategy; improving QoE, adding resilience to their service, while managing CDN costs. Conviva Precision is powered by a flexible business policies engine together with real time QoE measured at every viewer device. It provides a Video AI API to recommend the best CDN or Resource to deliver Video for each and every viewer. A Resource can be just a CDN, a CDN from a given Origin, a POP or Edge from an Internal CDN, etc.

Use the Precision API Reference to view detailed API information.

Prerequisites

Before getting started with Precision, ensure these requirements are met.

  • Conviva Conviva VSI is implemented on at least one player. Precision's recommendation service API is built on the data that is collected through the VSI integration.
  • Multiple CDN/Multiple Delivery Resource architecture.

Benefits/Use Cases of Precision

The benefits of optimizing a multi-CDN/multi-resource strategy with Conviva Precision include:

  • Maximize Service Uptime: Fall back to an alternate CDN when and where the primary is underperforming.
  • Minimize CDN Costs: Send more traffic to the cheaper CDN without compromising QoE. Easily switch traffic during or after contract negotiations.
  • Optimize Viewer QoE: Use each CDN where and when it performs the best, within constraints defined by the business policies.
  • Self Healing and Generic Resource Optimization: Define delivery resources based on stream URL path patterns and configure Precision to choose the best performing resource for each and every viewer based on encoding policy, redundant resource, and multiple CDNs.
  • Guarantee QoE during High-Concurrency Events: Balance traffic based on how well CDNs handle peak load.
  • From Single to Multi-CDN Risk Free: Introduce new CDNs and run POCs without risking QoE.
  • Internal CDN Offload: Use a third party CDN only when traffic spikes to a level above the internal CDN capacity or when the internal CDN experiences performance problems.

Self Healing and Generic Resource Optimization

Conviva Precision allows video publishers to further maximize the value of their multi-CDN/multi-resource video delivery strategy by allowing optimization of generic resources, which can be a CDN serving content from a given (redundant) origin. In this case, Precision can be configured to optimize the selection of the CDN along with the best origin server (for example, a live channel which is in Origin 1 will be served through CDN A) based on business policies, QoE, and resource traffic shares.

Resource Mapping

With redundant resource origins available to multiple CDNs, resource mappings based on stream URL can be used to indicate the CDN and resource origin (e.g. data center):

  • https://CDN1-DC1-LIVE-HLS.example.com/pathToContent.m3u8
    • Path Pattern: CDN1-DC1-LIVE-HLS
    • Resource: CDN1 DC1 LIVE HLS
    • CDN: CDN1
  • https://CDN1-DC2-LIVE-HLS.example.com/pathToContent.m3u8
    • Path Pattern: CDN1-DC2-LIVE-HLS
    • Resource: CDN1 DC2 LIVE HLS
    • CDN: CDN1
  • https://CDN2-DC1-LIVE-HLS.example.com/pathToContent.m3u8
    • Path Pattern: CDN2-DC1-LIVE-HLS
    • Resource: CDN2 DC1 LIVE HLS
    • CDN: CDN2
  • https://CDN2-DC2-LIVE-HLS.example.com/pathToContent.m3u8
    • Path Pattern: CDN2-DC2-LIVE-HLS
    • Resource: CDN2 DC2 LIVE HLS
    • CDN: CDN2

VRL Sample Request for Multi CDN and Resource Origin Optimization

In the resource selection process, the candidate resources (c3.r1 to c3.r4) are shown above. These are the resources which can serve the asset being requested. Precision selects the best resource based on business policies and QoE. Traffic shares can also be enforced per resource to make sure Precision takes resource access capacity into account. This enables you to also configure optimization for situations where a resource is not selected based only on traffic or QoE comparison, ensuring the most optimized available resource and CDN combination is used.

Example VRL Request

Copy
https://vrl.m.conviva.com/?c3.vr=2&c3.rt=p&c3.im=p&c3.um=i&c3.ck=2d140fe495d9f8e824faa884f68ddb8141a42ddb&c3.ip=68.71.35.162&c3.os=WIN&c3.vi=ViewerID&c3.at=LIVE_EVENT&c3.vp=l&c3.r1=CDN1-DC1-LIVE-HLS&c3.r2=CDN1-DC2-LIVE-HLS&c3.r3=CDN2-DC1-LIVE-HLS&c3.r4=CDN2-DC2-LIVE-HLS

Precision Policies

Conviva policies govern the CDN switching decisions to optimize QoE with CDN cost management. Policy constraints enable different policy models for the most optimized switching methods:

  • Distribution Policies

    • Restricting predefined traffic shares between resources so only the best CDN in a delivery pattern gets more traffic there (quality driven).
    • Allowing custom traffic shares, which may be ignored when custom QoE deterioration delta is reached (constrained optimization).
  • Throttling Policies

    • Limit traffic on a specific resource to a custom throttling threshold.
  • Optimization Logic
    • Using only the most recent 5 minutes of data, where last minute weighs more than the minute before, and so on. (Failure Detection Module).
    • Evaluating different KPIs in sequence and at different thresholds. (Failure Detection Module).
    • Using more historical data, where more recent data weights more. (Baseline Optimization).
    • Optimizing for a KPI which can be composed of single or combined QoE metrics. (Baseline Optimization).

High-Level Integration Flow

An example of a high-level integration flow shows the VRL request and response from the CMS. The exact structure of a VRL message and corresponding response from Conviva vary based on the deployed services.

  1. Player requests to the CMS a stream URL to playback.
  2. VRL (Virtual Resource Locator) request contains parameters to enable respective policies (for example, Client IP, Stream Protocol, Live or VOD, custom tags). VRL is composed in the CMS and sent to Conviva. VRL Specification must be followed.
  3. VRL Response is a function of Business Policies and the Real Time and recent historical QoE data. VRL response can be a priority list of resources / CDNs, or stream URL directly. A 500ms timeout should be set, falling back to a default valid URL returned by CMS to Player.
  4. Stream URL passed to the Player. More than one URL can be passed to the player in case a fallback logic is available in the player.
    1. Playback starts from chosen CDN or Resource, the respective Conviva VSI monitoring session is created.
    2. The Conviva VSI session started and correlated to the Precision Decision by means of a Request Identifier (c3.ri) which is returned in the VRL response and appended to the stream URL as a query parameter (recommended) or Client IP address (alternative).

This illustration compares the resource selection process with and without VRL requests/replies.

If there are redundant resource origins, Precision can also be configured to optimize the selection of the CDN along with the best resource origin (data center) based on business policies, QoE, and resource traffic shares.

VRL Protocol

In the resource selection process, the CMS (the publisher) decides whether to use the ‘Priority List’ information provided by Precision for decision making or advisory data. In a typical deployment, the highest priority resource (and optionally the recommended set of bitrates) is propagated to each viewing device without modification and Conviva Precision acts as an automated real-time decision-making service. Alternatively, the CMS can utilize the information provided through VRL as part of its own resource selection logic and/or manifest generation service – in this mode, Conviva is providing “advice” but the CMS/publisher maintains the decision-making control.

VRL Request

The VRL uses query parameters to encode all of the information that Conviva Precision needs to select session parameters (resource and/or bitrates). Some query parameters are required; some are (strongly) recommended; others are optional based on availability. Required, mandatory parameters are explicitly called out in their definitions.

VRL Format

This is the format for a typical VRL. Use this format whenever the VRL includes Conviva-specific query parameters:

https://vrl.m.conviva.com/path?query-params

VRL Size

A VRL should be no longer than 2,048 bytes. A longer VRL might be truncated to the first 2,048 bytes. Therefore, all required parameters must be ordered in the query-string ahead of other parameters in case of truncation.

VRL Path

VRL is used to communicate between two headend systems. No player streamer is involved and the response is a standard JSON, thus any file extension can be used. However, for simplicity, we recommend you always use the literal value: “/a.mp4”

VRL Query Parameters

All Conviva-specific information in the VRL is encoded in URL query parameters. Here are the rules associated with forming the query parameters:

  • Each query parameter defines a key-value pair.
    • The key is a pre-defined string in the table below.
    • The value is either customer-specific or a pre-defined enumerated value.
  • All query parameter values must be properly URL encoded.
  • Any non-ASCII query parameter values must use UTF-8 encoding.
  • Each query parameter key must be of the form PFX.KEY.
    • Default value for PFX is c3.
    • In the rare case where your CDN URL’s own query parameters conflict with ‘c3.’ you can override PFX with another prefix defined by the optional special query string key CONVIVA_PREFIX. The examples that follow use PFX = c3.
  • For custom key-value pairs, use the form PFX.ext.key.
  • Omitting required parameters will result in an error.
Example VRL Requests

CDN Selection

Copy
https://vrl.m.conviva.com/a.ism/Manifest?c3.vr=2&c3.rt=p&c3.im=p&c3.um=d&c3.ck=2d140fe495d9f8e824faa884f68ddb8141a42ddb&c3.vp=l&c3.ip=90.216.134.196&c3.r1=CDN_A&c3.r2=CDN_B&c3.r3=CDN_C&c3.vi=12345&c3.at=ON_DEMAND&c3.ext.DEVICE_TYPE=MOBILE&c3.ext.PLATFORM=IOS&c3.ext.SERVICE_KEY=432213&c3.ext.CONTENT_ID=123

Resource Optimization

Copy
https://vrl.m.conviva.com/?c3.vr=2&c3.rt=p&c3.im=p&c3.um=i&c3.ck=2d140fe495d9f8e824faa884f68ddb8141a42ddb&c3.ip=68.71.35.162&c3.os=WIN&c3.vi=ViewerID&c3.at=LIVE_EVENT&c3.vp=l&c3.r1=CDN1-DC1-LIVE-HLS&c3.r2=CDN1-DC2-LIVE-HLS&c3.r3=CDN2-DC1-LIVE-HLS&c3.r4=CDN2-DC2-LIVE-HLS

VRL Query Parameters

Parameter Value Description Status

c3.vr

2

The VRL protocol version, currently '2'.

Required

c3.ck

Customer-specific

Customer Key

This is a 40-character alphanumeric account identifier assigned to you by Conviva Customer Support.

Example: c3.ck=a123456789b123456789c123456789d123456789

Required

c3.rt

p (Priority List)

Response Type

Returns a ranked list of video startup parameters. See the VRL Response section for details.

Required

c3.vp

p, l, s, d, m, w, o

Video protocol

The data-plane video protocol. These are the supported protocol types:

  • p: Progressive Download

  • l: Apple HLS (lowercase 'L')

  • s: MS Smooth Streaming

  • d: Adobe HDS

  • m: MPEG DASH

  • w: MS Windows Media

  • o: Other

Required

c3.im

p, d

Reserved, must be set to 'p' (CMS integration) or 'd' (player integration).

Required

c3.um

i (Identical), d (Different)

URL mode

A Boolean value that indicates whether the asset's URL paths are identical (i) or different (d) on the various CDNs.

Required

c3.cs

CustomString

URL mode

Enables the VRL request/device to be associated with a specific Precision policy.

Example: c3.cs='mss'

Optional

c3.r1

Customer-specific

Primary/Default CDN Resource

This is the default CDN Resource to be used as a fallback if Precision does not have enough information to make a decision.

When CDN paths are different, this must be a valid and complete CDN URL for the primary CDN. It must include hostname, path, and any query parameters.

When CDN paths are identical, but c3.r1 is required, c3.r1 must at least have the scheme and hostname of the CDN URL (e.g. https://custA.fplive.net)

c3.r1 should correspond to a resource in the Precision Policy Engine. The latter is usually a prefix-match of c3.r1.

For example, if your primary/default URL for an asset is: https://custA.fplive.net/vod/id12345/hd.m3u8, you can set: c3.r1=http%3A%2F%2FcustA.fplive.net%2Fvod%2Fid12345%2Fhd.m3u8

You may request configuring the corresponding resource in Precision Policy Engine as:

  • Resource URL Prefix: 'https://custA.fplive.net/vod'

  • CDN: 'LEVEL3'

  • Name: 'Primary Level3 VOD'

You may pass in a uniquely identifiable Alias for a CDN Resource. For example, if you primary/default URL for an asset is: https://custA.fplive.net/vod/id12345/hd.m3u8

You may set: c3.r1=fplive.net

You may request configuring the corresponding resource in Precision Policy Engine as:

  • Resource URL Alias: 'fplive.net'

  • CDN: 'LEVEL3'

  • Name: 'Primary Level3 VOD'

Required

c3.r2 – c3.r9

Customer-specific

Other CDN Resource(s)

At least c3.r2 may be Required to enable multi-CDN selection.

These additional resources follow the same format rules as c3.r1 You can specify a maximum of 9 resources.

Optional

c3.ip

IPv4 Dotted Decimal String

IP address

CMS/headend system invokes the VRL request on behalf of an enduser's video player, Conviva needs the end-user's IP address for geolocation services.

Example: c3.ip=1.2.3.4

Required

c3.os

[1...64] bytes

MAC, WIN, IOS, AND, XBOX, PS3, ROKU, OTHER

Operating system

String representing the Operating System of the video device. AND includes generic Android and derivatives.

Optional

c3.ov

[1...64] bytes

Operating system version

Full version number of the device's operating system. See c3.os (above).

Optional

c3.ua

[1…128] bytes

User agent

The user-agent of the video device, with appropriate URL-encoding.

Strongly recommended.

c3.an

[1…128] bytes

Asset name

Video description, for example its title. We recommend that you include both a unique video ID and a human readable string. For example:

c3.an=123456789%3A%20Game%20of%20Phones

Optional

c3.dt

SETTOP, TV, MOBILE, CONSOLE, TABLET, PC, BLURAY, OTHER

Device type

A predefined string that identifies the type of the video device. These are the values you can use. Use only one of them at a time.

SETTOP: Streaming device, such as cable set-top boxes, Roku, or AppleTV.

TV: Connected TV used to watch the video in a browser or dedicated application.

MOBILE: Smartphone or feature phone used to watch the video in a browser or dedicated application.

CONSOLE: Game consoles, such as Xbox, Wii, etc.

TABLET: Tablet devices, such as Apple iPad or Amazon's Kindle Fire.

PC: Desktop computer or laptop.

BLURAY: Devices that can be used as both a Blu-ray player and a settop box, such as Samsung Blu-ray player.

OTHER: Any other unspecified type of device.

Optional

c3.db

[1…64] bytes

Device brand

A short string that identifies the device platform manufacturer. For example: 'Apple' or 'Samsung'.

Optional

c3.dm

[1…64] bytes

Device model

A short string that identifies the model version of the device. For example: 'iPhone4,1' or 'GalaxyTab2'.

Optional

c3.dv

[1…64] bytes

Device firmware version

A short string that identifies the firmware version of the device.

Optional

c3.dc

3G, 4G, LTE, WWAN, WIFI, SAT, CABLE, ISDN, DIALUP, DSL, ETH, TX, FR, OCX, FIXWL, MOBWL, OTHER

Device connection

A pre-defined string that identifies the device's last-mile connection. These are definitions of the less common connection types.

  • TX: T1, T3

  • FR: Frame Relay

  • FIXWL: Fixed Wireless

  • MOBWL: Mobile Wireless

Optional

c3.di

[1…128] bytes

Unique device identifier

A short string that uniquely identifies a device, in case device-specific policies are needed.

Optional

c3.vi

[1…128] bytes

Viewer ID

A unique string that corresponds to a subscriber/viewer. Typically, this should be an obfuscated value of a service subscriber ID.

Strongly recommended, if Viewer module is used

c3.at

ON_DEMAND, LIVE_EVENT, LINEAR_LIVE, EVENT_REPLAY, DOWNLOAD, OTHER

Asset Type

A predefined string for the type of video content.

Optional

c3.ext. key=value

key: [1...64] bytes, value: [1…64] bytes

Customer-specific key-value pairs

Any customer-specific metadata to be used for policy control or analytics. All customer-specific keys must be prefixed with 'ext' to distinguish them from Conviva keys.

The key and value are limited to 64 bytes of valid UTF-8 characters each. For example: c3.ext.serviceType=premium

Optional

VRL Response

Important: All CDN Resources (aliases or URLs) must be configured in the Precision Policy Engine before Precision is deployed to production.

VRL Priority List Response

For either success or error, Precision responds with a JSON-formatted response. This table describes the fields in the response.

Key Parameter Description

is_error

If true, 'error_code' and 'error_message' (see below) may also be present. If false, the resource list may be present.

error_code

An error code that maps to a specific problem.

error_message

A description of the error.

warning_message

A warning message that might be generated along with an otherwise successful response.

resource_list

List of CDN resources. Each resource is assigned a priority. Resource with highest priority is expected to provide the best video quality for the requesting video session.

resource

Resource for the selected CDN. Typically this is one of the resources passed in the VRL request, or configured in the Policy Engine, and follows the format (scheme://hostname).

priority

Priority of the specified resource. The proxy is expected to point the video playback device to the top priority (p = 1) resource from the list. It may fail back to lower priority resources only when the higher priority resources are not available.

vrl

The VRL that generated the response. Repeating the VRL in the response allows for easy debugging in case of errors.

cdn

Name of CDN, using CDN canonical names (e.g. "AKAMAI", "LEVEL3", "LIMELIGHT", etc.). A sample list is available at Sample CDN list.

Successful Response

For a successful Priority List response, Precision responds with a list of resources. The list includes the selected resource, the CDN name, and the priority of this resource. Resource with highest priority should be used.

The response also includes a request identifier (c3.ri).

Important: Key and value of c3.ri MUST be appended as an additional query parameter, as-is, to the end of all of the CDN URLs that are generated and sent to the video player. This parameter allows for the Conviva VSI session to be correlated with the respective Precision response. As this happens, the Conviva platform adds the tags from the VRL request to the VSI session, which enables optimization by any parameter included in the VRL request.

Error Response

If an error occurs while processing a VRL request, an appropriate HTTP Status code is returned with a message body that contains a JSON-format message string that describes the error scenario.

Copy
{
 “is_error”: true,
 “error_code”: “ErrorCode”,
 “error_message”: “ErrorMessageString",
 “vrl”: “TheRequestVRLThatGeneratedThisResponse”
}
Example VRL Responses

CDN Selection

Copy
    {"c3.ri":"5688238005746815660",
    "is_error":false,
    "resource_list":[
    {
    "cdn":"CDN_A",
    "priority":1,
    "resource":"CDN A”
    },
    {
    "cdn":”CDN_B",
    "priority":2,
    "resource":"CDN B"
    },
    {
    "cdn":"CDN_C",
    "priority":3,
    "resource":"CDN C"
    }
    ],
    "vrl":
    "https://vrl.m.conviva.com/a.ism/Manifest?c3.vr=2&c3.rt=p&c3.im=p&c3.um=d&c3.ck=2d140fe495d9f8e824faa884f68ddb8141a42ddb&c3.vp=l&c3.ip=90.216.134.196&c3.r1=CDN_A&c3.r2=CDN_B&c3.r3=CND_C&c3.vi=12345&c3.at=ON_DEMAND&c3.ext.DEVICE_TYPE=MOBILE&c3.ext.PLATFORM=IOS&c3.ext.SERVICE_KEY=432213&c3.ext.CONTENT_ID=123"}

Resource Optimization

Copy
    {"c3.ri":"5693023080729431544",
    "is_error":false,
    "resource_list":[
    {
    "cdn":"INHOUSE",
    "priority":1,
    "resource":"CDN1-DC1-LIVE-HLS"
    },
    {
    "cdn":"INHOUSE",
    "priority":2,
    "resource":"CDN1-DC2-LIVE-HLS"
    },
    {
    "cdn":"INHOUSE",
    "priority":3,
    "resource":"CDN2-DC1-LIVE-HLS"
    },
    {
    "cdn":"INHOUSE",
    "priority":4,
    "resource":"CDN2-DC2-LIVE-HLS"
    }
    ],
    "vrl":
    "https://vrl.m.conviva.com/?c3.vr=2&c3.rt=p&c3.im=p&c3.um=i&c3.ck=2d140fe495d9f8e824faa884f68ddb8141a42ddb&c3.ip=68.71.35.162&c3.os=WIN&c3.vi=ViewerID&c3.at=LIVE_EVENT&c3.vp=l&c3.r1=CDN1-DC1-LIVE-HLS&c3.r2=CDN1-DC2-LIVE-HLS&c3.r3=CDN2-DC1-LIVE-HLS&c3.r4=CDN2-DC2-LIVE-HLS"}

Error Scenarios

Error or Warning Condition for Priority List Responses HTTP Status Code JSON Error Code ('error_code') Notes

Invalid Customer ID

403

None

No JSON text is returned.

Invalid VRL version

400

CVRL0001

VRL version cannot be parsed or the value is outside the range of supported versions.

Invalid VRL hostname

400

CVRL0002

VRL hostname cannot be parsed or its syntax is invalid.

VRL query-parameters can not be parsed successfully

400

CVRL0003

A required query parameter is not available, the syntax is invalid, or parameter extraction failed.

Required resources are not available in the VRL and resources are not configured inthe Precision Policy Engine

400

CVRL0004

Precision cannot generate a valid CDN URL for the asset.

Required resources are not available in the VRL and CDN URL paths are different

400

CVRL0005

Precision cannot generate a valid CDN URL for the asset.

No resources configured in the Precision Policy Engine

200

None

If c3.r1 is available in the VRL, Precision will respond with c3.r1 as the first and only element in the resource_list. This might not be the optimal CDN.

May include a warning_message.

Required resources do not match those in the Precision Policy Engine

200

None

c3.r1 and c3.r2 are specified but do not match any of the resources configured in the Precision Policy Engine.

Precision responds with c3.r1 or the highest priority resource as the lone element in resource_list.

If there is a subset that matches, only those resources are considered for the selection.

May include a warning_message.

Missing parameter "c3.ip"

200

None

IP address is required for both policy enforcement and CDN selection.

If the IP is missing and no matching policy is found, redirects to c3.r1.

X-CVRL-WARNING may include a warning message.

Server Processing Error

500

CVRL5000

There was a server side error.

Precision API Reference

Use the Precision API reference to view detailed API information.

Conviva Precision API Reference