From 41f7e2ab19b723a32865b868ffe489dbd36065e8 Mon Sep 17 00:00:00 2001 From: abeloin Date: Sat, 25 Jan 2014 15:27:31 -0500 Subject: Don't re-encode subtitle: ass/ssa -> ass. This fix Issue #630 : "ASS encoder supports only one ASS rectangle field". --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs') diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 76cce0d66..67f06c792 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -536,7 +536,11 @@ namespace MediaBrowser.Api.Playback Directory.CreateDirectory(parentPath); - var task = MediaEncoder.ExtractTextSubtitle(inputPath, type, state.SubtitleStream.Index, path, CancellationToken.None); + // Don't re-encode ass/ssa to ass because ffmpeg ass encoder fails if there's more than one ass rectangle. Affect Anime mostly. + // See https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2013-April/063616.html + bool isAssSubtitle = string.Equals(state.SubtitleStream.Codec, "ass", StringComparison.OrdinalIgnoreCase) || string.Equals(state.SubtitleStream.Codec, "ssa", StringComparison.OrdinalIgnoreCase); + + var task = MediaEncoder.ExtractTextSubtitle(inputPath, type, state.SubtitleStream.Index, isAssSubtitle, path, CancellationToken.None); Task.WaitAll(task); } -- cgit v1.2.3