diff options
| author | Orry Verducci <orry@orryverducci.co.uk> | 2020-08-10 22:16:23 +0100 |
|---|---|---|
| committer | Orry Verducci <orry@orryverducci.co.uk> | 2020-08-10 22:16:23 +0100 |
| commit | 9dc95074a3b35d00713cbe38eb982e80913f8ab0 (patch) | |
| tree | cb23b760d190df8bf6409407950c77fe37ff4f14 | |
| parent | 7df2affb238e92c9b03813f5aa11530cb37dcbdc (diff) | |
Add bwdif and simplify software deinterlacing
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 81606aa0c..c69d31065 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -2125,30 +2125,27 @@ namespace MediaBrowser.Controller.MediaEncoding } // Add software deinterlace filter before scaling filter - if (state.DeInterlace("h264", true) + if ((state.DeInterlace("h264", true) || state.DeInterlace("avc", true) || state.DeInterlace("h265", true) || state.DeInterlace("hevc", true)) + && (!isVaapiH264Encoder && !isQsvH264Encoder && !isNvdecH264Decoder)) { - string deintParam; - var inputFramerate = videoStream?.RealFrameRate; - - // If it is already 60fps then it will create an output framerate that is much too high for roku and others to handle - if (string.Equals(options.DeinterlaceMethod, "yadif_bob", StringComparison.OrdinalIgnoreCase) && (inputFramerate ?? 60) <= 30) + if (string.Equals(options.DeinterlaceMethod, "bwdif", StringComparison.OrdinalIgnoreCase)) { - deintParam = "yadif=1:-1:0"; + filters.Add( + string.Format( + CultureInfo.InvariantCulture, + "bwdif={0}:-1:0", + doubleRateDeinterlace ? "1" : "0")); } else { - deintParam = "yadif=0:-1:0"; - } - - if (!string.IsNullOrEmpty(deintParam)) - { - if (!isVaapiH264Encoder && !isQsvH264Encoder && !isNvdecH264Decoder) - { - filters.Add(deintParam); - } + filters.Add( + string.Format( + CultureInfo.InvariantCulture, + "yadif={0}:-1:0", + doubleRateDeinterlace ? "1" : "0")); } } |
