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

FHD playback / UHD listing #51

Closed
jgimness opened this issue Dec 6, 2017 · 122 comments
Closed

FHD playback / UHD listing #51

jgimness opened this issue Dec 6, 2017 · 122 comments

Comments

@jgimness
Copy link

jgimness commented Dec 6, 2017

I see a commented out HighDef parameter, is that what enables Ultra HD listings to be retrieved? Any info would be appreciated.

@Sandmann79
Copy link
Owner

No, some years ago this parameter displayed the HD content. To get UHD content listed, you have to use the HideNum=F parameter.
But it makes no sense, because the devicetypeID that is used for playback doesn't support UHD.

@jgimness
Copy link
Author

Thanks for the response. Tried with HideNum=F and no luck. Any other hints? Maybe I need a valid devicetypeID that can actually supports UHD?

@Sandmann79
Copy link
Owner

Maybe for listing it, but not for playback.
You cannot change the playback devicetypeid, that's the only one which is currently working.

@greystashh
Copy link

Are there any news for uhd?

@Varstahl
Copy link
Collaborator

@greystashh some android reverse engineering has probably to be done, but I didn't find the time yet.

@greystashh
Copy link

Have you been able to look at it in the meantime?

@Varstahl
Copy link
Collaborator

Nope, it's still on my list of things to do for the addon but still haven't been able to look into it.

@jgimness
Copy link
Author

Any updates? Just a side note, it looks like instantwatcher (which I believe has partner-level API access) only has 4 items listed as UltraHD (used to be a lot more) https://instantwatcher.com/a/search

@mirh
Copy link

mirh commented Dec 20, 2018

asciidisco/plugin.video.netflix#86 (comment)
https://www.amazon.com/gp/help/customer/display.html?nodeId=201648150
Ideas

EDIT: https://www.amazon.com/gp/help/customer/display.html?nodeId=201460880
this seems to cover way more devices (and even though it's still far from 100% comprehensive, at least it gets near to recognizing my XZ2 can access HDR)

@Varstahl
Copy link
Collaborator

Varstahl commented Dec 20, 2018

Yeah, one of my devices that I was targeting to reverse engineer the 4K video playback is on that amazon's support list. The problem that peak3d is describing is different though: it's not enough to "have" those in the lists, if you can't playback. And you can't reproduce those videos, without a full reverse engineering of the Widevine drm encryptions that is shipped in those devices, which is different from what is publicly available.

Short example: we have support for FHD movies in Amazon VOD, but nothing is able to reproduce them. If we can't playback FHD why bother with UHD?

It sucks, but that's Google for you.

@mirh
Copy link

mirh commented Dec 20, 2018

I thought that was just a matter of various WV levels..

@Varstahl
Copy link
Collaborator

I'm not exactly "in the know", but when I talked with some devs (under NDA) they hinted at the fact that even for PrimeVideo.com, several chromium-based browsers are not able to decode properly videos, even when taking the Widevine straight from Chrome and putting it in the other browser, because along with the the DRM management they would need to ship with particular codecs, that all bundle for a fair amount of millions of dollars.

I admit I never even began reverse engineering my TV's handshake, but from what I understood even if we were to replicate and get both 4K and up to date Widevine from whatever source, chances are it will never ever be rendered to video. FHD decoding can maybe work on Windows 10, if what I heard is correct, but 4K probably won't on any platform.

@mirh
Copy link

mirh commented Dec 23, 2018

Ok, it's true that amazon's streaming "parameters" are bonkers, but for as much as codecs are concerned the only peculiarity should be the usage of H265. End. How could they get hw accelerated otherwise?
Nothing that isn't already handled by inputstream imho.

Then, as I was saying.. I know instead *DRM* is the thing pretty famous to be finicky.


I've spent all day trying to understand what particular kinds Prime Video have been using, but to no definitive avail.
Of course Widevine plays a role... With L3 being the minimum requirement to do *any thing at all*.
But then for some reason, computers can get away with 1080p easily, while on android not even L1 seems to be enough for 720p sometimes (though that could be as well some coarse device model check...).

Proceeding with the analysis, a breadcrumb trail, led me inside the android apk, whose biggest library is literally libAIVPlayReadyLicensing.so.

So, I was almost going to call it a day, they may be using the same super pesky hardware-baked thing of netflix (which in this case they aren't offering on x86, just out of laziness or whatever)
And it would also explain why a lot of android TVs are fine with it - since they are all reportedly required to support it (even though I couldn't find anything in the official documentation... which is really poor in documenting drm)

But I could only find PlayReady SL2000 certificates inside of com.amazon.avod.thirdpartyclient.apk\assets\PlayReady\.... Which is not actually the playready 3.0 I was theorizing about.
... and at that point I realized android TVs uses a completely different application (com.amazon.amazonvideo.livingroom).. Unfortunately protected AF, but that could still cover my hypothesis
....

Until the last blow arrived, when I eventually found out Xperia XZ Premium can actually do 4K with the normal app. On the "normal" android.
And even though its oreo firmware has a vendor\lib\qcdrm\playready\ folder... I know from both drminfo and exoplayer tests on its sibilings sony phones with the same board, that it always was inert.

So... TL;DR I'm back to square one.
FHD anywhere shouldn't be rocket science to be honest anyway.

p.s. when you'll eventually get to look into UHD titles, take also notice they are total asses with their interface/api.

@Varstahl
Copy link
Collaborator

Although I have quite some old expertise in reverse engineering, when it comes to this sort of things I usually go completely platform agnostic and just sniff the living sh*t out of the network transmission through a transparent proxy, and reverse engineer the protocol from there. That's the way I reverse engineered PrimeVideo's everything, and it worked (kind of) okay. Even then, replicating what FireFox and Chrome do to get and decode the streams doesn't let Kodi reproduce videos in the same way. I'm relatively new to Kodi as a whole, so if I had to analyse both Kodi and IS.A's sources it would take me months.

I've been away from the scene from quite a long time, and I especially know nothing of android reversing, so my only bet in this would be to either transparent proxy a TLS connection between my TV and amazon servers hoping that they don't use certificate pinning, or be stuck with about nothing. Which is the reason why I still haven't done anything, as I severely doubt that's going to work. (Because they use pinning, right?)

Anyways, I have a few days off work in front of me, so if you guys have suggestions or attack vectors, or want to set-up a mini reverse engineering collective effort, let me know.

@Varstahl
Copy link
Collaborator

Also, thanks for the additional information, I had no idea that (at least on some platforms) Microsoft's PlayReady 3.0 was used. Which explains why Windows 10 is fucking required to play 4k.

* exhausted sigh *

@mirh
Copy link

mirh commented Dec 23, 2018

That's for netflix though, as I said.
Aside of this specific instance though, I know of no particular "merit" of W10 on anything.
(and, even then, there seems to be plenty of samples floating around for playback, at least under UWP...)

Then, if you want to work on the android app, I know there are plenty of xposed tools that can uncheck/unpin certs on the fly.
But at least for 1080p everything should be already more than doable on x86 alone.

@Varstahl
Copy link
Collaborator

I'll copy my tests out of #224 in here, as it might be useful later on:


After a few tests [with operatingSystemName parameter to catalog/GetPlaybackResources API call, ndr.], selecting anything other than Windows (and a few other written below), with this specific capitalization, reduces the number of videos available for playback. If, for example, we select Linux, it hides all the high movie resolution streams (that are unplayable anyway, in our case), but along with it takes a few of the high resolution TV series that would be playable. Using the Windows parameter, seems to restore all video qualities.

With a bit of data mining, and several tests later, I found the following:

operatingSystemName Max. playable Max. available
Unknown 1088x464
Android 1088x464
BlackBerry 1088x464
Chrome OS 1088x464
Firefox OS 1088x464
Google TV 1088x464
iOS 1088x464
Linux 1088x464
Mac OS X 1088x464 1920x816
Mac OS PPC 1088x464
Windows 1088x464 1920x816
Windows Phone 1088x464
Windows RT 1088x464 1920x816
Xbox One 1088x464

As far as movies go, Mac OS X, Windows and Windows RT have the full 1920 width available, although at least on my Win7 machine, only streams up to 1088x464 were playable. Anything higher would result in audio and a freezed frame. All streams reported as H264.

[…]


I think I noticed it depending on a few parameter combinations, some resolutions are added or removed to the list, but nothing higher than 1088 will ever play. I also noticed that HLS is also supported, but it returns AVC1 encoded videos. IS.A fails with a Could not open / parse mpdURL, uncertain if that's because I might be lacking some specific codecs.

@mirh
Copy link

mirh commented Dec 27, 2018

Seen? It wasn't that hard after all 🙃
(I wonder if hls is what the official applications use then, or if there's still even more to discover)

AVC1's just normal plain H.264 anyway...

@Varstahl
Copy link
Collaborator

Varstahl commented Dec 27, 2018

Seen? It wasn't that hard after all

To do what? Playback still doesn't work. Neither DASH nor HLS, MPD nor M3U8, AVC1 or not plays above 1088x464. And since I'm a complete noob when it comes to video streaming technologies, I have no idea how to analyze the issue.

I've just poked and prodded to solve a different problem, but we're nowhere near where we should be, for the moment.

Edit: ERROR: AddOnLog: InputStream Adaptive: DecodeVideo: kNoKey for key <KEY>
At least now we also have something to relate the problem to.

@jgimness
Copy link
Author

@Varstahl Thanks for your investigation. I'm actually more interested in finding out WHAT is available in UltraHD vs. actually being able to play content in UHD (I'm a data geek). Are you able to get anything out of the API that shows UHD "possible" content? I've tried many device types to no avail ...

@Varstahl
Copy link
Collaborator

The only surefire way is to:
A. Obtain a valid apk and reverse engineer that
B. Find if there's a possibility to sniff the traffic and reverse the protocol (generally this is my preferred route)

I've spent the past 8 hours setting up everything for a MitM attack, and I mostly succeded except for the fact that I came late to the party. Samsung has been bashed for insufficient security, and apprently they now took things ultra safely. I can sniff all the traffic no problem, but when it comes to HTTPS it has a reject by default policy, even in the browser. So, I either find a way to download/modify/sideload browser/amazon apks, or I need a way to inject a root certificate onto my TV.

It's now 4:30 am and I'm tired af, so I'm headed to bed.

Also, to elaborate better:

Are you able to get anything out of the API that shows UHD "possible" content?

Once upon a time @Sandmann79 found a way to do it for amazon.de, but several endpoints behaviour changed dramatically during the last few months. I don't think I can find out UHD streams with what I have at the moment. The only way would be to crack my damn TV open, but as far as the first attempt went, I fell short TLS. I can tcpdump and maybe bruteforce the TLS, but it's quite unrealistic.

Don't know, I'm sad, I'm going to bed.

Also, for added fun: Amazon removed the 4k section even on my freakin' 4k TV, listed as supported even on Amazon's website. Didn't test 4k content though, yet, so don't know about that. But even if I could previously find out of an URL API endpoint to discover 4k streams, now I just can't. Yay.

@Varstahl
Copy link
Collaborator

Interesting, but Samsung 4k TVs run on Tizen. I can develop something for it and load it into the TV, but it's not Android. It's also a minimal distro, with no rooting possible (as of now). Also since I can't tell which are the endpoints for the samsung website, I'm not really able to download the package off the main repository, so even that didn't work out for me yet. Thanks for the reference though, I didn't know of Frida, that's an interesting read.

@mirh
Copy link

mirh commented Jan 9, 2019

XZ premium 4K compatibility broke with Pie, and it seemingly never had playready to begin with. amazon broke compatibility with standard android

So my last, definitive, eventual, guess is just that they are performing stupid server-side checks, and nothing more than L1 should be required.. "high-end-security" wise at least.

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 9, 2019

I can tell you that they are doing a number of client/server side checks. Different codecs, lists, streams, and whatnot may or may not be displayed, and may or may not be served. Even with Widevine no more than L1 should be needed (for tv series at least), except that movies won't go higher than 480p (L3?). And since a lot of the checks and the "device" parameters are server/client side assessed, but in the most obscure way possible, I still can't find a way to wrap my head around the issue.

As far as HD movies go, Chrome is (possibly?) able to unlock the streams (I didn't actually check the stream contents yet so it might just pop up the HD and have a 480p quality, for all I know). But IS.A and most other browsers aren't able to decode them. Multiple Widevine licenses? I have no idea, and every time I see a change on Amazon's backend I die a little.

Hell, I'm even using Vivaldi on a daily basis, which is basically an "Opera" skin on top of the Blink/Webkit, and it still doesn't work. PrimeVideo on Vivaldi only works if you spoof the UA to match Opera, not even Chrome.

I have so many questions, and not enough answers… I just keep hating Amazon every day a little more.

@mirh
Copy link

mirh commented Jan 10, 2019

I get the "HD light" (whatever it might actually entail) on firefox on windows..
And as I reported above, if you spoof enough the user agent, even on android you can basically get the same.

So.. to be honest, now that we solved the 4K "standards" conundrum, I think the only mystery left is why (just like with netflix tbh) 720p/1080p requires L1, while on "desktops" you can get away with the lowest security level

@Varstahl
Copy link
Collaborator

After you said that on Firefox 1080p ran find I got curious and installed a brand new portable version to dedicate to reverse engineering. At a glance, these are my findings:

  • Firefox is using Widevine CDM 4.10.1196.0-win-x64, grabbing it from here: https://redirector.gvt1.com/edgedl/widevine-cdm/4.10.1196.0-win-x64.zip (apparently it's for Edge?);
  • There are new APIs exposed that weren't there in the last two revisions, such as /gp/video/api/storefrontEnrichItems. Might reduce load times dramatically, but I'll have to look deeper at it;
  • Firefox is reportedly showing as supporting 1080p HD streams on Win7 x64. I'm fairly sure that is correct, but I'll double check with the actual stream CDN location.

So, yeah, contrary to popular belief FHD might (could?) actually be obtained under Kodi, unless there's something weird going on with the Widevine library itself.

I'll analyze the handshakes and whatnot, maybe we can sort this out once and for all.

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 10, 2019

Kodi decided to do “The right thing”™, so now I can't debug fucking anything coming out of it. None of the systems they listed to bypass certificate validation works. Fucking geniuses, the lot of them. What am I supposed to do now, revert to Alpha1?

This day started badly and it's gonna end poorly…

Edit: Kodi is now ignoring system CAs and is shipping with a CA bundle inside systems/certs. If you guys need to proxy/bypass, you can put your self signed root CA in there. All values back to nominal.

@Varstahl Varstahl mentioned this issue Feb 19, 2019
@ghoshben
Copy link

ghoshben commented Feb 21, 2019

I did some investigation and the conclution is if the content has HDR as WELL as UHD then adding deviceVideoQualityOverride=UHD&deviceHdrFormatsOverride=Hdr10 will provide 4k UHD HDR minefeast

URL

@Varstahl
Copy link
Collaborator

What the heck, when I tested it a few days ago it was not working. Did they fix it in yesterday's updates? Let me test it.

@ghoshben
Copy link

u can acess UHD using this method if and and only if the content is avalable in both UHD & HDR else it wont work

@Varstahl
Copy link
Collaborator

Varstahl commented Feb 21, 2019

I'd so want to smash my 4k TV open and crack the damn thing down just to figure out what secret juices it holds. It's even using HSTS, I wasn't even able to download the software updates… Btw, I'm testing it on primevideo, so that might be the reason why. Maybe it only works on amazon domains, although it's pretty damn weird.

I've tested it with the First live 4k from space thing, and it does return streams encoded with H265 instead of H264, but that's pretty much it. I wonder if there's a video on primevideo that I can test with.

@ghoshben
Copy link

problem is I dont have a smart 4k tv btw can you pls share your country ? (as 4k library varies with country)

@Varstahl
Copy link
Collaborator

Varstahl commented Feb 21, 2019

Italy, and I do have a 4k TV but not connected to a PC as a monitor, so that also complicates things. Not that it matters, since I've tried shows like fleabag and Bosch which I have SEEN on my TV in 4k, but it won't return the videos for it.

Most of it works with what we knew already:

consumptionType=Streaming
desiredResources=PlaybackUrls,CatalogMetadata
deviceID=<dID>
deviceTypeID=AOAGZA014O5RE
firmware=1
gascEnabled=false
marketplaceID=<mID>
resourceUsage=CacheResources
videoMaterialType=Feature
operatingSystemName=Windows
deviceDrmOverride=CENC
deviceStreamingTechnologyOverride=DASH
deviceProtocolOverride=Https
supportedDRMKeyScheme=DUAL_KEY
deviceBitrateAdaptationsOverride=CVBR,CBR
deviceVideoQualityOverride=UHD
deviceHdrFormatsOverride=Hdr10

I'm unsure if the resourceUsage ImmediateConsumption is valid, since it annihilates my face with a GeoIP restriction.

Edit: HOLY SHIT IT WORKED!

{
    "playbackUrls": {
        "cacheKey": "28be735a-494a-3fa9-b740-f11ce550c769$8YpQPUdepUcDwjIJ0E-pc1DXMKE~",
        "defaultAudioTrackId": "en-us_dialog_0",
        "defaultUrlSetId": "17948-857ca863-e395-492d-8c71-b3208e921a62",
        "urlSets": {
            "17948-12b0a81a-0f15-4ecc-918e-d1370f94f55a": {
                "failover": {
                    "cdn": {
                        "mode": "seamless",
                        "urlSetId": "17948-93d527c0-2c93-41bf-a3cd-908ba99c0d2a"
                    },
                    "default": {
                        "mode": "seamless",
                        "urlSetId": "17948-93d527c0-2c93-41bf-a3cd-908ba99c0d2a"
                    }
                },
                "urlSetId": "17948-12b0a81a-0f15-4ecc-918e-d1370f94f55a",
                "urls": {
                    "manifest": {
                        "audioFormat": "Stereo",
                        "audioTrackId": "ALL",
                        "bitrateAdaption": "CBR",
                        "cdn": "Limelight",
                        "cdnOrigin": "S3",
                        "compressionStandard": "H265",
                        "contiguityType": "Contiguous",
                        "drm": "CENC",
                        "dynamicRange": "Hdr10",
                        "encodingVersion": "0",
                        "fragmentRepresentation": "ByteOffsetRange",
                        "origin": "s3_ww_dub",
                        "streamingTechnology": "DASH",
                        "subtitleRepresentation": "NotInManifestNorStream",
                        "url": "https://s3.ll.dash.row.aiv-cdn.net/d/2$8YpQPUdepUcDwjIJ0E-pc1DXMKE~/ww_dub/05bc/f1a0/6b38/4759-bfed-954d4cd90b3c/088179b4-3cec-49ad-87c7-2a9496f6f469_corrected.mpd",
                        "videoQuality": "UHD"
                    }
                }
            },
            "17948-1f52f2ff-9924-43cb-bf1c-38a3900066f5": {
                "failover": {
                    "cdn": {
                        "mode": "seamless",
                        "urlSetId": "17948-12b0a81a-0f15-4ecc-918e-d1370f94f55a"
                    },
                    "default": {
                        "mode": "seamless",
                        "urlSetId": "17948-12b0a81a-0f15-4ecc-918e-d1370f94f55a"
                    }
                },
                "urlSetId": "17948-1f52f2ff-9924-43cb-bf1c-38a3900066f5",
                "urls": {
                    "manifest": {
                        "audioFormat": "Stereo",
                        "audioTrackId": "ALL",
                        "bitrateAdaption": "CBR",
                        "cdn": "Level3",
                        "cdnOrigin": "S3",
                        "compressionStandard": "H265",
                        "contiguityType": "Contiguous",
                        "drm": "CENC",
                        "dynamicRange": "Hdr10",
                        "encodingVersion": "0",
                        "fragmentRepresentation": "ByteOffsetRange",
                        "origin": "s3_ww_dub",
                        "streamingTechnology": "DASH",
                        "subtitleRepresentation": "NotInManifestNorStream",
                        "url": "https://11s3.lvlt.dash.row.aiv-cdn.net/d/2$8YpQPUdepUcDwjIJ0E-pc1DXMKE~/prod/ww_dub/05bc/f1a0/6b38/4759-bfed-954d4cd90b3c/088179b4-3cec-49ad-87c7-2a9496f6f469_corrected.mpd",
                        "videoQuality": "UHD"
                    }
                }
            },
            "17948-857ca863-e395-492d-8c71-b3208e921a62": {
                "failover": {
                    "cdn": {
                        "mode": "seamless",
                        "urlSetId": "17948-1f52f2ff-9924-43cb-bf1c-38a3900066f5"
                    },
                    "default": {
                        "mode": "seamless",
                        "urlSetId": "17948-1f52f2ff-9924-43cb-bf1c-38a3900066f5"
                    }
                },
                "urlSetId": "17948-857ca863-e395-492d-8c71-b3208e921a62",
                "urls": {
                    "manifest": {
                        "audioFormat": "Stereo",
                        "audioTrackId": "ALL",
                        "bitrateAdaption": "CBR",
                        "cdn": "Cloudfront",
                        "cdnOrigin": "S3",
                        "compressionStandard": "H265",
                        "contiguityType": "Contiguous",
                        "drm": "CENC",
                        "dynamicRange": "Hdr10",
                        "encodingVersion": "0",
                        "fragmentRepresentation": "ByteOffsetRange",
                        "origin": "s3_dub_2",
                        "streamingTechnology": "DASH",
                        "subtitleRepresentation": "NotInManifestNorStream",
                        "url": "https://s3-dub-2.cf.dash.row.aiv-cdn.net/dm/2$8YpQPUdepUcDwjIJ0E-pc1DXMKE~/05bc/f1a0/6b38/4759-bfed-954d4cd90b3c/088179b4-3cec-49ad-87c7-2a9496f6f469_corrected.mpd",
                        "videoQuality": "UHD"
                    }
                }
            },
            "17948-93d527c0-2c93-41bf-a3cd-908ba99c0d2a": {
                "failover": {
                    "default": {
                        "mode": "seamless",
                        "urlSetId": "17948-857ca863-e395-492d-8c71-b3208e921a62"
                    }
                },
                "urlSetId": "17948-93d527c0-2c93-41bf-a3cd-908ba99c0d2a",
                "urls": {
                    "manifest": {
                        "audioFormat": "Stereo",
                        "audioTrackId": "ALL",
                        "bitrateAdaption": "CBR",
                        "cdn": "Akamai",
                        "cdnOrigin": "S3",
                        "compressionStandard": "H265",
                        "contiguityType": "Contiguous",
                        "drm": "CENC",
                        "dynamicRange": "Hdr10",
                        "encodingVersion": "0",
                        "fragmentRepresentation": "ByteOffsetRange",
                        "origin": "s3_ww_dub",
                        "streamingTechnology": "DASH",
                        "subtitleRepresentation": "NotInManifestNorStream",
                        "url": "https://a310avoddashs3ww-a.akamaihd.net/d/2$8YpQPUdepUcDwjIJ0E-pc1DXMKE~/ondemand/ww_dub/05bc/f1a0/6b38/4759-bfed-954d4cd90b3c/088179b4-3cec-49ad-87c7-2a9496f6f469_corrected.mpd",
                        "videoQuality": "UHD"
                    }
                }
            }
        }
    },
    "returnedTitleRendition": {
        "asin": "amzn1.dv.gti.18ab0769-016b-f1b4-90ce-4a5dc75848cf",
        "audioQuality": "Stereo",
        "audioTrackId": "all",
        "contentId": "amzn1.dv.vcid.4755b8af-941a-4c46-b5fb-5798db9c7c0d",
        "selectedEntitlement": {
            "consumptionExpiration": "1551044311958",
            "entitlementType": "PRIME_SUBSCRIPTION",
            "grantedByCustomerId": "A1825HE0SZD6UY"
        },
        "titleId": "amzn1.dv.gti.18ab0769-016b-f1b4-90ce-4a5dc75848cf",
        "videoMaterialType": "Feature",
        "videoQuality": "HD"
    },
}

@ghoshben
Copy link

yup but some content doesnot have hdr 10 but has UHD in my country and so till now I am unable to find a way to get them

@Varstahl
Copy link
Collaborator

Interesting, it's all bullshit. Aside the fact that it's impossible to playback, and even lower quality streams are unreachable, the MPD contains no UHD whatsoever. Nope, I'm not going down this rabbit hole again, You probably need some Samsung specific device ID to unlock the 4k, but then again if you don't have the hardware encryption it won't work anyway. No clue, but I'm out. Thanks for the info though, it was exciting while it lasted :D

@ghoshben
Copy link

no the mpd itself has 4k content but does not showes it for example

https://s3-dub-2.cf.dash.row.aiv-cdn.net/dm/2$8YpQPUdepUcDwjIJ0E-pc1DXMKE~/05bc/f1a0/6b38/4759-bfed-954d4cd90b3c/088179b4-3cec-49ad-87c7-2a9496f6f469_video_13.mp4

^ is the 4k stream but it is not listed in the mpd

@ghoshben
Copy link

the mpd has upto video_10.mp4 now for 4k but if u incement the value to 10 until u get a resposnde code error

@Varstahl
Copy link
Collaborator

Varstahl commented Feb 21, 2019

no the mpd itself has 4k content but does not shows

Well, if it does not show it then it doesn't have it. Although come to think about it, there might be good reason why: it might actually be encrypted with something else.

But when you're right, you're right:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '088179b4-3cec-49ad-87c7-2a9496f6f469_video_13.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6dash
  Duration: 00:47:09.83, bitrate: 815 kb/s
    Stream #0:0(und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 815 kb/s, 23.98 fps, 23.98 tbr, 120k tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : USP Video Handler
      encoder         : HEVC Coding

But, if that's the case, then we don't actually need the parameter. We can just ping the h*eck out of the video streams until we find the 4k ones. Fun times.

@ghoshben
Copy link

no the mpd itself has 4k content but does not shows

Well, if it does not show it then it doesn't have it. Although come to think about it, there might be good reason why: it might actually be encrypted with something else.

But when you're right, you're right:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '088179b4-3cec-49ad-87c7-2a9496f6f469_video_13.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6dash
  Duration: 00:47:09.83, bitrate: 815 kb/s
    Stream #0:0(und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 815 kb/s, 23.98 fps, 23.98 tbr, 120k tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : USP Video Handler
      encoder         : HEVC Coding

But, if that's the case, then we don't actually need the parameter. We can just ping the h*eck out of the video streams until we find the 4k ones. Fun times.

nope as they store the 4k one in different cdn location so just by incrementing the value without changing the paramiter wont be helpful I think

@ghoshben
Copy link

by the way as I dont have any physical device can u please send me the your the dump of your android tv profile ? so that I can test it pls ?

@Varstahl
Copy link
Collaborator

It's not Android it's… Tizen? And I wish I could, I can't access the damn thing. I wanted to test developing some exploit for it, since I have the SDK, but I had a severe lack of time. I've also downloaded the entire video but it doesn't look much usable to me, pretty standard.

Oh, and yes, I double checked, they actually have them on different shards, so yeah the pinging route's stupid.

I'll be going for the day. If you find some juicy information, I'm all ears.

@ghoshben
Copy link

Format                                   : dash
Commercial name                          : HDR10
Codec ID                                 : dash (iso6/dash)
File size                                : 4.85 GiB
Duration                                 : 47 min 9 s
Overall bit rate                         : 14.7 Mb/s

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Commercial name                          : HDR10
Format profile                           : Main 10@L5@Main
Codec ID                                 : encv / hev1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 47 min 9 s
Bit rate                                 : 14.7 Mb/s
Maximum bit rate                         : 25.1 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.074
Stream size                              : 4.85 GiB (100%)
Default                                  : Yes
Alternate group                          : 1
Encryption                               : Encrypted
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 211 cd/m2
Maximum Frame-Average Light Level        : 125 cd/m2


@ghoshben
Copy link

and The mpd contained 4k stream. may be tomorrow I ll try to do some reverse engineering on their android tv app.

@aers
Copy link

aers commented Feb 21, 2019

android tv amazon (nvidia shield specifically) uses playready for 4K and gets smoothstreaming manifests (ISM), not dash MPDs

as far as i'm aware only 4K HDR is available via DASH, as you've seen above.

@mirh
Copy link

mirh commented Feb 21, 2019

It must be said, at least until some month ago, 4K also worked on Xperia Premium phones with normal android (which have no playready by default.. not sure how much high of a SL level you could go, with tz payloads shipped with your app though)

But aside of that, could we not get FHD first to work perhaps?
Don't want to nag you guys.

@Varstahl
Copy link
Collaborator

could we not get FHD first to work perhaps?

Playing FHD requires HDCP, which is a bit more complicated than "we found 4k streams". I haven't given up on it, but I didn't have time to delve deeper either.

@Varstahl
Copy link
Collaborator

Closing this as the discussion has gone stale by now. 4k videos are available everywhere from PrimeVideo (or closely so), and PC reproduction is locked by VMP.

@matejdro
Copy link

matejdro commented Jan 1, 2021

@Varstahl What exactly do you mean by "4k videos are available everywhere from PrimeVideo". Does that mean that this addon can play 4K now (on Widewine L1 hardware such as Android TV boxes)? Is there any info on which devices are supported?

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 1, 2021

As far as I know, back in the day 4k streams were working on things such as the Nvidia Shield. There have been restrictions due to VMP, but through the launch of external native players, 4k streams are (were?) known to work. On IS.A, that's a different matter entirely, I'm waiting for some news in that regard, but until that point I can't really do much more than speculate.

Be mindful of the fact that this is all hearsay at the moment: I don't have any L1 hardware to properly test 4k streams with, so take these info with a grain of salt.

@matejdro
Copy link

matejdro commented Jan 2, 2021

launch of external native players

Wait does that mean that you launch actual native amazon app instead of using Kodi player? That is a bit of a bummer, primary reason for me using the Kodi is the superior player.

Thanks for your anwers.

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 2, 2021

That depends. Reports you can find even on here (back in the day) were citing the "HDCP Bypass" in IS.A was enough on some hardware to just allow full playback, up to 4k. Now, after Amazon+Google heavily restricted 4k access, in a move to save bandwidth, I think that playing 4k through Kodi no longer works. This might be changing soon, though I can't say more at this time.

@NikilRagav
Copy link

I would love to see this work. I have a Windows laptop with HDR screen, so would love to get Prime 4k.

How can I help? Is the problem that there's no widevine for Windows? (and no widevine for Kodi)

Repository owner deleted a comment from Mavrick007 Nov 19, 2021
Repository owner locked as too heated and limited conversation to collaborators Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants