xbmc / inputstream.adaptive

kodi inputstream addon for several manifest types
Other
454 stars 242 forks source link

Playback stop after few seconds #952

Closed Vikassm73 closed 1 year ago

Vikassm73 commented 2 years ago

When I try to play below file, it played but stop after few seconds. Please advise.

test.strm.txt

CastagnaIT commented 2 years ago

please attach the mpd manifest it cannot be downloaded

CastagnaIT commented 2 years ago

and ofc also a full kodi debug log

Vikassm73 commented 2 years ago

It's possible that this URL isn't supported outside of India, which is why you couldn't download the manifest. Surprisingly, if Input Stream is set to Manual Mode instead than Automatic, it works flawlessly. However, the problem persists in the other streams.

Debug Log

https://paste.kodi.tv/ahoxirelix.kodi

Manifest

(https://paste.kodi.tv/caciraciko)

glennguy commented 2 years ago

Thanks for the log and manifest

You can see the keys arrive:

2022-04-29 09:35:25.746 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: CDMMessage: 2 arrived!
2022-04-29 09:35:25.748 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: Sessionkey:A1A8E1B7CD2756D889A3674484AB96E3 status: 0 syscode: 0
2022-04-29 09:35:25.748 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: CDMMessage: 3 arrived!
2022-04-29 09:35:25.748 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: Sessionkey:EEFF4043519558F9B06139D77A094649 status: 0 syscode: 0
2022-04-29 09:35:25.748 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: CDMMessage: 3 arrived!
2022-04-29 09:35:25.756 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: License update successful
2022-04-29 09:35:25.791 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: DecryptSampleData: Decrypt failed with error: 2 and key: EEFF4043519558F9B06139D77A094649
2022-04-29 09:35:25.791 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: Initializing stream with KID: C9B9AF00BB365C4FA58499F1ADBDA9B3
2022-04-29 09:35:25.941 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: CDMMessage: 1 arrived!
2022-04-29 09:35:25.941 T:7156    DEBUG <general>: AddOnLog: inputstream.adaptive: SetSession: opened session with Id: 73C671E7AFCC06CFA1D8557925EB7660

Importantly the key didn't arrive for the stream we're trying to start: 2022-04-29 09:35:25.791 T:7156 DEBUG <general>: AddOnLog: inputstream.adaptive: Initializing stream with KID: C9B9AF00BB365C4FA58499F1ADBDA9B3

In the manifest you can see the key ids - Audio is A1A8.... streams up to 480p are EEFF... and 720p/1080p are C9B9... When selecting manual streams the quality usually defaults to the first/lowest stream, so playback is fine.

You'll find that it will play 720p/1080p fine on an L1 certified Android device, but other platforms not likely.

Is there a way you're able to request a manifest that doesn't have these L1 streams?

Vikassm73 commented 2 years ago

Unfortunately, I am only receiving one MPD link. The other option is to use the HLS link, which works perfectly. HD isn't working in HLS either (May be it is available for premium user). In HLS, 480p is automatically picked and played, however this is not the case with MPD links.

Anyway, thank you for your assistance.

CastagnaIT commented 2 years ago

just to let you know I think your case may fall within the use case of limiting resolutions that can be done by add X-Limit-Video header in the license http response, but you need to implement a proxy in your addon (to take ownership of make the license request instead of ISA)

see how to here: https://github.com/xbmc/inputstream.adaptive/wiki/Resolution-limits-for-playable-streams

in this way if your theory is correct, if you are able to know in some way if the account is basic or premium you can add X-Limit-Video header when needed so non-playable resolutions will be removed

Vikassm73 commented 2 years ago

I was wrong about HD content which is available for non premium users also. In android, same issue.

there is another example of Live channel which is not working at all. Tested in windows as well as Linux.

Manifest

https://paste.kodi.tv/ozarusixit

Kodi Log

https://paste.kodi.tv/cegujetivi.kodi

CastagnaIT commented 2 years ago

@glennguy maybe im wrong but i wondering this here we have encrypted audio/video its possible that since all the pssh's are the same, we add only the first one pssh in psshSets_ , then will result that we create only a single drm session, and then we initialize only the "first" stream KID and all others are skipped?

glennguy commented 2 years ago

The problem in the last manifest posted is in the log there's no keyids given by the CDM that match the one in the manifest...

Vikassm73 commented 2 years ago

just to let you know I think your case may fall within the use case of limiting resolutions that can be done by add X-Limit-Video header in the license http response, but you need to implement a proxy in your addon (to take ownership of make the license request instead of ISA)

see how to here: https://github.com/xbmc/inputstream.adaptive/wiki/Resolution-limits-for-playable-streams

in this way if your theory is correct, if you are able to know in some way if the account is basic or premium you can add X-Limit-Video header when needed so non-playable resolutions will be removed

Instead of this, I have set bandwidth using "inputstream.adaptive.max_bandwidth" and it works.

Vikassm73 commented 1 year ago

Here is another Example

Link (Only work with Indian VPN): https://www.jiocinema.com/watch/movies/badlapur/0/0/536f38c0564c11e68ab857b70042686d/0/0

Manifest: https://paste.kodi.tv/otidalobak

Kodi Log: https://paste.kodi.tv/besizoyuti.kodi

glennguy commented 1 year ago
2023-01-31 14:41:48.620 T:22868   ERROR <general>: CCurlFile::FillBuffer - Failed: HTTP returned error 419
2023-01-31 14:41:48.620 T:22868   ERROR <general>: CCurlFile::Open failed with code 419 for https://prod.media.jio.com/proxy?video_id=2000000720&jct=qqhBG4ibnCXmhDB8QgBSDQ&pxe=1675158109&st=2e04e6854c612bdee519562c956049ca:

2023-01-31 14:41:48.620 T:22868   ERROR <general>: AddOnLog: inputstream.adaptive: License server returned failure

You'll need to figure out how to make the correct request that returns a 200 response.

With the other streams/logs posted last year, there must be a different license request that will return all keys and not just the <=480p ones. See if you can capture/recreate a request from the web or mobile app where it does play these streams.

Vikassm73 commented 1 year ago

See another log. All stream works with the settings 'inputstream.adaptive.max_bandwidth': '1000000'

https://paste.kodi.tv/gulejayemi.kodi

glennguy commented 1 year ago

Thanks

Again:

there must be a different license request that will return all keys and not just the <=480p ones. See if you can capture/recreate a request from the web or mobile app where it does play these streams.

Until you can make a license request that returns the keys needed to play the high resolution streams, it will not be able to decode them. You'll need to figure this out because you have access to the service and knowledge of how to access it, we don't unfortunately. We can't help on this one.

It's entirely possible that the service provider does it's own client-side work to limit which streams are exposed to it's player, depending on some conditions such as platform. If that's the case then you'd need to mirror that in your add-on.