CPIX Verify

This tutorial explains how to use CPIX Verify tool more effective to enhance troubleshooting speed or testing workflows on CPIX files. This tutorial does not explain how to use tool itself. To learn more about the verify tool please go to CPIX Verify page.

This tutorial includes some basic examples with basic possible errors frequently unnoticed in complicated setups. Also, some examples are similar to some of our users stories.

The examples would output different errors than mentioned in the document. The reason is the replaced values of the original files. Besides, we would like to show some basic errors in the first part, at the same time to give you more interesting problems to solve. Please don't hesitate to check valid examples from CPIX Verify documentation to fix these problems.

Before you start

Before starting please make sure that:

  • Unified Origin is properly installed, which includes 'mp4split' (see: How to Install)
  • You have downloaded the Tears of Steel test content (see: Verify Your Setup)

Note

All of the commands in this tutorial can be run from your user's home directory, but some of them might require you to use sudo, depending on the exact rights of your user and the configuration of your system.

Setting up your test environment

This tutorial examples tested or created on an Ubuntu OS environment. Please make sure any command-line or editor based errors might occur if you are running a different OS.

You can use any text editor to create the files. Please take consider to copying and pasting might cause issues if you use more complex editors.

Basic Scenarios and Common Errors

One of the most basic usages of the verify tool is scanning your CPIX file against typo errors. As the CPIX files are basic XML files, changing parameters or different text editors might cause some unexpected problems. In this case, CPIX verify can help for the detect various simple mistakes.

#!/bin/bash

ubuntu@ip-172-31-39-188:~$ cpix_verify tutorial1.cpix print-cpix
cpix_verify: FMP4_400: not well-formed (invalid token) @ line 27 col 0

This is the CPIX file which generates this particular error.

<?xml version="1.0" encoding="utf-8"?>
<CPIX xmlns="urn:dashif:org:cpix"
<cpix:CPIX version="2.3" contentId="test-speke-v2" xmlns:pskc="urn:ietf:params:xml:ns:keyprov:pskc" xmlns:xsi="urn:ietf:params:xml:ns:keyprov:pskc" xmlns:cpix="urn:dashif:org:cpix" xsi:schemaLocation="urn:dashif:org:cpix cpix.xsd">
 <cpix:ContentKeyList>
   <cpix:ContentKey kid="e82f184c-3aaa-57b4-ace8-606b5e3febad" explicitIV="wvr2bihSzExKdR8KKpQf2w==" commonEncryptionScheme="cbcs">
     <cpix:Data>
       <pskc:Secret>
         <pskc:PlainValue>klVRnDxzTrMgCqaZmFG6kw==</pskc:PlainValue>
       </pskc:Secret>
     </cpix:Data>
   </cpix:ContentKey>
   <cpix:ContentKey kid="e82f184c-3aaa-57b4-ace8-606b5e3febad" explicitIV="wvr2bihSzExKdR8KKpQf2w==" commonEncryptionScheme="cbcs">
     <cpix:Data>
       <pskc:Secret>
         <pskc:PlainValue>wvr2bihSzExKdR8KKpQf2w==</pskc:PlainValue>
       </pskc:Secret>
     </cpix:Data>
   </cpix:ContentKey>
 </cpix:ContentKeyList>
     <cpix:URIExt
 669
 XKey>AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABIiCnVzcHd2dGVzdDNI49yVmwY=</cpix:URIExtXKey>
     <cpix:HLSSignalingData playlist="master">
     <cpix:HLSSignalingData playlist="media">
   </cpix:DRMSystem>
 </cpix:DRMSystemList>
 <cpix:ContentKeyPeriodList>
   <cpix:ContentKeyPeriod id="period_0" index="0"></cpix:ContentKeyPeriod>
   <cpix:ContentKeyPeriod id="period_0" index="0"></cpix:ContentKeyPeriod>
 </cpix:ContentKeyPeriodList>
 <cpix:ContentKeyUsageRuleList>
   <cpix:ContentKeyUsageRule kid="e82f184c-3aaa-57b4-ace8-606b5e3febad" intendedTrackType="VIDEO">
     <cpix:VideoFilter></cpix:VideoFilter>
     <cpix:KeyPeriodFilter periodId="period_0"></cpix:KeyPeriodFilter>
   </cpix:ContentKeyUsageRule>
   <cpix:ContentKeyUsageRule kid="4f84f663-acc6-4686-df0f-f41094ae543e" intendedTrackType="AUDIO">
     <cpix:AudioFilter></cpix:AudioFilter>
     <cpix:KeyPeriodFilter periodId="period_0"></cpix:KeyPeriodFilter>
   </cpix:ContentKeyUsageRule>
 </cpix:ContentKeyUsageRuleList>
</CPIX>

The example above shows that there is something wrong on the CPIX file and it is invalid. This causes playback problems on the player side. If you remove "669" from the specified line and fix the "URIExt" configuration, the file will be valid.

Note

Some values of the examples replaced or removed for privacy reasons

The example below shows some missing values in the CPIX file. This example was used for test purposes. However, the CPIX creation script could not replace the PSKC value and caused an incorrect CPIX file creation.

#!/bin/bash

cpix_verify tutorial2.cpix print-cpix
cpix_verify: FMP4_415: Invalid base64 character. parsing aborted @ line 11 col 48
<?xml version="1.0" encoding="utf-8"?>
<CPIX xmlns="urn:dashif:org:cpix"
xsi:schemaLocation="urn:dashif:org:cpix cpix.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:pskc="urn:ietf:params:xml:ns:keyprov:pskc">
<ContentKeyList>
 <ContentKey
   kid="00000000-0000-0000-0000-000000000001">
   <Data>
     <pskc:Secret>
       <pskc:PlainValue>...</pskc:PlainValue>
     </pskc:Secret>
   </Data>
 </ContentKey>
 <ContentKey
   kid="00000000-0000-0000-0000-000000000002">
   <Data>
     <pskc:Secret>
       <pskc:PlainValue>...</pskc:PlainValue>
     </pskc:Secret>
   </Data>
 </ContentKey>
</ContentKeyList>
<DRMSystemList>
 <DRMSystem
   systemId="81376844-F976-481E-A84E-CC25D39B0B33"
   kid="00000000-0000-0000-0000-000000000001">
   <PSSH>...</PSSH>
   <HLSSignalingData>...</HLSSignalingData>
 </DRMSystem>
 </ContentKeyUsageRule>
 <ContentKeyUsageRule
   kid="00000000-0000-0000-0000-000000000002">
   <KeyPeriodFilter
     periodId="keyPeriod_2"/>
  </ContentKeyUsageRule>
 </ContentKeyUsageRuleList>
</CPIX>

The next example generated because of wrongly used PSKC value. A correct usage example would be "wvr2bihSzExKdR8KKpQf2w==".

#!/bin/bash

cpix_verify tutorial3.cpix print-cpix
cpix_verify: FMP4_500: pskc:PlainValue data must be 16 bytes. parsing aborted @ line 7 col 22
<?xml version="1.0" encoding="utf-8"?>

 <CPIX xmlns:pskc="urn:ietf:params:xml:ns:keyprov:pskc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:dashif:org:cpix" xsi:schemaLocation="urn:dashif:org:cpix cpix.xsd">
 <ContentKeyList>
  <ContentKey kid="509f64c4-9828-4b33-9b6f-72afba3680d7">
    <Data>
      <pskc:Secret>
        <pskc:PlainValue>test</pskc:PlainValue>
      </pskc:Secret>
    </Data>
  </ContentKey>
 </ContentKeyList>
 <DRMSystemList>
  <!-- PlayReady -->
  <DRMSystem kid="e82f184c-3aaa-57b4-ace8-606b5e3febad" systemId="9A04F079-9840-4286-AB92-E65BE0885F95">
    <PSSH>nAMAAAEAAQCSAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGU</PSSH>
    <ContentProtectionData />
    <HLSSignalingData />
  </DRMSystem>
  <!-- Widevine -->
  <DRMSystem kid="509f64c4-9828-4b33-9b6f-72afba3680d7" systemId="EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED">
    <PSSH>AAAAXHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADwAAAA8cHNzaAAAAADt74upedZKzqPIJ9zVHSH943ctcVYQeIgZ0ZXN0Xzc=</PSSH>
    <ContentProtectionData />
    <HLSSignalingData />
  </DRMSystem>
  <!-- EME Signalling -->
 </DRMSystemList>
 </CPIX>