separate deinterlacing params by video codec

This commit is contained in:
Luke Pulverenti
2017-09-21 17:36:19 -04:00
parent 164cea3fb4
commit b4851d4789
9 changed files with 217 additions and 35 deletions

View File

@@ -796,12 +796,13 @@ namespace MediaBrowser.Controller.MediaEncoding
if (videoStream.IsInterlaced)
{
if (request.DeInterlace)
if (state.DeInterlace(videoStream.Codec))
{
return false;
}
}
if (videoStream.IsAnamorphic ?? false)
{
if (request.RequireNonAnamorphic)
@@ -1357,7 +1358,7 @@ namespace MediaBrowser.Controller.MediaEncoding
filters.Add("hwupload");
}
if (state.DeInterlace && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
if (state.DeInterlace("h264") && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
{
if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase))
{
@@ -1799,11 +1800,6 @@ namespace MediaBrowser.Controller.MediaEncoding
state.InternalSubtitleStreamOffset = mediaStreams.Where(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal).ToList().IndexOf(state.SubtitleStream);
}
if (state.VideoStream != null && state.VideoStream.IsInterlaced)
{
state.DeInterlace = true;
}
EnforceResolutionLimit(state);
NormalizeSubtitleEmbed(state);