Fix transcoder logic and disable external bitmap subtitles.

This commit is contained in:
Ian Walton 2020-01-12 16:10:30 -05:00
parent b6bba81233
commit 931957e159
3 changed files with 22 additions and 19 deletions

View File

@ -80,10 +80,10 @@ class Video(object):
user_aid = self.media_source.get("DefaultAudioStreamIndex")
user_sid = self.media_source.get("DefaultSubtitleStreamIndex")
if user_aid is not None:
if user_aid is not None and self.aid is None:
self.aid = user_aid
if user_sid is not None:
if user_sid is not None and self.sid is None:
self.sid = user_sid
def get_current_streams(self):
@ -125,7 +125,7 @@ class Video(object):
def terminate_transcode(self):
if self.is_transcode:
self.client.jellyfin.close_transcode(client.config.data["app.device_id"])
self.client.jellyfin.close_transcode(self.client.config.data["app.device_id"])
def _get_url_from_source(self, source):
if self.media_source['SupportsDirectStream']:
@ -138,7 +138,7 @@ class Video(object):
)
elif self.media_source['SupportsTranscoding']:
self.is_transcode = True
return self.media_source.get("TranscodingUrl")
return self.client.config.data["auth.server"] + self.media_source.get("TranscodingUrl")
def get_playback_url(self, offset=0, video_bitrate=None, force_transcode=False, force_bitrate=False):
"""

View File

@ -330,7 +330,7 @@ class PlayerManager(object):
log.debug("PlayerManager::play selecting audio stream index=%s" % audio_uid)
self._player.audio = self._video.audio_seq[audio_uid]
if sub_uid is None:
if sub_uid is None or sub_uid == -1:
log.debug("PlayerManager::play selecting subtitle stream (none)")
self._player.sub = 'no'
else:

View File

@ -79,8 +79,9 @@ def get_profile(is_remote=False, video_bitrate=None, force_transcode=False, is_t
"Type": "Audio"
},
{
"Container": "m3u8",
"Container": "ts",
"Type": "Video",
"Protocol": "hls",
"AudioCodec": "aac,mp3,ac3,opus,flac,vorbis",
"VideoCodec": "h264,mpeg4,mpeg2video",
"MaxAudioChannels": "6"
@ -145,30 +146,31 @@ def get_profile(is_remote=False, video_bitrate=None, force_transcode=False, is_t
"Format": "smi",
"Method": "External"
},
# Jellyfin currently refuses to serve these subtitle types as external.
{
"Format": "pgssub",
"Method": "Embed"
},
{
"Format": "pgssub",
"Method": "External"
},
#{
# "Format": "pgssub",
# "Method": "External"
#},
{
"Format": "dvdsub",
"Method": "Embed"
},
{
"Format": "dvdsub",
"Method": "External"
},
#{
# "Format": "dvdsub",
# "Method": "External"
#},
{
"Format": "pgs",
"Method": "Embed"
},
{
"Format": "pgs",
"Method": "External"
}
#{
# "Format": "pgs",
# "Method": "External"
#}
]
}
@ -176,8 +178,9 @@ def get_profile(is_remote=False, video_bitrate=None, force_transcode=False, is_t
profile['DirectPlayProfiles'][0]['VideoCodec'] = "h264,mpeg4,mpeg2video"
else:
profile['TranscodingProfiles'].insert(0, {
"Container": "m3u8",
"Container": "ts",
"Type": "Video",
"Protocol": "hls",
"AudioCodec": "aac,mp3,ac3,opus,flac,vorbis",
"VideoCodec": "h264,h265,hevc,mpeg4,mpeg2video",
"MaxAudioChannels": "6"