|
|
@ -80,7 +80,8 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
|
|
|
|
|
|
|
|
bool isHdrTonemap = decodeCapability == FFmpegCapability.Hardware |
|
|
|
bool isHdrTonemap = decodeCapability == FFmpegCapability.Hardware |
|
|
|
&& _ffmpegCapabilities.HasHardwareAcceleration(HardwareAccelerationMode.Vulkan) |
|
|
|
&& _ffmpegCapabilities.HasHardwareAcceleration(HardwareAccelerationMode.Vulkan) |
|
|
|
&& videoStream.ColorParams.IsHdr; |
|
|
|
&& videoStream.ColorParams.IsHdr |
|
|
|
|
|
|
|
&& string.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable("ETV_DISABLE_VULKAN")); |
|
|
|
|
|
|
|
|
|
|
|
if (decodeCapability == FFmpegCapability.Hardware || encodeCapability == FFmpegCapability.Hardware) |
|
|
|
if (decodeCapability == FFmpegCapability.Hardware || encodeCapability == FFmpegCapability.Hardware) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -181,9 +182,20 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
// desiredState = desiredState with { PixelFormat = Some(pixelFormat) };
|
|
|
|
// desiredState = desiredState with { PixelFormat = Some(pixelFormat) };
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
currentState = SetTonemap(videoInputFile, videoStream, ffmpegState, desiredState, currentState); |
|
|
|
// vulkan scale doesn't seem to handle HDR, so we need to tonemap before scaling
|
|
|
|
|
|
|
|
if (ffmpegState.IsHdrTonemap) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
currentState = SetTonemap(videoInputFile, videoStream, ffmpegState, desiredState, currentState); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
currentState = SetDeinterlace(videoInputFile, context, currentState); |
|
|
|
currentState = SetDeinterlace(videoInputFile, context, currentState); |
|
|
|
currentState = SetScale(videoInputFile, videoStream, context, ffmpegState, desiredState, currentState); |
|
|
|
currentState = SetScale(videoInputFile, videoStream, context, ffmpegState, desiredState, currentState); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ffmpegState.IsHdrTonemap) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
currentState = SetTonemap(videoInputFile, videoStream, ffmpegState, desiredState, currentState); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
currentState = SetPad(videoInputFile, videoStream, desiredState, currentState); |
|
|
|
currentState = SetPad(videoInputFile, videoStream, desiredState, currentState); |
|
|
|
currentState = SetCrop(videoInputFile, desiredState, currentState); |
|
|
|
currentState = SetCrop(videoInputFile, desiredState, currentState); |
|
|
|
SetStillImageLoop(videoInputFile, videoStream, ffmpegState, desiredState, pipelineSteps); |
|
|
|
SetStillImageLoop(videoInputFile, videoStream, ffmpegState, desiredState, pipelineSteps); |
|
|
@ -673,19 +685,19 @@ public class NvidiaPipelineBuilder : SoftwarePipelineBuilder |
|
|
|
scaleStep = new ScaleCudaFilter( |
|
|
|
scaleStep = new ScaleCudaFilter( |
|
|
|
currentState with |
|
|
|
currentState with |
|
|
|
{ |
|
|
|
{ |
|
|
|
PixelFormat = !context.Is10BitOutput && (context.HasWatermark || |
|
|
|
PixelFormat = context is { IsHdr: false, Is10BitOutput: false } && (context.HasWatermark || |
|
|
|
context.HasSubtitleOverlay || |
|
|
|
context.HasSubtitleOverlay || |
|
|
|
context.ShouldDeinterlace || |
|
|
|
context.ShouldDeinterlace || |
|
|
|
desiredState.ScaledSize != desiredState.PaddedSize || |
|
|
|
desiredState.ScaledSize != desiredState.PaddedSize || |
|
|
|
context.HasSubtitleText || |
|
|
|
context.HasSubtitleText || |
|
|
|
ffmpegState is |
|
|
|
ffmpegState is |
|
|
|
{ |
|
|
|
{ |
|
|
|
DecoderHardwareAccelerationMode: |
|
|
|
DecoderHardwareAccelerationMode: |
|
|
|
HardwareAccelerationMode.Nvenc, |
|
|
|
HardwareAccelerationMode.Nvenc, |
|
|
|
EncoderHardwareAccelerationMode: |
|
|
|
EncoderHardwareAccelerationMode: |
|
|
|
HardwareAccelerationMode.None |
|
|
|
HardwareAccelerationMode.None |
|
|
|
}) |
|
|
|
}) |
|
|
|
? desiredState.PixelFormat.Map(pf => (IPixelFormat)new PixelFormatNv12(pf.Name)) |
|
|
|
? desiredState.PixelFormat.Map(IPixelFormat (pf) => new PixelFormatNv12(pf.Name)) |
|
|
|
: Option<IPixelFormat>.None |
|
|
|
: Option<IPixelFormat>.None |
|
|
|
}, |
|
|
|
}, |
|
|
|
desiredState.ScaledSize, |
|
|
|
desiredState.ScaledSize, |
|
|
|