Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with appletv+ streams (HLS/SAMPLE-AES (CBC)/WIDEVINE) #425

Open
glennguy opened this issue Apr 17, 2020 · 3 comments
Open

Issues with appletv+ streams (HLS/SAMPLE-AES (CBC)/WIDEVINE) #425

glennguy opened this issue Apr 17, 2020 · 3 comments

Comments

@glennguy
Copy link
Contributor

glennguy commented Apr 17, 2020

Hi @peak3d

There is finally a request for help with SAMPLE-AES that isn't fairplay only!

@matthuisman and I have been trying over the last couple of days to debug why these won't work, and we've hit a bit of a dead end but have a lot to share in order to help you find a solution and thought it might be best to gather all related information in one issue.

I'll get Matt to email you a sample addon/strm file and how to get up and running with it.

We're working off the hlskid branch btw, allowing SAMPLE-AES as a valid method in HLSTree.cpp

The issues so far:

  1. Our research indicates that SAMPLE-AES is likely indicating CBC rather than CTR AES method. The playready header includes this: <KID ALGID="AESCBC" VALUE="AAAAAOYDRndjMiAgICAgIA=="></KID> Changing the 3 instances of kCenc to KCbcs in wvdecrypter didn't yield a positive result, although it does break decryption for cenc streams.

  2. Licensing mechanism. Repeated calls to the license server will end up returning a json payload with no license. We've found that when stopping the stream in the web browser, a challenge is made to the server but the json payload sent has "license-action": "STOP" instead of "START". Presumably this is to limit concurrent streams. Waiting 5 minutes or so seems to alleviate this but is there scope to contact the license server when stopping playback?

  3. There are crashes happening when playing video+audio. Unlike with Disney+ the audio streams are also encrypted. I've done my best to debug (which is extremely painful due to anti-debug in widevinecdm 😄 ) and found the crash is happening because of https://github.com/peak3d/inputstream.adaptive/blob/hlskid/src/main.cpp#L2359. RemovePSSHSet is removing the representation that is pointed to by adaptiveTree_->current_representation_ - perhaps we need to do a select_stream after this? Setting media in the settings to video only works around the crash in our test stream. The root cause of this issue however may come back to setting the pssh type to NOTYPE in HLSTree.cpp. fixed in [HLS] set pssh media type for widevine #424

As always thanks for your time and effort in maintaining this ever growing project!

Log with manual streams media=all:
kodi.txt

Screenshot:
Screenshot

@matthuisman
Copy link
Contributor

matthuisman commented Apr 17, 2020

@peak3d
My pull request here:
#434
will allow SAMPLE-AES to pass if it's got the Widevine KEYFORMAT
(Well actually it lets everything pass as the behavior changed to only look for compatible)

@matthuisman
Copy link
Contributor

@peak3d
Let me know when your ready for a test strm :)

@yoshimo
Copy link

yoshimo commented Jun 14, 2020

after #461 can we mark the first part of the issue as solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants