Closed JCalvi closed 1 year ago
Croneter, here are my working mods to get HDR10 , HLG and Dolbyvision tag Plex>Kodi.
video.py Lines 538-548
for videotrack in streamdetails['video']:
self.cursor.execute('''
INSERT OR REPLACE INTO streamdetails(
idFile, iStreamType, strVideoCodec, fVideoAspect,
iVideoWidth, iVideoHeight, iVideoDuration ,strStereoMode, strHdrType)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
''', (fileid, 0, videotrack['codec'],
videotrack['aspect'], videotrack['width'],
videotrack['height'], runtime,
videotrack['video3DFormat'],
videotrack['hdr']))
media.py lines 175-183* (Refer post below as bt2020 check not required)
track['video3DFormat'] = None
colorTrc = stream.get('colorTrc',"").lower()
colorPrimaries = stream.get('colorPrimaries',"").lower()
if "smpte2084" in colorTrc:
track['hdr'] = "hdr10"
elif "arib-std-b67" in colorTrc:
track['hdr'] = "hlg"
elif "bt2020" in colorPrimaries:
track['hdr'] = "hdr10"
else:
track['hdr'] = None
if (cast(bool,stream.get('DOVIPresent'))):
track['hdr'] = "dolbyvision"
videotracks.append(track)
Cheers, JC.
I applied your mods. But, what do you mean by tags? I don't see those hdr tags anywhere. Also, I can't find any changelog that says that Nexus supports this now.
Bottom of list views, in info etc. No, not in changelog, but trust me it's there. You can add a source and use Kodi to parse it directly and it will detect Dolbyvision, HDR10 and HLG files. Matrix had no such feature. strHdrType has been added to the database and 3 icons added to the textures and estuary skin. Check with estuary skin as others may not have caught up yet.
TVShow Widelist View (Bottom of screen, episode selected that has Dolbyvision)
Movie List View (Bottom of screen, movie selected that is HDR10)
Kodi Library Scraper (Not PlexKodiConnect) - Video Widelist View (Bottom of screen, file selected that is HLG)
I have tested HLG through Plex and it also works fine in passing the data and activating the HLG icon.
The tricky part was to work through the Python Plex API and work out how to tell these three types apart and pass the also undocumented correct strings to Kodi for its database. My changes work for all the files I have tested but could do with more testing no doubt. Plex has a Bool for Dolbyvision detected or not. HLG should always have a color trc of arib-std-b67 (AFAIK) HDR10 should always be SMTPE2084, but I have a fall back to check for BT2020 as well. A weird file like SDR that someone mapped to BT2020 will get flagged as HDR10 and if this turns out to be an issue the fallback check can be removed. I haven't done any exhaustive checking to see if its really needed.
JC.
Oh okay. Nice. I don't see them tho. Neither in Estuary. Is there anything I need to enable for this to appear?
You will need to do a full reimport with plexkodiconnect as this won’t be seen as a change to items already in the database.
Just go to PKC settings>advanced, repair database. This is for existing items, after this new items will get picked up.
I just did a test and as suspected bt2020 is not required, all hdr10 get smtpe2084 from plex. (as does Dolbyvision BTW).
so media.py can be reduced to:
media.py lines 174-184
track['video3DFormat'] = None
colorTrc = stream.get('colorTrc',"").lower()
if "smpte2084" in colorTrc:
track['hdr'] = "hdr10"
elif "arib-std-b67" in colorTrc:
track['hdr'] = "hlg"
else:
track['hdr'] = None
if (cast(bool,stream.get('DOVIPresent'))):
track['hdr'] = "dolbyvision"
videotracks.append(track)
Cheers, JC.
Thank you. I will test once I get home tonight.
FYI: In my config, the HDR tag DOES show up but when playing the file... noticed after upgrading to Nexus (clean install & reconfigure) (on Shield TV Pro 8.2.3, Android 9, Kodi Nexus, PKC latest, Estuary MOD v2 Nexus edition)
But not in the the tags below (Skin does not support it, I suppose).
Good luck and thanks for all the hard work!
It works for me as well. But I use arctic horizon 2 which doesn't support the tags yet.
You dutch btw?
You dutch btw? Jep
Should be solved in PKC Beta version 3.7.2. Thanks a ton @JCalvi
Respective commit as the PR got lost: https://github.com/croneter/PlexKodiConnect/commit/664a68c30fe4bca9e191acad2b2aa8850859b0ba
I just updated to Nexus (v20) and followed the delete the .db files procedure.
Nexus now has a HDR tag so I hoped it would come across with PKC from Plex which knows which files are HDR.
Everything seems ok except the HDR tag does not seem to come across from Plex.
I haven't done much troubleshooting myself but note the following...
I looked in MyVideos121.db and the tag appears to need to go into strHDRType in the streamDetails table.
Croneter, can you confirm if this tag should come across from Plex or if I need to do something more at my end to get it to work?