fix nvidia pipeline that only requires setparams (#1074)
This commit is contained in:
@@ -130,6 +130,9 @@ public class TranscodingTests
|
||||
// example format that requires colorspace filter
|
||||
new("libx264", "yuv420p", "tv", "smpte170m", "bt709", "smpte170m"),
|
||||
|
||||
// example format that requires setparams filter
|
||||
new("libx264", "yuv420p", string.Empty, string.Empty, string.Empty, string.Empty),
|
||||
|
||||
// new("libx264", "yuvj420p"),
|
||||
new("libx264", "yuv420p10le"),
|
||||
// new("libx264", "yuv444p10le"),
|
||||
|
||||
@@ -300,13 +300,14 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder
|
||||
|
||||
if (currentState.FrameDataLocation == FrameDataLocation.Hardware)
|
||||
{
|
||||
bool noPipelineFilters = !pipelineSteps.OfType<IPipelineFilterStep>().Any();
|
||||
bool softwareColorspace = result is [ColorspaceFilter colorspace] &&
|
||||
!colorspace.Filter.StartsWith("setparams=");
|
||||
bool noPipelineFilters = !pipelineSteps
|
||||
.Filter(ps => ps is not IEncoder)
|
||||
.OfType<IPipelineFilterStep>().Any();
|
||||
bool hasColorspace = result is [ColorspaceFilter];
|
||||
|
||||
bool softwareDecoder = ffmpegState.DecoderHardwareAccelerationMode == HardwareAccelerationMode.None;
|
||||
|
||||
if (softwareDecoder || (noPipelineFilters && softwareColorspace))
|
||||
if (softwareDecoder || (noPipelineFilters && hasColorspace))
|
||||
{
|
||||
result.Add(new CudaFormatFilter(format));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user