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.
22 lines
703 B
22 lines
703 B
namespace ErsatzTV.FFmpeg.Filter; |
|
|
|
public class HardwareUploadFilter : BaseFilter |
|
{ |
|
private readonly FFmpegState _ffmpegState; |
|
|
|
public HardwareUploadFilter(FFmpegState ffmpegState) |
|
{ |
|
_ffmpegState = ffmpegState; |
|
} |
|
|
|
public override FrameState NextState(FrameState currentState) => currentState; |
|
|
|
public override string Filter => _ffmpegState.HardwareAccelerationMode switch |
|
{ |
|
HardwareAccelerationMode.None => string.Empty, |
|
HardwareAccelerationMode.Nvenc => "hwupload_cuda", |
|
HardwareAccelerationMode.Qsv => "hwupload=extra_hw_frames=64", |
|
HardwareAccelerationMode.Vaapi => "format=nv12|vaapi,hwupload", |
|
_ => "hwupload" |
|
}; |
|
}
|
|
|