Jump to content

subtitle support in DeviceProfile post action


TeamB

Recommended Posts

TeamB

Hi,

I have an item with the following info:

[
	{
		'Codec': 'h264',
		'Language': 'eng',
		'TimeBase': '1/1000',
		'Title': 'Big Hero 6 (2014)',
		'VideoRange': 'SDR',
		'DisplayTitle': '1080p H264',
		'DisplayLanguage': 'English',
		'NalLengthSize': '4',
		'IsInterlaced': False,
		'BitRate': 17032515,
		'BitDepth': 8,
		'RefFrames': 1,
		'IsDefault': True,
		'IsForced': False,
		'Height': 804,
		'Width': 1920,
		'AverageFrameRate': 23.976025,
		'RealFrameRate': 23.976025,
		'Profile': 'High',
		'Type': 'Video',
		'AspectRatio': '160:67',
		'Index': 0,
		'IsExternal': False,
		'IsTextSubtitleStream': False,
		'SupportsExternalStream': False,
		'Protocol': 'File',
		'PixelFormat': 'yuv420p',
		'Level': 41,
		'IsAnamorphic': False,
		'AttachmentSize': 0
	},
	{
		'Codec': 'dts',
		'Language': 'eng',
		'TimeBase': '1/1000',
		'Title': 'DTS-ES 5.1 @ 1 510 Kbps',
		'DisplayTitle': 'English DTS-ES 6.1 (Default)',
		'DisplayLanguage': 'English',
		'IsInterlaced': False,
		'ChannelLayout': '6.1',
		'BitRate': 1536000,
		'Channels': 7,
		'SampleRate': 48000,
		'IsDefault': True,
		'IsForced': False,
		'Profile': 'DTS-ES',
		'Type': 'Audio',
		'Index': 1,
		'IsExternal': False,
		'IsTextSubtitleStream': False,
		'SupportsExternalStream': False,
		'Protocol': 'File',
		'AttachmentSize': 0
    },
	{
		'Codec': 'subrip',
		'Language': 'eng',
		'TimeBase': '1/1000',
		'DisplayTitle': 'English (Default SUBRIP)',
		'DisplayLanguage': 'English',
		'IsInterlaced': False,
		'IsDefault': True,
		'IsForced': False,
		'Type': 'Subtitle',
		'Index': 2,
		'IsExternal': False,
		'IsTextSubtitleStream': True,
		'SupportsExternalStream': True,
		'Protocol': 'File',
		'AttachmentSize': 0,
		'SubtitleLocationType': 'InternalStream'
    }, 
	{
		'Codec': 'subrip',
		'Language': 'eng',
		'TimeBase': '1/1000',
		'Title': 'SDH',
		'DisplayTitle': 'English (SUBRIP)',
		'DisplayLanguage': 'English',
		'IsInterlaced': False,
		'IsDefault': False,
		'IsForced': False,
		'Type': 'Subtitle',
		'Index': 3,
		'IsExternal': False,
		'IsTextSubtitleStream': True,
		'SupportsExternalStream': True,
		'Protocol': 'File',
		'AttachmentSize': 0,
		'SubtitleLocationType': 'InternalStream'
    },
	{
		'Codec': 'subrip',
		'Language': 'fre',
		'TimeBase': '1/1000',
		'DisplayTitle': 'French (SUBRIP)',
		'DisplayLanguage': 'French',
		'IsInterlaced': False,
		'IsDefault': False,
		'IsForced': False,
		'Type': 'Subtitle',
		'Index': 4,
		'IsExternal': False,
		'IsTextSubtitleStream': True,
		'SupportsExternalStream': True,
		'Protocol': 'File',
		'AttachmentSize': 0,
		'SubtitleLocationType': 'InternalStream'
    },
	{
		'Codec': 'subrip',
		'Language': 'spa',
		'TimeBase': '1/1000',
		'DisplayTitle': 'Spanish (SUBRIP)',
		'DisplayLanguage': 'Spanish',
		'IsInterlaced': False,
		'IsDefault': False,
		'IsForced': False,
		'Type': 'Subtitle',
		'Index': 5,
		'IsExternal': False,
		'IsTextSubtitleStream': True,
		'SupportsExternalStream': True,
		'Protocol': 'File',
		'AttachmentSize': 0,
		'SubtitleLocationType': 'InternalStream'
	}, 
	{
		'Codec': 'subrip',
		'Language': 'vie',
		'TimeBase': '1/1000',
		'DisplayTitle': 'Vietnamese (SUBRIP)',
		'DisplayLanguage': 'Vietnamese',
		'IsInterlaced': False,
		'IsDefault': False,
		'IsForced': False,
		'Type': 'Subtitle',
		'Index': 6,
		'IsExternal': False,
		'IsTextSubtitleStream': True,
		'SupportsExternalStream': True,
		'Protocol': 'File',
		'AttachmentSize': 0,
		'SubtitleLocationType': 'InternalStream'
	}
]

 

I am sending the following DeviceProfile info in the PlaybackInfo Request


{server}/emby/Items/9167661/PlaybackInfo?MaxStreamingBitrate=150000000

{
	"Name": "Kodi",
	"MaxStaticBitrate": 150000000,
	"MaxStreamingBitrate": 150000000,
	"MusicStreamingTranscodingBitrate": 256000,
	"TimelineOffsetSeconds": 5,
	"TranscodingProfiles": [
		{
			"Type": "Audio"
		},
		{
			"Container": "ts",
			"Protocol": "hls",
			"Type": "Video",
			"AudioCodec": "ac3",
			"VideoCodec": "h264",
			"MaxAudioChannels": "8"
		},
		{
			"Container": "jpeg",
			"Type": "Photo"
		}
	],
	"DirectPlayProfiles": [
		{
			"Type": "Video"
		},
		{
			"Type": "Audio"
		},
		{
			"Type": "Photo"
		}
	],
	"ResponseProfiles": [],
	"ContainerProfiles": [],
	"CodecProfiles": [],
	"SubtitleProfiles": [
		{
			"Format": "srt",
			"Method": "External"
		},
		{
			"Format": "srt",
			"Method": "Embed"
		},
		{
			"Format": "ass",
			"Method": "External"
		},
		{
			"Format": "ass",
			"Method": "Embed"
		},
		{
			"Format": "sub",
			"Method": "Embed"
		},
		{
			"Format": "sub",
			"Method": "External"
		},
		{
			"Format": "ssa",
			"Method": "Embed"
		},
		{
			"Format": "ssa",
			"Method": "External"
		},
		{
			"Format": "smi",
			"Method": "Embed"
		},
		{
			"Format": "smi",
			"Method": "External"
		},
		{
			"Format": "pgssub",
			"Method": "Embed"
		},
		{
			"Format": "pgssub",
			"Method": "External"
		},
		{
			"Format": "dvdsub",
			"Method": "Embed"
		},
		{
			"Format": "dvdsub",
			"Method": "External"
		},
		{
			"Format": "pgs",
			"Method": "Embed"
		},
		{
			"Format": "pgs",
			"Method": "External"
		}
	]
}

 

And get the following responce

{
    'MediaSources': [{
        'Protocol': 'File',
        'Id': '....',
        'Path': '/........mkv',
        'Type': 'Default',
        'Container': 'mkv',
        'Size': 13014455767,
        'Name': '[Bluray-1080p X264 DTS-ES 6.1]-EbP',
        'IsRemote': False,
        'RunTimeTicks': 61127580000,
        'SupportsTranscoding': True,
        'SupportsDirectStream': False,
        'SupportsDirectPlay': False,
        'IsInfiniteStream': False,
        'RequiresOpening': False,
        'RequiresClosing': False,
        'RequiresLooping': False,
        'SupportsProbing': False,
        'MediaStreams': [{
            'Codec': 'h264',
            'Language': 'eng',
            'TimeBase': '1/1000',
            'Title': 'Big Hero 6 (2014)',
            'VideoRange': 'SDR',
            'DisplayTitle': '1080p H264',
            'DisplayLanguage': 'English',
            'NalLengthSize': '4',
            'IsInterlaced': False,
            'BitRate': 17032515,
            'BitDepth': 8,
            'RefFrames': 1,
            'IsDefault': True,
            'IsForced': False,
            'Height': 804,
            'Width': 1920,
            'AverageFrameRate': 23.976025,
            'RealFrameRate': 23.976025,
            'Profile': 'High',
            'Type': 'Video',
            'AspectRatio': '160:67',
            'Index': 0,
            'IsExternal': False,
            'IsTextSubtitleStream': False,
            'SupportsExternalStream': False,
            'Protocol': 'File',
            'PixelFormat': 'yuv420p',
            'Level': 41,
            'IsAnamorphic': False,
            'AttachmentSize': 0
        }, {
            'Codec': 'dts',
            'Language': 'eng',
            'TimeBase': '1/1000',
            'Title': 'DTS-ES 5.1 @ 1 510 Kbps',
            'DisplayTitle': 'English DTS-ES 6.1 (Default)',
            'DisplayLanguage': 'English',
            'IsInterlaced': False,
            'ChannelLayout': '6.1',
            'BitRate': 1536000,
            'Channels': 7,
            'SampleRate': 48000,
            'IsDefault': True,
            'IsForced': False,
            'Profile': 'DTS-ES',
            'Type': 'Audio',
            'Index': 1,
            'IsExternal': False,
            'IsTextSubtitleStream': False,
            'SupportsExternalStream': False,
            'Protocol': 'File',
            'AttachmentSize': 0
        }, {
            'Codec': 'subrip',
            'Language': 'eng',
            'TimeBase': '1/1000',
            'DisplayTitle': 'English (Default SUBRIP)',
            'DisplayLanguage': 'English',
            'IsInterlaced': False,
            'IsDefault': True,
            'IsForced': False,
            'Type': 'Subtitle',
            'Index': 2,
            'IsExternal': False,
            'DeliveryMethod': 'Encode',
            'IsTextSubtitleStream': True,
            'SupportsExternalStream': True,
            'Protocol': 'File',
            'AttachmentSize': 0,
            'SubtitleLocationType': 'InternalStream'
        }, {
            'Codec': 'subrip',
            'Language': 'eng',
            'TimeBase': '1/1000',
            'Title': 'SDH',
            'DisplayTitle': 'English (SUBRIP)',
            'DisplayLanguage': 'English',
            'IsInterlaced': False,
            'IsDefault': False,
            'IsForced': False,
            'Type': 'Subtitle',
            'Index': 3,
            'IsExternal': False,
            'IsTextSubtitleStream': True,
            'SupportsExternalStream': True,
            'Protocol': 'File',
            'AttachmentSize': 0,
            'SubtitleLocationType': 'InternalStream'
        }, {
            'Codec': 'subrip',
            'Language': 'fre',
            'TimeBase': '1/1000',
            'DisplayTitle': 'French (SUBRIP)',
            'DisplayLanguage': 'French',
            'IsInterlaced': False,
            'IsDefault': False,
            'IsForced': False,
            'Type': 'Subtitle',
            'Index': 4,
            'IsExternal': False,
            'IsTextSubtitleStream': True,
            'SupportsExternalStream': True,
            'Protocol': 'File',
            'AttachmentSize': 0,
            'SubtitleLocationType': 'InternalStream'
        }, {
            'Codec': 'subrip',
            'Language': 'spa',
            'TimeBase': '1/1000',
            'DisplayTitle': 'Spanish (SUBRIP)',
            'DisplayLanguage': 'Spanish',
            'IsInterlaced': False,
            'IsDefault': False,
            'IsForced': False,
            'Type': 'Subtitle',
            'Index': 5,
            'IsExternal': False,
            'IsTextSubtitleStream': True,
            'SupportsExternalStream': True,
            'Protocol': 'File',
            'AttachmentSize': 0,
            'SubtitleLocationType': 'InternalStream'
        }, {
            'Codec': 'subrip',
            'Language': 'vie',
            'TimeBase': '1/1000',
            'DisplayTitle': 'Vietnamese (SUBRIP)',
            'DisplayLanguage': 'Vietnamese',
            'IsInterlaced': False,
            'IsDefault': False,
            'IsForced': False,
            'Type': 'Subtitle',
            'Index': 6,
            'IsExternal': False,
            'IsTextSubtitleStream': True,
            'SupportsExternalStream': True,
            'Protocol': 'File',
            'AttachmentSize': 0,
            'SubtitleLocationType': 'InternalStream'
        }],
        'Formats': [],
        'Bitrate': 17032515,
        'RequiredHttpHeaders': {},
        'DirectStreamUrl': '/videos/9167661/master.m3u8?DeviceId=5d98a76d51584010bf29626abd0d43ad&MediaSourceId=3712d65a9c4e646539224b290442bec0&PlaySessionId=a94bd8fe99ea45d68a5b1f36d34037e9&api_key=7d182fe05ba34fe7ba1aa24f1a78f317&VideoCodec=h264&AudioCodec=ac3&VideoBitrate=149232000&AudioBitrate=768000&AudioStreamIndex=1&SubtitleStreamIndex=2&SubtitleMethod=Encode&TranscodingMaxAudioChannels=8&SegmentContainer=ts&BreakOnNonKeyFrames=False&TranscodeReasons=SubtitleCodecNotSupported',
        'TranscodingUrl': '/videos/9167661/master.m3u8?DeviceId=5d98a76d51584010bf29626abd0d43ad&MediaSourceId=3712d65a9c4e646539224b290442bec0&PlaySessionId=a94bd8fe99ea45d68a5b1f36d34037e9&api_key=7d182fe05ba34fe7ba1aa24f1a78f317&VideoCodec=h264&AudioCodec=ac3&VideoBitrate=149232000&AudioBitrate=768000&AudioStreamIndex=1&SubtitleStreamIndex=2&SubtitleMethod=Encode&TranscodingMaxAudioChannels=8&SegmentContainer=ts&BreakOnNonKeyFrames=False&TranscodeReasons=SubtitleCodecNotSupported',
        'TranscodingSubProtocol': 'hls',
        'TranscodingContainer': 'ts',
        'ReadAtNativeFramerate': False,
        'DefaultAudioStreamIndex': 1,
        'DefaultSubtitleStreamIndex': 2
    }],
    'PlaySessionId': '.....'
}

 

With a reason for transcode : SubtitleCodecNotSupported

Is this because I have not added subrip to my SubtitleProfiles?

 

 

Link to comment
Share on other sites

Hi, maybe. You can definitely avoid the transcode by adding:

{
			"Format": "subrip",
			"Method": "Embed"
		}

But even without this you can still avoid the transcoding because the server can extract the subtitles on the fly and convert to a compatible format, such as external srt which you've enabled.

Do you have on the fly subtitle extraction disabled in server transcoding settings?

  • Like 1
Link to comment
Share on other sites

TeamB
30 minutes ago, Luke said:

Do you have on the fly subtitle extraction disabled in server transcoding settings?

I dont actually know, I am looking into this for a user, I probably need to get a test file to reproduce this and test the solution.

Thanks for the quick response.

Link to comment
Share on other sites

Most likely they disabled on the fly subtitle extraction, which is perfectly normal if it's not quick enough in their environment.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...