|
|
|
@ -43,6 +43,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
|
|
|
|
|
|
private readonly Version _minFFmpegImplictHwaccel = new Version(6, 0);
|
|
|
|
|
private readonly Version _minFFmpegHwaUnsafeOutput = new Version(6, 0);
|
|
|
|
|
private readonly Version _minFFmpegOclCuTonemapMode = new Version(5, 1, 3);
|
|
|
|
|
|
|
|
|
|
private static readonly string[] _videoProfilesH264 = new[]
|
|
|
|
|
{
|
|
|
|
@ -2816,7 +2817,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetHwTonemapFilter(EncodingOptions options, string hwTonemapSuffix, string videoFormat)
|
|
|
|
|
public string GetHwTonemapFilter(EncodingOptions options, string hwTonemapSuffix, string videoFormat)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(hwTonemapSuffix))
|
|
|
|
|
{
|
|
|
|
@ -2827,7 +2828,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
|
|
|
|
|
|
if (hwTonemapSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
args += ",procamp_vaapi=b={2}:c={3}:extra_hw_frames=16";
|
|
|
|
|
args = "procamp_vaapi=b={2}:c={3}," + args + ":extra_hw_frames=32";
|
|
|
|
|
|
|
|
|
|
return string.Format(
|
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
|
args,
|
|
|
|
@ -2840,14 +2842,24 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
|
{
|
|
|
|
|
args += ":tonemap={2}:peak={3}:desat={4}";
|
|
|
|
|
|
|
|
|
|
if (string.Equals(options.TonemappingMode, "max", StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
|| string.Equals(options.TonemappingMode, "rgb", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (_mediaEncoder.EncoderVersion >= _minFFmpegOclCuTonemapMode)
|
|
|
|
|
{
|
|
|
|
|
args += ":tonemap_mode={5}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.TonemappingParam != 0)
|
|
|
|
|
{
|
|
|
|
|
args += ":param={5}";
|
|
|
|
|
args += ":param={6}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.Equals(options.TonemappingRange, "auto", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
if (string.Equals(options.TonemappingRange, "tv", StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
|| string.Equals(options.TonemappingRange, "pc", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
args += ":range={6}";
|
|
|
|
|
args += ":range={7}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2859,6 +2871,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
|
options.TonemappingAlgorithm,
|
|
|
|
|
options.TonemappingPeak,
|
|
|
|
|
options.TonemappingDesat,
|
|
|
|
|
options.TonemappingMode,
|
|
|
|
|
options.TonemappingParam,
|
|
|
|
|
options.TonemappingRange);
|
|
|
|
|
}
|
|
|
|
|