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.
32 lines
1.1 KiB
32 lines
1.1 KiB
namespace ErsatzTV.FFmpeg.Filter; |
|
|
|
public class SubtitleHardwareUploadFilter : BaseFilter |
|
{ |
|
private readonly FrameState _currentState; |
|
private readonly FFmpegState _ffmpegState; |
|
|
|
public SubtitleHardwareUploadFilter(FrameState currentState, FFmpegState ffmpegState) |
|
{ |
|
_currentState = currentState; |
|
_ffmpegState = ffmpegState; |
|
} |
|
|
|
public override string Filter => |
|
_ffmpegState.EncoderHardwareAccelerationMode switch |
|
{ |
|
HardwareAccelerationMode.None => string.Empty, |
|
HardwareAccelerationMode.Nvenc => "hwupload_cuda", |
|
HardwareAccelerationMode.Qsv => "hwupload=extra_hw_frames=64", |
|
|
|
// leave vaapi in software since we don't (yet) use overlay_vaapi |
|
HardwareAccelerationMode.Vaapi when _currentState.FrameDataLocation == FrameDataLocation.Software => |
|
string.Empty, |
|
|
|
// leave videotoolbox in software since we use a software overlay filter |
|
HardwareAccelerationMode.VideoToolbox => string.Empty, |
|
|
|
_ => "hwupload" |
|
}; |
|
|
|
public override FrameState NextState(FrameState currentState) => currentState; |
|
}
|
|
|