Sandmann79 / xbmc

Prime Video Addon for Kodi Media Center
https://forum.kodi.tv/showthread.php?tid=349255
GNU General Public License v3.0
760 stars 191 forks source link

FHD playback / UHD listing #51

Closed jgimness closed 4 years ago

jgimness commented 6 years ago

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

Varstahl commented 5 years ago

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 commented 5 years ago

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

Varstahl commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago
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 commented 5 years ago

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

aers commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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)