mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Improve transcoding detection (#107)
* Update Leia Video DB * Fix transcoding for non-standard filenames Fix transcoding for cases where the filename does not contain codec Added HEVC to 10bit transcode option Added case for non-default video track ids
This commit is contained in:
parent
634090e93c
commit
a7057ec3dc
2 changed files with 16 additions and 10 deletions
|
@ -30,7 +30,7 @@ def video_database():
|
|||
'15': 93, # Isengard
|
||||
'16': 99, # Jarvis
|
||||
'17': 107,# Krypton
|
||||
'18': 108 # Leia
|
||||
'18': 109 # Leia
|
||||
}
|
||||
return xbmc.translatePath("special://database/MyVideos%s.db"
|
||||
% db_version.get(KODI, "")).decode('utf-8')
|
||||
|
@ -244,4 +244,4 @@ def db_reset():
|
|||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -138,13 +138,14 @@ class PlayUtils():
|
|||
# User forcing to play via HTTP
|
||||
log.info("Can't direct play, play from HTTP enabled.")
|
||||
return False
|
||||
|
||||
videotrack = self.item['MediaSources'][0]['Name']
|
||||
|
||||
vid = self.getVideoStreamID()
|
||||
videotrack = self.item['MediaStreams'][vid]['DisplayTitle']
|
||||
transcodeH265 = settings('transcodeH265')
|
||||
videoprofiles = [x['Profile'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Profile' in x]
|
||||
videoprofile = self.item['MediaStreams'][vid]['Profile']
|
||||
transcodeHi10P = settings('transcodeHi10P')
|
||||
|
||||
if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofiles:
|
||||
if transcodeHi10P == "true" and ("Main 10" in videoprofile or "High 10" in videoprofile) and ("H264" in videotrack or "H265" in videotrack or "HEVC" in videotrack):
|
||||
return False
|
||||
|
||||
if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack):
|
||||
|
@ -241,13 +242,14 @@ class PlayUtils():
|
|||
return False
|
||||
|
||||
def isDirectStream(self):
|
||||
|
||||
videotrack = self.item['MediaSources'][0]['Name']
|
||||
|
||||
vid = self.getVideoStreamID()
|
||||
videotrack = self.item['MediaStreams'][vid]['DisplayTitle']
|
||||
transcodeH265 = settings('transcodeH265')
|
||||
videoprofiles = [x['Profile'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Profile' in x]
|
||||
videoprofile = self.item['MediaStreams'][vid]['Profile']
|
||||
transcodeHi10P = settings('transcodeHi10P')
|
||||
|
||||
if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofiles:
|
||||
if transcodeHi10P == "true" and ("Main 10" in videoprofile or "High 10" in videoprofile) and ("H264" in videotrack or "H265" in videotrack or "HEVC" in videotrack):
|
||||
return False
|
||||
|
||||
if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack):
|
||||
|
@ -703,3 +705,7 @@ class PlayUtils():
|
|||
except KeyError as error:
|
||||
return False
|
||||
|
||||
def getVideoStreamID(self):
|
||||
# Sometimes video stream is not 0, this locates it.
|
||||
videx = [x['Index'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Video' in x['Type']]
|
||||
return videx[0]
|
||||
|
|
Loading…
Reference in a new issue