Browse Source

fix software tonemap with nvidia (#2082)

pull/2083/head
Jason Dove 2 months ago committed by GitHub
parent
commit
27c701b936
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 17
      ErsatzTV.FFmpeg/Filter/TonemapFilter.cs

1
CHANGELOG.md

@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -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

17
ErsatzTV.FFmpeg/Filter/TonemapFilter.cs

@ -19,16 +19,25 @@ public class TonemapFilter : BaseFilter @@ -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}";

Loading…
Cancel
Save