kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2.01k stars 440 forks source link

MSS with PlayReady failed for playback #1323

Open weiyuefei opened 3 years ago

weiyuefei commented 3 years ago

Hello erankor,

I am trying to launch MSS with PlayReady. Below is example of pssh which we are using for nginx: [{"key_id":"q8yUfHUiz3/e/7minaMSBw==","key":"vf7a4JEcCjkee9I0pAxnqw==","pssh":[{"data":"BAIAAAEAAQD6ATwAVwBSAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AFYAawBKACsASABNAFkAYgBuADAASQBJADIATQBFAEcARgBGAEcAdQBJAFEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4ATABjAFEAdAB1AG0AVwBzAE8AUgAwAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A","uuid":"9a04f079-9840-4286-ab92-e65be0885f95"}]}]

But when I am trying to play it in https://testweb.playready.microsoft.com/Tool/PlayerHAS, it just downloaded the manifest, but never call license server. Could you please help to determine an issue?

There is protection node from manifest: <Protection><ProtectionHeader SystemID="9a04f079-9840-4286-ab92-e65be0885f95">BAIAAAEAAQD6ATwAVwBSAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AFYAawBKACsASABNAFkAYgBuADAASQBJADIATQBFAEcARgBGAEcAdQBJAFEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4ATABjAFEAdAB1AG0AVwBzAE8AUgAwAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A</ProtectionHeader> </Protection>

There is MSS with PlayReady stream: https://uat.multidrm.tv/bunny/sample.mp4/manifest

The LA_URL is as follows: https://uat.multidrm.tv/RightsManager.asmx?cfg=(kid:abcc947c7522cf7fdeffb9a29da31207,contentkey:vf7a4JEcCjkee9I0pAxnqw==,maxres:1920x1080)

Thanks Feeman

erankor commented 3 years ago

The data inside your PSSH is -

<WRHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="4.0.0.0"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>VkJ+HMYbn0II2MEGFFGuIQ==</KID><CHECKSUM>LcQtumWsOR0=</CHECKSUM></DATA></WRMHEADER>

Notice the WRHEADER instead of WRMHEADER, this is not a valid XML. Other than that, in the XMLs we use, we also return LA_URL & LUI_URL, don't know if these are mandatory or not...

weiyuefei commented 3 years ago

Yes, my mistake, thanks for pointing out, and I have corrected it.

After correnting it, the player successfully calls the license server, and also download the segments, but still failed to play. I am not sure where is the root cause. Could you please help to determine this?

And the following URLs are available: Playback URL: https://uat.multidrm.tv/bunny/sample.mp4/manifest LA_URL: https://uat.multidrm.tv/RightsManager.asmx?cfg=(kid:abcc947c7522cf7fdeffb9a29da31207,contentkey:vf7a4JEcCjkee9I0pAxnqw==,maxres:1920x1080)

And I use the Microsoft test player for playback: https://testweb.playready.microsoft.com/Tool/PlayerHAS

BTW: LA_URL & LUI_URL, are not mandatory.

erankor commented 3 years ago

Another possible issue is that the kid you passed inside the PSSH doesn't match the kid_id field in the JSON, but not sure it makes any difference for MSS PlayReady... You can try to play with the byte order of the key id - in some cases the key id is treated as a guid (dword-word-word-bytes) and in some cases as a binary string. So you may need to flip the byte order in the dword/words, I remember we had this issue at some point... In general, with DRM it's very problematic to understand why it doesn't work... you can try to find some sample stream that does play, and compare to it very carefully.

weiyuefei commented 3 years ago

Hi erankor,

Thanks a lot for your advise, and I will follow your advise trying more tests. I will give feedback here on any results.