4K content seems to play only in 1080p resolution.
Addon used
- [x] Amazon VOD (plugin.video.amazon-test)
- [ ] Browser Launcher (plugin.program.browser.launcher)
- Addon version: latest
Account type IT
- [x] primevideo.com
- [ ] amazon.(com/co.uk/de/jp)
System Setup (please provide the following information):
- Hardware:MiTV P1 43"
- OS version: Android 10
- Kodi version number: 19.3
Upload Logs
Describe the bug
When I play 4K Prime Video content, the player's infos on Settings/Video displays a resolution of 1920x1080 max. This is greyed out, so I can't change it. I enabled the "Use android app for 4K videos" option.
Same issue here, on a Fire TV Max and Kodi 19.3. The option "Use android app for 4K videos" is enabled, so that's the weid thing I guess... Prime Video app is installed. Also, I don't quite understand the issue with 4K content. I get the issues with InputStream, but other addons for Kodi (like for Netflix and Disney+) plays 4K and HDR without issues...
Maybe the option "Use android app for 4K videos" does not work on certain OSs? Or is it that the 4K content is not properly labeled and therefore the addon just doesn't know that it actually IS 4K?
Thanks in advance.
No, it's literally out of our hands. Netflix has laxer requirements, Amazon and Google played together to set the restrictions as far up as they could go, in an attempt for Amazon to also reduce the people that could stream in 4K, reduce bandwidth throughput and save money.
The restrictions are in Widevine settings, where to playback 4K content you need a pipeline certified by Google. So, on official android devices with inbuilt hardware decryption capabilities, through the android app you can enjoy the full 4K. This wasn't always the case.
On devices such as Nvidia Shield, it used to be enough just to enable Kodi's InputStream option "Enable HDCP override", and you could watch everything up to 4K with ease. On PCs, you could watch TV Series up to 1080p. Now, on PCs, you can't even get a 720p stream.
It sucks, but that's just what it is, we have no control over it.
Ok. I get that, but I turned to Kodi and the Prime Video add on for a while, cos paradoxically my Prime Video Android TV app wouldn't play 4K content correctly. Only in 720p and 1080p HDR and stereo audio. Until I discovered that if I use Chromecast built-in everything is fine. Almost the same problem happens with the Disney Plus ATV app (only stereo audio). Netflix is fine, though. How's that?!
Widevine is a set of possile restrictions, not equal across platforms. Netflix is pretty lax, compared to others. Disney+ might have restricted more their settings just like Amazon, so maybe the android tv app is android but not certified by google or old enough to have their privileges stripped. Not all androids are equal, especially post-Trump. Which sucks to no end.
It's still boggles my mind to see how many problems are there in regard to properly and officially support Google's DRM, compared to how easy it is to break the DRM and decrypt everything, even on PC. That's one of the reasons I stopped investing so much time in the project, since they keep making their platform worse by the day. It's stupid, but it is what it is.
My ATV is a Xiaomi Mi TV P1 equipped with Android Google TV 10. I contacted both Xiaomi support and Prime Video support. The first was pretty awkward. The latter opened a ticket for their IT guys to look into the issue, but never heard from them since.
I get all the issues with Widevine/Android/Amazon/Google and whatever but again, sorry for the insistence but as I asked in my previous message, ¿what's with the "Use android app for 4K videos" addon option? Any explanation on why is not working?
Thanks.
Any explanation on why is not working?
I can't give you any definitive answer, there's too many variables we don't control. The most likely cause it's that you're on a chinese TV Box outside of the google certification program, and that it stopped working after the DRM restrictions were put in place. I'm fairly sure that it'd work fine on a Chromecast/Firestick or similar hardware.
I haven't follow all the DRM updates by Amazon as of late so I'm not up to speed, I don't know if there were further restrictions put in place.
Any explanation on why is not working?
I can't give you any definitive answer, there's too many variables we don't control. The most likely cause it's that you're on a chinese TV Box outside of the google certification program, and that it stopped working after the DRM restrictions were put in place. I'm fairly sure that it'd work fine on a Chromecast/Firestick or similar hardware.
I haven't follow all the DRM updates by Amazon as of late so I'm not up to speed, I don't know if there were further restrictions put in place.
I'm afraid I'm using genuine Fire Stick TV Max 4K, so it's unlikely it's not certified. With amazon app I get 4K, with kodi and addon I don't, I get that, DRM stuff, what I don't get is the "Use android app for 4K videos" option not working, UNLESS the addon doesn't actually know the content is available in 4K.
iirc passing the stream to the app makes the app handle everything, including 4k and surround, we don't (shouldn't) do anything more than just point them at a movie/episode and tell them "play it, do your thing". It'd need to be looked into and see if there's anything wrong, possibly.
I have no idea how the addon or widevine handling works internally, but I can say that, for example, with the netflix addon, I can see videos tagged with 4K, dolby... before playing. I don't see 4K tags with the amazon addon, that's why something that comes to my mind is that maybe the addon doesn't know that a video is 4K and therefore should be redirected to the official app. Does this make sense?
Yes, we don't tag every video specifically, that's something the addon could do manually to tell the user such. I don't think it makes a different to the other app, I'd need to get my hands on a chromecast/firestick to know for sure.
https://bugzilla.mozilla.org/show_bug.cgi?id=1720590 Just for the records, it seems like different movies can also have different drm requirements.
iirc all videos on PrimeVideo support both PlayReady and Widevine. Also, if my memory serves me right, someone was trying to possibly support PlayReady into IS.A, and I was also to look into the DRM support myself.
But alas, covid struck, major changes happened, and I lost a lot of my free time.
I wrote a barebones plugin that uses the endpoints for the android app instead of the ones for a browser. With that plugin, UHD playback works fine on an Android device with Widevine L1 (NVIDIA Shield in my case). Even HDR and Dolby Vision work.
https://github.com/StollD/plugin.video.tmsp-amazon
However, there are some serious caveats:
- The plugin is useless for most people, because there is no GUI. You need to synthesize STRM files to use it.
- It doesn't work at all on a PC (linux in my case), not even in SD. The amazon server rejects the Widevine challenge.
- The login flow is a bit more involved, as the android endpoints don't accept cookies, instead they require an OAuth token. The process is kinda obscure and not documented at all. Thankfully, there are enough reverse engineered projects available on GitHub that I could adapt and learn from.
I originally wanted to implement this into this plugin directly, but I was kinda overwhelmed and didn't even know where to start (never written a Kodi python addon before). So I went for a new, much smaller plugin, in the hope that it might give anyone who knows more about this plugin an idea for how to integrate it properly.
That looks very interesting. I tried the android api a few years ago, but could never generate any hash code. But first logging in via the web and then registering the android device is brilliant if it works like that. This should also make it possible to generate the Atza token and enable playback on all devices.
Big thanks for your work
edit: oh overread the assoc_handle. So maybe it won't work. But test it ASAP.
I am not sure if the normal login returns what you need to create a device. That API needs an authorization code, and I think you can only get that by logging in with the OAuth URL that the plugin generates.
However, registering a device can also return the cookies for website login. So it could be possible to replace the whole web login flow with the OAuth version. The key seems to be getting a device ID that amazon associates with the deviceType ID for the android app, that seems to be the biggest step towards getting the UHD streams.
I also managed to somewhat fix my plugin on PCs, by locking the stream quality to SD (which should be the same behaviour as in this plugin, because the parameter is not used here, and it defaults to SD). Now the Amazon server correctly answers the license request from IS.A, but IS.A fails to decrypt anything (Spamming DecodeVideo: kNoKey for key). Playback from this plugin works fine, so I have really no idea whats going on there. Maybe Amazon returns an android specific license?
I just pushed another set of changes to my repo that enable browser based playback (using cookie authentification) for PC. With that change, videos play back fine for me. So the issue probably was that Amazon returns an android specific license if you do the request with the android deviceTypeId.
The nice thing is that the differences between the request for UHD on Android, and the request for SD on PC are minimal. The only differences are the different deviceTypeId, the value of deviceVideoQualityOverride, and the authentification (cookie vs oauth). Other than that, its all the same.
Hi StollD I tried your addon it works, well job. Could it be that you can only log in if you have enabled 2-factor authentication on amazon? (With me it was so) I have only tried to play 2 video in 4k and both only 1080p was selected but when I switch inputstream to manual I can select 4k. Does this work well for you?
Could it be that you can only log in if you have enabled 2-factor authentication on amazon? (With me it was so)
Possible. I have 2FA enabled, and didnt want to disable it, so I only tested that.
I have only tried to play 2 video in 4k and both only 1080p was selected but when I switch inputstream to manual I can select 4k. Does this work well for you?
For me, the highest resolution is selected automatically. But I am running a Kodi Nexus build, where IS.A has adaptive bitrate switching, so the logic for selection is different. On Matrix, it seems to just go by which stream has the highest bitrate. What title are you trying to play (so I can check the manifest)?
It fits. I also use Nexus, I think it had something to do with my internet speed. If I set Min Bandwidth in inputstream to a high value it works without problems.