Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid baking subtitles when transcoding #3980

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import org.jellyfin.androidtv.util.profile.ProfileHelper.deviceAVCCodecProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.deviceAVCLevelCodecProfiles
import org.jellyfin.androidtv.util.profile.ProfileHelper.deviceHevcCodecProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.deviceHevcLevelCodecProfiles
import org.jellyfin.androidtv.util.profile.ProfileHelper.maxResolutionCodecProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.maxAudioChannelsCodecProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.maxResolutionCodecProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.photoDirectPlayProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.subtitleProfile
import org.jellyfin.androidtv.util.profile.ProfileHelper.supportsHevc
Expand Down Expand Up @@ -85,6 +85,7 @@ class ExoPlayerProfile(
}.joinToString(",")
protocol = "hls"
copyTimestamps = false
enableSubtitlesInManifest = true
},
// MP3 audio profile
TranscodingProfile().apply {
Expand Down Expand Up @@ -204,18 +205,30 @@ class ExoPlayerProfile(
add(maxAudioChannelsCodecProfile(channels = if (downMixAudio) 2 else 8))
}.toTypedArray()

subtitleProfiles = arrayOf(
subtitleProfile(Codec.Subtitle.SRT, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.SUBRIP, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.ASS, SubtitleDeliveryMethod.Encode),
subtitleProfile(Codec.Subtitle.SSA, SubtitleDeliveryMethod.Encode),
subtitleProfile(Codec.Subtitle.PGS, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.PGSSUB, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.DVBSUB, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.DVDSUB, SubtitleDeliveryMethod.Encode),
subtitleProfile(Codec.Subtitle.VTT, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.SUB, SubtitleDeliveryMethod.Embed),
subtitleProfile(Codec.Subtitle.IDX, SubtitleDeliveryMethod.Embed)
)
subtitleProfiles = buildList {
// Rendering supported
arrayOf(
Codec.Subtitle.SRT,
Codec.Subtitle.SUBRIP,
Codec.Subtitle.PGS,
Codec.Subtitle.PGSSUB,
Codec.Subtitle.DVBSUB,
Codec.Subtitle.VTT,
Codec.Subtitle.SUB,
Codec.Subtitle.IDX,
).forEach { codec ->
add(subtitleProfile(codec, SubtitleDeliveryMethod.Embed))
add(subtitleProfile(codec, SubtitleDeliveryMethod.Hls))
}

// Require baking
arrayOf(
Codec.Subtitle.ASS,
Codec.Subtitle.SSA,
Codec.Subtitle.DVDSUB,
).forEach { codec ->
add(subtitleProfile(codec, SubtitleDeliveryMethod.Encode))
}
}.toTypedArray()
}
}
Loading