Skip to content

Commit 94f645b

Browse files
committed
fix: don't remux external subs.
External streams have to be excluded, lest we try to tell FFmpeg about them when they aren't in any of the mapped inputs.
1 parent ec918a1 commit 94f645b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Jellyfin.Plugin.DoViRemux/RemuxLibraryTask.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using MediaBrowser.Controller.MediaEncoding;
88
using MediaBrowser.Controller.Persistence;
99
using MediaBrowser.Controller.Streaming;
10+
using MediaBrowser.Model.Entities;
1011
using MediaBrowser.Model.Tasks;
1112
using Microsoft.Extensions.Logging;
1213

@@ -163,9 +164,12 @@ private async Task ProcessOneItem(Video item, CancellationToken cancellationToke
163164

164165
// PGS subtitles aren't supported by mp4. Technically we can use the copy codec
165166
// and most decoders will know how to use subrip subtitles, but mov_text is standard
167+
// We also need to exclude external subs, which show up as a stream even though they're
168+
// not in the video file itself, so FFmpeg will be confused if we mention them to it.
166169
var subtitles = streams
167-
.Where(s => s.Type == MediaBrowser.Model.Entities.MediaStreamType.Subtitle
168-
&& s.IsTextSubtitleStream)
170+
.Where(s => s.Type == MediaStreamType.Subtitle
171+
&& s.IsTextSubtitleStream
172+
&& !s.IsExternal)
169173
.Select((subtitle, i) => new { subtitle.Index, OutputIndex = i, Codec = "mov_text", Lang = subtitle.Language })
170174
.ToList();
171175

0 commit comments

Comments
 (0)