diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 202cfd5b74..0fc27f9f79 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -6094,7 +6094,9 @@ namespace MediaBrowser.Controller.MediaEncoding // Hardware surface only make sense when interop with OpenCL // VideoToolbox's Hardware surface in ffmpeg is not only slower than hwupload, but also breaks HDR in many cases. // For example: https://trac.ffmpeg.org/ticket/10884 - var useOclToneMapping = !IsVideoToolboxTonemapAvailable(state, options) && IsHwTonemapAvailable(state, options); + var useOclToneMapping = !IsVideoToolboxTonemapAvailable(state, options) && + options.EnableTonemapping && + state.VideoStream.VideoRangeType == VideoRangeType.DOVI; var useHwSurface = useOclToneMapping && IsVideoToolBoxFullSupported() && _mediaEncoder.SupportsFilter("alphasrc"); if (is8bitSwFormatsVt) diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs index 13ebebded4..ab6f0d867c 100644 --- a/MediaBrowser.Model/Configuration/EncodingOptions.cs +++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs @@ -28,6 +28,7 @@ public class EncodingOptions VaapiDevice = "/dev/dri/renderD128"; EnableTonemapping = false; EnableVppTonemapping = false; + EnableVideoToolboxTonemapping = false; TonemappingAlgorithm = "bt2390"; TonemappingMode = "auto"; TonemappingRange = "auto";