diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c1776106..91e42d73d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,7 +55,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Automatically kill playback troubleshooting ffmpeg process if it hasn't completed after two minutes - Fix playback of certain BT.2020 content - Use playlist item count when using a playlist as filler (instead of a fixed count of 1 for each playlist item) -- NVIDIA: fix stream failure with certain content that should decode in hardware but falls back to software +- NVIDIA: + - Fix stream failure with certain content that should decode in hardware but falls back to software + - Fix stream failure with content that changes color metadata mid-stream - Fix stream failure when configured fallback filler collection is empty - Fix high CPU when errors are displayed; errors will now work ahead before throttling to realtime, similar to primary content - Fix startup error caused by duplicate smart collection names (and no longer allow duplicate smart collection names) diff --git a/ErsatzTV.FFmpeg/Pipeline/NvidiaPipelineBuilder.cs b/ErsatzTV.FFmpeg/Pipeline/NvidiaPipelineBuilder.cs index 2aaf2a8de..98aa2ecd0 100644 --- a/ErsatzTV.FFmpeg/Pipeline/NvidiaPipelineBuilder.cs +++ b/ErsatzTV.FFmpeg/Pipeline/NvidiaPipelineBuilder.cs @@ -364,6 +364,18 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder desiredState.CroppedSize.IfNone(desiredState.PaddedSize))); } + // unknown color params can *change* during transcoding, + // which can cause ffmpeg to insert an autoscale filter that + // cannot accept hardware frames. + // this filter isn't actually needed (the encoder accepts the frames just fine) so disable it + if (ffmpegState.EncoderHardwareAccelerationMode is HardwareAccelerationMode.Nvenc && + currentState.FrameDataLocation is FrameDataLocation.Hardware && + videoStream.ColorParams.IsUnknown && + (context.HasGraphicsEngine || context.HasSubtitleOverlay || context.HasWatermark)) + { + pipelineSteps.Add(new NoAutoScaleOutputOption()); + } + return new FilterChain( videoInputFile.FilterSteps, watermarkInputFile.Map(wm => wm.FilterSteps).IfNone([]),