mirror of https://github.com/ErsatzTV/ErsatzTV.git
8 changed files with 67 additions and 76 deletions
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
namespace ErsatzTV.FFmpeg.Environment; |
||||
|
||||
public class CudaVisibleDevicesVariable(string visibleDevices) : IPipelineStep |
||||
{ |
||||
public EnvironmentVariable[] EnvironmentVariables => |
||||
[ |
||||
new("CUDA_VISIBLE_DEVICES", visibleDevices) |
||||
]; |
||||
|
||||
public string[] GlobalOptions => []; |
||||
public string[] InputOptions(InputFile inputFile) => []; |
||||
public string[] FilterOptions => []; |
||||
public string[] OutputOptions => []; |
||||
public FrameState NextState(FrameState currentState) => currentState; |
||||
} |
||||
@ -1,12 +1,19 @@
@@ -1,12 +1,19 @@
|
||||
using ErsatzTV.FFmpeg.Format; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Filter.Qsv; |
||||
|
||||
public class TonemapQsvFilter : BaseFilter |
||||
public class TonemapQsvFilter(IPixelFormat desiredPixelFormat) : BaseFilter |
||||
{ |
||||
public override string Filter => "vpp_qsv=tonemap=1"; |
||||
public override string Filter => |
||||
desiredPixelFormat.BitDepth == 8 |
||||
? $"vpp_qsv=tonemap=1:format=nv12" |
||||
: $"vpp_qsv=tonemap=1:format=p010le"; |
||||
|
||||
public override FrameState NextState(FrameState currentState) |
||||
{ |
||||
return desiredPixelFormat.BitDepth == 8 |
||||
? currentState with { FrameDataLocation = FrameDataLocation.Hardware, PixelFormat = new PixelFormatNv12(desiredPixelFormat.Name) } |
||||
: currentState with { FrameDataLocation = FrameDataLocation.Hardware, PixelFormat = new PixelFormatP010() }; |
||||
} |
||||
|
||||
public override FrameState NextState(FrameState currentState) => |
||||
currentState with |
||||
{ |
||||
FrameDataLocation = FrameDataLocation.Hardware |
||||
}; |
||||
} |
||||
|
||||
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
namespace ErsatzTV.FFmpeg.OutputOption; |
||||
|
||||
public class ColorMetadataOutputOption : OutputOption |
||||
{ |
||||
public override string[] OutputOptions => |
||||
[ |
||||
"-color_primaries", "bt709", |
||||
"-color_trc", "bt709", |
||||
"-colorspace", "bt709", |
||||
"-color_range", "tv" |
||||
]; |
||||
} |
||||
Loading…
Reference in new issue