mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
namespace ErsatzTV.FFmpeg.Decoder.Cuvid; |
|
|
|
public class DecoderH264Cuvid : DecoderBase |
|
{ |
|
private readonly FFmpegState _ffmpegState; |
|
|
|
public DecoderH264Cuvid(FFmpegState ffmpegState) => _ffmpegState = ffmpegState; |
|
|
|
public override string Name => "h264_cuvid"; |
|
|
|
protected override FrameDataLocation OutputFrameDataLocation => |
|
_ffmpegState.EncoderHardwareAccelerationMode == HardwareAccelerationMode.None |
|
? FrameDataLocation.Software |
|
: FrameDataLocation.Hardware; |
|
|
|
public override IList<string> InputOptions(InputFile inputFile) |
|
{ |
|
IList<string> result = base.InputOptions(inputFile); |
|
|
|
if (_ffmpegState.EncoderHardwareAccelerationMode != HardwareAccelerationMode.None) |
|
{ |
|
result.Add("-hwaccel_output_format"); |
|
result.Add("cuda"); |
|
} |
|
else |
|
{ |
|
result.Add("-hwaccel_output_format"); |
|
result.Add(InputBitDepth(inputFile) == 10 ? "p010le" : "nv12"); |
|
} |
|
|
|
return result; |
|
} |
|
}
|
|
|