mirror of https://github.com/ErsatzTV/ErsatzTV.git
23 changed files with 153 additions and 40 deletions
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
namespace ErsatzTV.FFmpeg.Decoder.Cuvid; |
||||
|
||||
public class DecoderImplicitVulkan : DecoderBase |
||||
{ |
||||
protected override FrameDataLocation OutputFrameDataLocation => FrameDataLocation.Hardware; |
||||
public override string Name => string.Empty; |
||||
|
||||
public override string[] InputOptions(InputFile inputFile) => |
||||
[ |
||||
"-hwaccel_output_format", |
||||
"vulkan" |
||||
]; |
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
using ErsatzTV.FFmpeg.Format; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Filter.Cuda; |
||||
|
||||
public class TonemapCudaFilter(IPixelFormat desiredPixelFormat) : BaseFilter |
||||
{ |
||||
public override string Filter => |
||||
$"libplacebo=tonemapping=auto:colorspace=bt709:color_primaries=bt709:color_trc=bt709:format={desiredPixelFormat.FFmpegName},hwupload_cuda"; |
||||
|
||||
public override FrameState NextState(FrameState currentState) => |
||||
currentState with |
||||
{ |
||||
PixelFormat = Some(desiredPixelFormat), |
||||
FrameDataLocation = FrameDataLocation.Hardware |
||||
}; |
||||
} |
@ -1,6 +1,17 @@
@@ -1,6 +1,17 @@
|
||||
namespace ErsatzTV.FFmpeg.GlobalOption.HardwareAcceleration; |
||||
|
||||
public class CudaHardwareAccelerationOption : GlobalOption |
||||
public class CudaHardwareAccelerationOption(bool isVulkanHdr) : GlobalOption |
||||
{ |
||||
public override string[] GlobalOptions => new[] { "-hwaccel", "cuda" }; |
||||
public override string[] GlobalOptions |
||||
{ |
||||
get |
||||
{ |
||||
if (isVulkanHdr) |
||||
{ |
||||
return ["-init_hw_device", "cuda=nv", "-init_hw_device", "vulkan=vk@nv", "-hwaccel", "vulkan"]; |
||||
} |
||||
|
||||
return ["-hwaccel", "cuda"]; |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue