mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Add audio channel substitutions
This commit is contained in:
parent
7244b15821
commit
2794a4b550
4 changed files with 29 additions and 14 deletions
|
@ -154,7 +154,7 @@ DOCUMENTATION :: END
|
|||
% if data['video_decision'] == 'transcode':
|
||||
Video <strong>Transcode (${data['video_codec'].upper()} ${data['video_resolution'].rstrip('p') + ('p' if data['video_resolution'].lower() != 'sd' else '')} → ${data['stream_video_codec'].upper()} ${data['stream_video_resolution'].rstrip('p') + ('p' if data['stream_video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
% elif data['video_decision'] == 'copy':
|
||||
Video <strong>Direct Stream (${data['video_codec'].upper()} ${data['video_resolution'].rstrip('p') + ('p' if data['video_resolution'].lower() != 'sd' else '')} → ${data['stream_video_codec'].upper()} ${data['stream_video_resolution'].rstrip('p') + ('p' if data['stream_video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
Video <strong>Direct Stream (${data['stream_video_codec'].upper()} ${data['stream_video_resolution'].rstrip('p') + ('p' if data['stream_video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
% else:
|
||||
Video <strong>Direct Play (${data['video_codec'].upper()} ${data['video_resolution'].rstrip('p') + ('p' if data['video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
% endif
|
||||
|
@ -162,11 +162,11 @@ DOCUMENTATION :: END
|
|||
% endif
|
||||
% if data['media_type'] in ('movie', 'episode', 'clip', 'track'):
|
||||
% if data['audio_decision'] == 'transcode':
|
||||
Audio <strong>Transcode (${data['audio_codec'].upper()} ${data['audio_channels']}ch → ${data['stream_audio_codec'].upper()} ${data['stream_audio_channels']}ch)</strong>
|
||||
Audio <strong>Transcode (${data['audio_codec'].upper()} ${data['audio_channel_layout']} → ${data['stream_audio_codec'].upper()} ${data['stream_audio_channel_layout']})</strong>
|
||||
% elif data['audio_decision'] == 'copy':
|
||||
Audio <strong>Direct Stream (${data['audio_codec'].upper()} ${data['audio_channels']}ch → ${data['stream_audio_codec'].upper()} ${data['stream_audio_channels']}ch)</strong>
|
||||
Audio <strong>Direct Stream (${data['stream_audio_codec'].upper()} ${data['stream_audio_channel_layout']})</strong>
|
||||
% else:
|
||||
Audio <strong>Direct Play (${data['audio_codec'].upper()} ${data['audio_channels']}ch)</strong>
|
||||
Audio <strong>Direct Play (${data['audio_codec'].upper()} ${data['audio_channel_layout']})</strong>
|
||||
% endif
|
||||
<br />
|
||||
% endif
|
||||
|
|
|
@ -210,25 +210,25 @@
|
|||
if (s.video_decision == 'transcode') {
|
||||
ts += 'Video <strong>Transcode (' + s.video_codec.toUpperCase() + ' ' + v_res + ' → ' + s.stream_video_codec.toUpperCase() + ' ' + sv_res + ')</strong><br>';
|
||||
} else if (s.video_decision == 'copy') {
|
||||
ts += 'Video <strong>Direct Stream (' + s.video_codec.toUpperCase() + ' ' + v_res + ' → ' + s.stream_video_codec.toUpperCase() + ' ' + sv_res + ')</strong><br>';
|
||||
ts += 'Video <strong>Direct Stream (' + s.stream_video_codec.toUpperCase() + ' ' + sv_res + ')</strong><br>';
|
||||
} else {
|
||||
ts += 'Video <strong>Direct Play (' + s.video_codec.toUpperCase() + ' ' + v_res + ')</strong><br>';
|
||||
}
|
||||
}
|
||||
if (s.audio_decision != '') {
|
||||
if (s.audio_decision == 'transcode') {
|
||||
ts += 'Audio <strong>Transcode (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channels + 'ch → ' + s.stream_audio_codec.toUpperCase() + ' ' + s.stream_audio_channels + 'ch)</strong><br>';
|
||||
ts += 'Audio <strong>Transcode (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channel_layout + ' → ' + s.stream_audio_codec.toUpperCase() + ' ' + s.stream_audio_channel_layout + ')</strong><br>';
|
||||
} else if (s.audio_decision == 'copy') {
|
||||
ts += 'Audio <strong>Direct Stream (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channels + 'ch → ' + s.stream_audio_codec.toUpperCase() + ' ' + s.stream_audio_channels + 'ch)</strong><br>';
|
||||
ts += 'Audio <strong>Direct Stream (' + s.stream_audio_codec.toUpperCase() + ' ' + s.stream_audio_channel_layout + ')</strong><br>';
|
||||
} else {
|
||||
ts += 'Audio <strong>Direct Play (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channels + 'ch)</strong><br>';
|
||||
ts += 'Audio <strong>Direct Play (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channel_layout + ')</strong><br>';
|
||||
}
|
||||
}
|
||||
if (s.subtitles) {
|
||||
if (s.subtitle_decision == 'transcode') {
|
||||
ts += 'Subtitle <strong>Transcode (' + s.subtitle_codec.toUpperCase() + ' → ' + s.stream_subtitle_codec.toUpperCase() + ')</strong>';
|
||||
} else if (s.subtitle_decision == 'burn') {
|
||||
ts += 'Subtitle <strong>Burn (' + s.subtitle_codec.toUpperCase() + ')</strong>';
|
||||
ts += 'Subtitle <strong>Burn (' + s.stream_subtitle_codec.toUpperCase() + ')</strong>';
|
||||
} else {
|
||||
ts += 'Subtitle <strong>Direct Play (' + s.subtitle_codec.toUpperCase() + ')</strong>';
|
||||
}
|
||||
|
|
|
@ -56,6 +56,15 @@ MEDIA_FLAGS_VIDEO = {'avc1': 'h264',
|
|||
'wmv3': 'wmvhd'
|
||||
}
|
||||
|
||||
AUDIO_CHANNELS = {'1': 'Mono',
|
||||
'2': 'Stereo',
|
||||
'3': '2.1',
|
||||
'4': '3.1',
|
||||
'6': '5.1',
|
||||
'7': '6.1',
|
||||
'8': '7.1'
|
||||
}
|
||||
|
||||
QUALITY_PROFILES = {'20000': '20 Mbps 1080p',
|
||||
'12000': '12 Mbps 1080p',
|
||||
'10000': '10 Mbps 1080p',
|
||||
|
|
|
@ -999,7 +999,6 @@ class PmsConnect(object):
|
|||
'type': helpers.get_xml_attr(stream, 'streamType'),
|
||||
'audio_bitrate': helpers.get_xml_attr(stream, 'bitrate'),
|
||||
'audio_bitrate_mode': helpers.get_xml_attr(stream, 'bitrateMode'),
|
||||
'audio_channel_layout': helpers.get_xml_attr(stream, 'audioChannelLayout'),
|
||||
'audio_sample_rate': helpers.get_xml_attr(stream, 'samplingRate'),
|
||||
'audio_language': helpers.get_xml_attr(stream, 'language'),
|
||||
'audio_language_code': helpers.get_xml_attr(stream, 'languageCode'),
|
||||
|
@ -1024,6 +1023,8 @@ class PmsConnect(object):
|
|||
'streams': streams
|
||||
})
|
||||
|
||||
audio_channels = helpers.get_xml_attr(media, 'audioChannels')
|
||||
|
||||
medias.append({'id': helpers.get_xml_attr(media, 'id'),
|
||||
'container': helpers.get_xml_attr(media, 'container'),
|
||||
'bitrate': helpers.get_xml_attr(media, 'bitrate'),
|
||||
|
@ -1034,7 +1035,8 @@ class PmsConnect(object):
|
|||
'video_resolution': helpers.get_xml_attr(media, 'videoResolution'),
|
||||
'video_framerate': helpers.get_xml_attr(media, 'videoFrameRate'),
|
||||
'audio_codec': helpers.get_xml_attr(media, 'audioCodec'),
|
||||
'audio_channels': helpers.get_xml_attr(media, 'audioChannels'),
|
||||
'audio_channels': audio_channels,
|
||||
'audio_channel_layout': common.AUDIO_CHANNELS.get(audio_channels, audio_channels),
|
||||
'optimized_version': 1 if helpers.get_xml_attr(media, 'proxyType') == '42' else 0,
|
||||
'parts': parts
|
||||
})
|
||||
|
@ -1338,7 +1340,6 @@ class PmsConnect(object):
|
|||
audio_id = helpers.get_xml_attr(audio_stream_info, 'id')
|
||||
audio_details = {'stream_audio_bitrate': helpers.get_xml_attr(audio_stream_info, 'bitrate'),
|
||||
'stream_audio_bitrate_mode': helpers.get_xml_attr(audio_stream_info, 'bitrateMode'),
|
||||
'stream_audio_channel_layout': helpers.get_xml_attr(audio_stream_info, 'audioChannelLayout'),
|
||||
'stream_audio_sample_rate': helpers.get_xml_attr(audio_stream_info, 'samplingRate'),
|
||||
'stream_audio_language': helpers.get_xml_attr(audio_stream_info, 'language'),
|
||||
'stream_audio_language_code': helpers.get_xml_attr(audio_stream_info, 'languageCode'),
|
||||
|
@ -1372,11 +1373,14 @@ class PmsConnect(object):
|
|||
else:
|
||||
quality_profile = ''
|
||||
|
||||
stream_audio_channels = helpers.get_xml_attr(stream_media_info, 'audioChannels')
|
||||
|
||||
stream_details = {'stream_container': helpers.get_xml_attr(stream_media_info, 'container'),
|
||||
'stream_bitrate': helpers.get_xml_attr(stream_media_info, 'bitrate'),
|
||||
'stream_aspect_ratio': helpers.get_xml_attr(stream_media_info, 'aspectRatio'),
|
||||
'stream_audio_codec': helpers.get_xml_attr(stream_media_info, 'audioCodec'),
|
||||
'stream_audio_channels': helpers.get_xml_attr(stream_media_info, 'audioChannels'),
|
||||
'stream_audio_channels': stream_audio_channels,
|
||||
'stream_audio_channel_layout': common.AUDIO_CHANNELS.get(stream_audio_channels, stream_audio_channels),
|
||||
'stream_video_codec': helpers.get_xml_attr(stream_media_info, 'videoCodec'),
|
||||
'stream_video_framerate': helpers.get_xml_attr(stream_media_info, 'videoFrameRate'),
|
||||
'stream_video_resolution': helpers.get_xml_attr(stream_media_info, 'videoResolution'),
|
||||
|
@ -1400,6 +1404,7 @@ class PmsConnect(object):
|
|||
|
||||
if media_type == 'clip':
|
||||
clip_media = session.getElementsByTagName('Media')[0]
|
||||
audio_channels = helpers.get_xml_attr(clip_media, 'audioChannels')
|
||||
metadata_details = {'rating_key': helpers.get_xml_attr(session, 'ratingKey'),
|
||||
'title': helpers.get_xml_attr(session, 'title'),
|
||||
'summary': helpers.get_xml_attr(session, 'summary'),
|
||||
|
@ -1414,7 +1419,8 @@ class PmsConnect(object):
|
|||
'video_codec': helpers.get_xml_attr(clip_media, 'videoCodec'),
|
||||
'video_resolution': helpers.get_xml_attr(clip_media, 'videoResolution'),
|
||||
'audio_codec': helpers.get_xml_attr(clip_media, 'audioCodec'),
|
||||
'audio_channels': helpers.get_xml_attr(clip_media, 'audioChannels'),
|
||||
'audio_channels': audio_channels,
|
||||
'audio_channel_layout': common.AUDIO_CHANNELS.get(audio_channels, audio_channels)
|
||||
}
|
||||
else:
|
||||
media_id = helpers.get_xml_attr(stream_media_info, 'id')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue