From c67e5ad46657c04be1068cc8fd579a7b14afd095 Mon Sep 17 00:00:00 2001 From: Lionel DUCHATEAU Date: Fri, 20 Dec 2024 15:25:40 +0100 Subject: [PATCH] Registered WebVTT as subtitle format. Signed-off-by: Lionel DUCHATEAU --- core/details/CodecManager.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/details/CodecManager.cs b/core/details/CodecManager.cs index 7a83730..38f876d 100644 --- a/core/details/CodecManager.cs +++ b/core/details/CodecManager.cs @@ -137,6 +137,7 @@ public string MediaInfoRegex public static readonly SubtitleCodec SSA = new SubtitleCodec("SSA", "ssa"); public static readonly SubtitleCodec TTXT = new SubtitleCodec("TTXT", "ttxt"); public static readonly SubtitleCodec VOBSUB = new SubtitleCodec("VOBSUB", "(vobsub)|(rle)"); + public static readonly SubtitleCodec WEBVTT = new SubtitleCodec("VTT", "webVTT"); public static readonly SubtitleCodec UNKNOWN = new SubtitleCodec("UNKNOWN", ".*"); } #endregion @@ -270,6 +271,7 @@ static CodecManager() SubtitleCodecs.Register(SubtitleCodec.SSA) && SubtitleCodecs.Register(SubtitleCodec.TTXT) && SubtitleCodecs.Register(SubtitleCodec.VOBSUB) && + SubtitleCodecs.Register(SubtitleCodec.WEBVTT) && SubtitleCodecs.Register(SubtitleCodec.UNKNOWN) // must be the last line to serve as catch-all )) throw new Exception("Failed to register a standard video codec"); @@ -382,6 +384,7 @@ public SubtitleType(string name, string filterName, string extension, ContainerT public static readonly SubtitleType SUBRIP = new SubtitleType("Subrip", "Subrip Subtitle Files", "srt", null); public static readonly SubtitleType TTXT = new SubtitleType("TTXT", "Time Text Subtitles Files", "ttxt", null); public static readonly SubtitleType VOBSUB = new SubtitleType("Vobsub", "Vobsub Subtitle Files", "idx", null); + public static readonly SubtitleType WEBVTT = new SubtitleType("WebVTT", "WebVTT Subtitle Files", "vtt", null); } public class ChapterType : OutputType @@ -492,6 +495,7 @@ static ContainerManager() SubtitleTypes.Register(SubtitleType.SUBRIP) && SubtitleTypes.Register(SubtitleType.BDSUP) && SubtitleTypes.Register(SubtitleType.VOBSUB) && + SubtitleTypes.Register(SubtitleType.WEBVTT) && SubtitleTypes.Register(SubtitleType.TTXT))) throw new Exception("Failed to register a subtitle type"); if (!(