Improve playback, preroll and TV experience
This commit is contained in:
@@ -53,6 +53,27 @@ func androidTVDeviceProfile(capabilities PlaybackCapabilities) map[string]any {
|
||||
}
|
||||
}
|
||||
|
||||
// forceH264TranscodeProfile turns decoder recovery into an actual codec change. Merely
|
||||
// removing DirectPlayProfiles is insufficient: Emby may otherwise stream-copy HEVC into
|
||||
// the ordinary HLS transcoding profile and hand the failing decoder the same video again.
|
||||
func forceH264TranscodeProfile(profile map[string]any) {
|
||||
profile["DirectPlayProfiles"] = []map[string]string{}
|
||||
profile["TranscodingProfiles"] = []map[string]string{
|
||||
{
|
||||
"Container": "ts", "VideoCodec": "h264", "AudioCodec": "aac",
|
||||
"Protocol": "hls", "Type": "Video", "Context": "Streaming",
|
||||
},
|
||||
}
|
||||
profiles, _ := profile["CodecProfiles"].([]map[string]any)
|
||||
h264Profiles := make([]map[string]any, 0, len(profiles))
|
||||
for _, codecProfile := range profiles {
|
||||
if codec, _ := codecProfile["Codec"].(string); codec == "h264" {
|
||||
h264Profiles = append(h264Profiles, codecProfile)
|
||||
}
|
||||
}
|
||||
profile["CodecProfiles"] = h264Profiles
|
||||
}
|
||||
|
||||
func androidTVSubtitleProfiles() []map[string]string {
|
||||
return []map[string]string{
|
||||
{"Format": "srt", "Method": "External"},
|
||||
|
||||
Reference in New Issue
Block a user