diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 700af682b..5805127e6 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -393,6 +393,20 @@ namespace MediaBrowser.MediaEncoding.Probing }; } + private string NormalizeSubtitleCodec(string codec) + { + if ((codec ?? string.Empty).IndexOf("PGS", StringComparison.OrdinalIgnoreCase) != -1) + { + codec = "PGSSUB"; + } + else if ((codec ?? string.Empty).IndexOf("DVD", StringComparison.OrdinalIgnoreCase) != -1) + { + codec = "DVDSUB"; + } + + return codec; + } + /// /// Converts ffprobe stream info to our MediaStream class /// @@ -474,6 +488,7 @@ namespace MediaBrowser.MediaEncoding.Probing else if (string.Equals(streamInfo.codec_type, "subtitle", StringComparison.OrdinalIgnoreCase)) { stream.Type = MediaStreamType.Subtitle; + stream.Codec = NormalizeSubtitleCodec(stream.Codec); } else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase)) {