diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eaafe5a..c454c62d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fix QSV acceleration in docker with older Intel devices +- Fix software tonemap when used with NVIDIA accel (`ETV_DISABLE_VULKAN` env var) ## [25.2.0] - 2025-06-24 ### Added diff --git a/ErsatzTV.FFmpeg/Filter/TonemapFilter.cs b/ErsatzTV.FFmpeg/Filter/TonemapFilter.cs index 23b24a41..20bfc66a 100644 --- a/ErsatzTV.FFmpeg/Filter/TonemapFilter.cs +++ b/ErsatzTV.FFmpeg/Filter/TonemapFilter.cs @@ -19,16 +19,25 @@ public class TonemapFilter : BaseFilter { get { - string pixelFormat = _currentState.PixelFormat.Match(pf => pf.FFmpegName, () => string.Empty); - var tonemap = $"zscale=transfer=linear,tonemap={_ffmpegState.TonemapAlgorithm},zscale=transfer=bt709,format={_desiredPixelFormat.FFmpegName}"; if (_currentState.FrameDataLocation == FrameDataLocation.Hardware) { - if (!string.IsNullOrWhiteSpace(pixelFormat)) + foreach (IPixelFormat pixelFormat in _currentState.PixelFormat) { - return $"hwdownload,format={pixelFormat},{tonemap}"; + if (pixelFormat is PixelFormatCuda) + { + foreach (IPixelFormat pf in AvailablePixelFormats.ForPixelFormat(pixelFormat.Name, null)) + { + return $"hwdownload,format={pf.FFmpegName},{tonemap}"; + } + } + + if (!string.IsNullOrWhiteSpace(pixelFormat.FFmpegName)) + { + return $"hwdownload,format={pixelFormat.FFmpegName},{tonemap}"; + } } return $"hwdownload,{tonemap}";