How to ingest asset using CPIX
1. Introduction
This section will introduce how to generate the encryption key for any video packager with CPIX standard. Below is our KMS information:
Environment | Base URL |
---|---|
Staging | https://api-staging.sigmadrm.com |
Production | https://api.sigmadrm.com |
2. CPIX Ingest API
Request:
Path:
- v1: /assets/ingest/{:merchantId}/{:appId}
- v2: /assets/ingest/cpix/v2/{:merchantId}/{:appId}
Method: POST
Headers:
- content-type: application/xml
- x-access-token: this field will be our system provide to client
Params:
Field Name Type Description merchantId String Merchant account id appId String App ID Body: CPIX Request
Response: CPIX Response
3. CPIX Data
3.1. Content Key
3.1.1 Request
xml
<?xml version="1.0"?>
<cpix:CPIX
xmlns:cpix="urn:dashif:org:cpix"
xmlns:pskc="urn:ietf:params:xml:ns:keypr
ov:pskc" contentId="test_ch1">
<cpix:ContentKeyList>
<cpix:ContentKey kid="af1ed63c-5784-460b-9e51-309dd47b7d9c"></cpix:ContentKey>
</cpix:ContentKeyList>
…
</cpix:CPIX>
- In where:
Field Name | Type | Description |
---|---|---|
contentId | String | Specifies an identifier for the asset or content that must be protected by the keys carried in this CPIX document. Configurable in Packager. Must be ≤ 64 characters in length |
kid | String | The unique identifier of the Content Key generated by Packager. The value is an version 4 UUID. |
3.1.2 Response
xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:CPIX
xmlns="http://www.w3.org/2000/09/xmldsig#"
xmlns:ns2="urn:ietf:params:xml:
ns:keyprov:pskc"
xmlns:ns3="http://www.w3.org/2001/04/xmlenc#"
xmlns:ns4="urn:dashi
f:org:cpix" contentId="test_ch1">
<ns4:ContentKeyList>
<ns4:ContentKey kid="af1ed63c-5784-460b-9e51-309dd47b7d9c" explicitIV="IWHTiHncO
dfFwyTP5nUUBQ==">
<ns4:Data>
<ns2:Secret>
<ns2:PlainValue>QB+EqpA72kH82EkBrMaW1A==</ns2:PlainValue>
</ns2:Secret>
</ns4:Data>
</ns4:ContentKey>
</ns4:ContentKeyList>
…
</ns4:CPIX>
- In where:
Field Name | Type | Description |
---|---|---|
explicitIV | String | The IV to use when solution-specific logic requires a single explicit IV to be associated with a Content Key. This parameter is only mandatory for HLSFairPlay and it will not be used by Packager for any other content protection even if it is specified. The KMS is responsible for generating a unique IV the first time it gets a new request, then storing it in its database and providing the packager with consistent IV value in the response |
PlainValue | String | This element carries the plain text value of the Content Key in base64 binary format. |
3.2 Multi Key
3.2.1 Request
xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cpix:CPIX
xmlns:cpix="urn:dashif:org:cpix"
xmlns:pskc="urn:ietf:params:xml:ns:keyprov:pskc" contentId="test_multi_key">
<cpix:ContentKeyList>
<cpix:ContentKey kid="4eedd18e-69fd-11eb-9439-0242ac130002"/>
<cpix:ContentKey kid="a58f1b10-ebad-498f-a3f5-135b4a59b937"/>
<cpix:ContentKey kid="1db1052e-6a56-43ad-a557-47ad8b6c7800"/>
</cpix:ContentKeyList>
<cpix:DRMSystemList>
<!-- FairPlay HLS -->
<cpix:DRMSystem kid="4eedd18e-69fd-11eb-9439-0242ac130002" systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2"/>
<cpix:DRMSystem kid="a58f1b10-ebad-498f-a3f5-135b4a59b937" systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2"/>
<cpix:DRMSystem kid="1db1052e-6a56-43ad-a557-47ad8b6c7800" systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2"/>
</cpix:DRMSystemList>
<cpix:ContentKeyPeriodList>
<cpix:ContentKeyPeriod id="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe" index="1609335911"/>
</cpix:ContentKeyPeriodList>
<cpix:ContentKeyUsageRuleList>
<cpix:ContentKeyUsageRule intendedTrackType="SD" kid="4eedd18e-69fd-11eb-9439-0242ac130002">
<cpix:KeyPeriodFilter periodId="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe"/>
</cpix:ContentKeyUsageRule>
<cpix:ContentKeyUsageRule intendedTrackType="HD" kid="a58f1b10-ebad-498f-a3f5-135b4a59b937">
<cpix:KeyPeriodFilter periodId="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe"/>
</cpix:ContentKeyUsageRule>
<cpix:ContentKeyUsageRule intendedTrackType="UHD" kid="1db1052e-6a56-43ad-a557-47ad8b6c7800">
<cpix:KeyPeriodFilter periodId="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe"/>
</cpix:ContentKeyUsageRule>
</cpix:ContentKeyUsageRuleList>
</cpix:CPIX>
- In Where:
Field Name | Type | Description |
---|---|---|
intendedTrackType | String | Specifies the media track type which corresponds to the streams which match the rules defined in this ContentKeyUsageRule element. The "intendedTrackType" element has the syntax of xs:string data type. Examples: SD, HD, FHD, 2K, 4K |
3.2.2 Response
xml
<?xml version='1.0' encoding='UTF-8'?>
<ns4:CPIX
xmlns="http://www.w3.org/2000/09/xmldsig#"
xmlns:ns2="urn:ietf:params:xml:
ns:keyprov:pskc"
xmlns:ns3="http://www.w3.org/2001/04/xmlenc#"
xmlns:ns4="urn:dashi
f:org:cpix" contentId="test_multi_key" name="test_multi_key">
<ns4:ContentKeyList>
<ns4:ContentKey explicitIV="SwFwE5VoUZ5VU0cmutgPlw==" kid="2e46ec53-7cc1-4d6a-91b0-00ceed43d18f">
<ns4:Data>
<ns2:Secret>
<ns2:PlainValue>i/shc0Rr991B6yQ140eDZA==</ns2:PlainValue>
</ns2:Secret>
</ns4:Data>
</ns4:ContentKey>
<ns4:ContentKey explicitIV="n0PRkLp/mVvOYozyWDiFSg==" kid="30a60932-2d4e-43c1-a9a2-0c2d25ab2a88">
<ns4:Data>
<ns2:Secret>
<ns2:PlainValue>2L7GHPxUIypZqJ1SzB7lWQ==</ns2:PlainValue>
</ns2:Secret>
</ns4:Data>
</ns4:ContentKey>
<ns4:ContentKey explicitIV="l/CtjfbnKm/BiE/mTUawDQ==" kid="e5fed793-4e8b-472f-a45e-b83d1fe38c99">
<ns4:Data>
<ns2:Secret>
<ns2:PlainValue>SxfD9ulhgUyK+EEZsJaHBg==</ns2:PlainValue>
</ns2:Secret>
</ns4:Data>
</ns4:ContentKey>
</ns4:ContentKeyList>
<ns4:DRMSystemList>
<!-- FairPlay HLS -->
<ns4:DRMSystem kid="2e46ec53-7cc1-4d6a-91b0-00ceed43d18f" systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2">
<ns4:PSSH>AAAANHBzc2gBAAAAlM6G+wf/T0OtuJPS+paMogAAAAEABf2t38yqAydknX6uxQx3AAAAAA==</ns4:PSSH>
<ns4:HLSSignalingData playlist="master">Li4u</ns4:HLSSignalingData>
<ns4:HLSSignalingData playlist="media">Li4u</ns4:HLSSignalingData>
</ns4:DRMSystem>
<ns4:DRMSystem kid="30a60932-2d4e-43c1-a9a2-0c2d25ab2a88" systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2">
<ns4:PSSH>AAAANHBzc2gBAAAAlM6G+wf/T0OtuJPS+paMogAAAAEABf2t38yqAydknX6uxQx3AAAAAA==</ns4:PSSH>
<ns4:HLSSignalingData playlist="master">Li4u</ns4:HLSSignalingData>
<ns4:HLSSignalingData playlist="media">Li4u</ns4:HLSSignalingData>
</ns4:DRMSystem>
<ns4:DRMSystem kid="e5fed793-4e8b-472f-a45e-b83d1fe38c99" systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2">
<ns4:PSSH>AAAANHBzc2gBAAAAlM6G+wf/T0OtuJPS+paMogAAAAEABf2t38yqAydknX6uxQx3AAAAAA==</ns4:PSSH>
<ns4:HLSSignalingData playlist="master">Li4u</ns4:HLSSignalingData>
<ns4:HLSSignalingData playlist="media">Li4u</ns4:HLSSignalingData>
</ns4:DRMSystem>
</ns4:DRMSystemList>
<ns4:ContentKeyPeriodList>
<ns4:ContentKeyPeriod id="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe" index="1609335911"/>
</ns4:ContentKeyPeriodList>
<ns4:ContentKeyUsageRuleList>
<ns4:ContentKeyUsageRule intendedTrackType="SD" kid="2e46ec53-7cc1-4d6a-91b0-00ceed43d18f">
<ns4:KeyPeriodFilter periodId="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe"/>
</ns4:ContentKeyUsageRule>
<ns4:ContentKeyUsageRule intendedTrackType="HD" kid="30a60932-2d4e-43c1-a9a2-0c2d25ab2a88">
<ns4:KeyPeriodFilter periodId="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe"/>
</ns4:ContentKeyUsageRule>
<ns4:ContentKeyUsageRule intendedTrackType="UHD" kid="e5fed793-4e8b-472f-a45e-b83d1fe38c99">
<ns4:KeyPeriodFilter periodId="keyPeriod_9c786af2-f23f-37d2-a7f9-c94aaf3c94fe"/>
</ns4:ContentKeyUsageRule>
</ns4:ContentKeyUsageRuleList>
</ns4:CPIX>
3.3 DRM Signaling
3.3.1 Support DRM System
DRM | SYSTEM ID | STREAMING FORMAT |
---|---|---|
Microsoft PlayReady | 9a04f079-9840-4286-ab92-e65be0885f95 | MPEG-DASH, Microsoft Smooth Streaming, HLS-fMP4 |
Google Widevine | edef8ba9-79d6-4ace-a3c8-27dcd51d21ed | MPEG-DASH, HLS-fMP4 |
Apple FairPlay | 94ce86fb-07ff-4f43-adb8-93d2fa968ca2 | HLS-(sTS/fMP4), Sample-AES |
3.3.2 Request
xml
<?xml version="1.0"?>
<cpix:CPIX
xmlns:cpix="urn:dashif:org:cpix"
xmlns:pskc="urn:ietf:params:xml:ns:keypr
ov:pskc" contentId="test_ch1">
<cpix:ContentKeyList>
<cpix:ContentKey kid="af1ed63c-5784-460b-9e51-309dd47b7d9c"></cpix:ContentKey>
</cpix:ContentKeyList>
<cpix:DRMSystemList>
<cpix:DRMSystem systemId="9a04f079-9840-4286-ab92-e65be0885f95" kid="af1ed63c-5784-460b-9e51-309dd47b7d9c">
<!-- PlayReady -->
</cpix:DRMSystem>
<cpix:DRMSystem systemId="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" kid="af1ed63c-5784-460b-9e51-309dd47b7d9c">
<!-- Widevine -->
</cpix:DRMSystem>
<cpix:DRMSystem systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2" kid="af1ed63c-5784-460b-9e51-309dd47b7d9c">
<!-- FairPlayStreaming -->
</cpix:DRMSystem>
</cpix:DRMSystemList>
…
</cpix:CPIX>
3.3.3 Response
xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:CPIX
xmlns="http://www.w3.org/2000/09/xmldsig#"
xmlns:ns2="urn:ietf:params:xml:ns:keyprov:pskc"
xmlns:ns3="http://www.w3.org/2001/04/xmlenc#"
xmlns:ns4="urn:dashif:org:cpix" contentId="test_ch1">
…
<ns4:DRMSystemList>
<ns4:DRMSystem systemId="9a04f079-9840-4286-ab92-e65be0885f95" kid="af1ed63c-5784-460b-9e51-309dd47b7d9c">
<!-- PlayReady -->
<ns4:PSSH>AAADNnBzc2…</ns4:PSSH>
<ns4:ContentProtectionData>PGNlbmM6cHN…</ns4:ContentProtectionData>
<ns4:SmoothStreamingProtectionHeaderData>AgMAAAE…
</ns4:SmoothStreamingProtectionHeaderData>
</ns4:DRMSystem>
<ns4:DRMSystem systemId="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" kid="af1ed63c-5784-460b-9e51-309dd47b7d9c">
<!-- Widevine -->
<ns4:PSSH>AAAAa3Bzc2g…</ns4:PSSH>
<ns4:ContentProtectionData>PGNlbmM6cHN…</ns4:ContentProtectionData>
</ns4:DRMSystem>
<ns4:DRMSystem systemId="94ce86fb-07ff-4f43-adb8-93d2fa968ca2" kid="af1ed63c-5784-460b-9e51-309dd47b7d9c">
<!-- FairPlayStreaming -->
<ns4:HLSSignalingData>I0VYVC1YL…</ns4:HLSSignalingData>
</ns4:DRMSystem>
</ns4:DRMSystemList>
…
</ns4:CPIX>
3.3.4 Use of DRM Signaling
Element | Packager Action |
---|---|
PSSH | This is the full PSSH box that should be added to ISOBMFF files. |
SmoothStreamingProtectionHeaderData | This is the inner text of the ProtectionHeader XML element to be added to the Smooth Streaming manifest for this DRM system. This data shall describe the root key information (but not the root key themselves) Ref: DASH-IF CPIX v2.2 section 6.3. Hierarchical Keys |
ContentProtectionData | This is the full well-formed standalone XML fragment to be added to the DASH manifest under the ContentProtection element for this DRM system. |
HLSSignalingData | This is the full data including the #EXT-X-KEY or #EXT-X-SESSION-KEY tag of a HLS playlist. This may contain multiple lines allowing to add lines with proprietary tags and values. If the optional attribute "playlist" ⚫ is not specified or is "media", this data will be inserted as the segment tag in media playlist. ⚫ is "master", this data will be inserted as the master playlist header tag. |
CHANGE LOG
- 20/10/2022: Init document CPIX
- 19/03/2024: Add Ingest CPIX API version 2:
- Key rotation support