mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-21 13:10:45 +02:00
Add bwdif and simplify software deinterlacing
This commit is contained in:
parent
7df2affb23
commit
9dc95074a3
|
@ -2125,30 +2125,27 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add software deinterlace filter before scaling filter
|
// Add software deinterlace filter before scaling filter
|
||||||
if (state.DeInterlace("h264", true)
|
if ((state.DeInterlace("h264", true)
|
||||||
|| state.DeInterlace("avc", true)
|
|| state.DeInterlace("avc", true)
|
||||||
|| state.DeInterlace("h265", true)
|
|| state.DeInterlace("h265", true)
|
||||||
|| state.DeInterlace("hevc", true))
|
|| state.DeInterlace("hevc", true))
|
||||||
|
&& (!isVaapiH264Encoder && !isQsvH264Encoder && !isNvdecH264Decoder))
|
||||||
{
|
{
|
||||||
string deintParam;
|
if (string.Equals(options.DeinterlaceMethod, "bwdif", StringComparison.OrdinalIgnoreCase))
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
deintParam = "yadif=1:-1:0";
|
filters.Add(
|
||||||
|
string.Format(
|
||||||
|
CultureInfo.InvariantCulture,
|
||||||
|
"bwdif={0}:-1:0",
|
||||||
|
doubleRateDeinterlace ? "1" : "0"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
deintParam = "yadif=0:-1:0";
|
filters.Add(
|
||||||
}
|
string.Format(
|
||||||
|
CultureInfo.InvariantCulture,
|
||||||
if (!string.IsNullOrEmpty(deintParam))
|
"yadif={0}:-1:0",
|
||||||
{
|
doubleRateDeinterlace ? "1" : "0"));
|
||||||
if (!isVaapiH264Encoder && !isQsvH264Encoder && !isNvdecH264Decoder)
|
|
||||||
{
|
|
||||||
filters.Add(deintParam);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue