|
|
|
@ -134,6 +134,12 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
foreach (IDecoder decoder in maybeDecoder) |
|
|
|
foreach (IDecoder decoder in maybeDecoder) |
|
|
|
{ |
|
|
|
{ |
|
|
|
videoInputFile.AddOption(decoder); |
|
|
|
videoInputFile.AddOption(decoder); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ffmpegState.DecoderHardwareAccelerationMode is HardwareAccelerationMode.Nvenc) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
videoInputFile.FilterSteps.Add(new HardwareUploadCudaFilter(FrameDataLocation.Unknown)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Some(decoder); |
|
|
|
return Some(decoder); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -266,7 +272,7 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
&& !context.HasSubtitleText |
|
|
|
&& !context.HasSubtitleText |
|
|
|
&& (context.HasSubtitleOverlay || context.HasWatermark || context.HasGraphicsEngine)) |
|
|
|
&& (context.HasSubtitleOverlay || context.HasWatermark || context.HasGraphicsEngine)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var hardwareUpload = new HardwareUploadCudaFilter(currentState); |
|
|
|
var hardwareUpload = new HardwareUploadCudaFilter(currentState.FrameDataLocation); |
|
|
|
currentState = hardwareUpload.NextState(currentState); |
|
|
|
currentState = hardwareUpload.NextState(currentState); |
|
|
|
videoInputFile.FilterSteps.Add(hardwareUpload); |
|
|
|
videoInputFile.FilterSteps.Add(hardwareUpload); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -562,7 +568,7 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
watermark.FilterSteps.Add( |
|
|
|
watermark.FilterSteps.Add( |
|
|
|
new HardwareUploadCudaFilter(currentState with { FrameDataLocation = FrameDataLocation.Software })); |
|
|
|
new HardwareUploadCudaFilter(FrameDataLocation.Software)); |
|
|
|
|
|
|
|
|
|
|
|
var watermarkFilter = new OverlayWatermarkCudaFilter( |
|
|
|
var watermarkFilter = new OverlayWatermarkCudaFilter( |
|
|
|
watermark.DesiredState, |
|
|
|
watermark.DesiredState, |
|
|
|
@ -612,7 +618,7 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
|
|
|
|
|
|
|
|
if (context.HasWatermark || context.HasGraphicsEngine) |
|
|
|
if (context.HasWatermark || context.HasGraphicsEngine) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var subtitleHardwareUpload = new HardwareUploadCudaFilter(currentState); |
|
|
|
var subtitleHardwareUpload = new HardwareUploadCudaFilter(currentState.FrameDataLocation); |
|
|
|
currentState = subtitleHardwareUpload.NextState(currentState); |
|
|
|
currentState = subtitleHardwareUpload.NextState(currentState); |
|
|
|
videoInputFile.FilterSteps.Add(subtitleHardwareUpload); |
|
|
|
videoInputFile.FilterSteps.Add(subtitleHardwareUpload); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -626,8 +632,7 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_ffmpegCapabilities.HasFilter(FFmpegKnownFilter.ScaleNpp)) |
|
|
|
if (_ffmpegCapabilities.HasFilter(FFmpegKnownFilter.ScaleNpp)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var subtitleHardwareUpload = new HardwareUploadCudaFilter( |
|
|
|
var subtitleHardwareUpload = new HardwareUploadCudaFilter(FrameDataLocation.Software); |
|
|
|
currentState with { FrameDataLocation = FrameDataLocation.Software }); |
|
|
|
|
|
|
|
subtitle.FilterSteps.Add(subtitleHardwareUpload); |
|
|
|
subtitle.FilterSteps.Add(subtitleHardwareUpload); |
|
|
|
|
|
|
|
|
|
|
|
// only scale if scaling or padding was used for main video stream
|
|
|
|
// only scale if scaling or padding was used for main video stream
|
|
|
|
@ -648,8 +653,7 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
subtitle.FilterSteps.Add(scaleFilter); |
|
|
|
subtitle.FilterSteps.Add(scaleFilter); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var subtitleHardwareUpload = new HardwareUploadCudaFilter( |
|
|
|
var subtitleHardwareUpload = new HardwareUploadCudaFilter(FrameDataLocation.Software); |
|
|
|
currentState with { FrameDataLocation = FrameDataLocation.Software }); |
|
|
|
|
|
|
|
subtitle.FilterSteps.Add(subtitleHardwareUpload); |
|
|
|
subtitle.FilterSteps.Add(subtitleHardwareUpload); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -700,8 +704,7 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
{ |
|
|
|
{ |
|
|
|
graphicsEngine.FilterSteps.Add(new PixelFormatFilter(new PixelFormatYuva420P())); |
|
|
|
graphicsEngine.FilterSteps.Add(new PixelFormatFilter(new PixelFormatYuva420P())); |
|
|
|
|
|
|
|
|
|
|
|
graphicsEngine.FilterSteps.Add( |
|
|
|
graphicsEngine.FilterSteps.Add(new HardwareUploadCudaFilter(FrameDataLocation.Software)); |
|
|
|
new HardwareUploadCudaFilter(currentState with { FrameDataLocation = FrameDataLocation.Software })); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var graphicsEngineFilter = new OverlayGraphicsEngineCudaFilter(); |
|
|
|
var graphicsEngineFilter = new OverlayGraphicsEngineCudaFilter(); |
|
|
|
graphicsEngineOverlayFilterSteps.Add(graphicsEngineFilter); |
|
|
|
graphicsEngineOverlayFilterSteps.Add(graphicsEngineFilter); |
|
|
|
|