* fix subtitles test and nvidia subtitles * new ffmpeg pipelines; software and nvidia * partial qsv * fix qsv * fix software pipeline * add vaapi pipeline * fix qsv 10-bit h264 output * nvidia fixes * properly disable 10-bit h264 hardware encoders * more nvidia fixes * add video toolbox pipeline
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using ErsatzTV.FFmpeg.Format;
|
|
|
|
namespace ErsatzTV.FFmpeg.Filter;
|
|
|
|
public class YadifFilter : BaseFilter
|
|
{
|
|
private readonly FrameState _currentState;
|
|
|
|
// TODO: accept frame data location instead of current state
|
|
public YadifFilter(FrameState currentState) => _currentState = currentState;
|
|
|
|
public override string Filter
|
|
{
|
|
get
|
|
{
|
|
string hwdownload = string.Empty;
|
|
if (_currentState.FrameDataLocation == FrameDataLocation.Hardware)
|
|
{
|
|
hwdownload = "hwdownload,";
|
|
foreach (IPixelFormat pixelFormat in _currentState.PixelFormat)
|
|
{
|
|
if (pixelFormat.FFmpegName == FFmpegFormat.NV12)
|
|
{
|
|
hwdownload = "hwdownload,format=nv12,";
|
|
}
|
|
}
|
|
}
|
|
|
|
return $"{hwdownload}yadif=1";
|
|
}
|
|
}
|
|
|
|
public override FrameState NextState(FrameState currentState) => currentState with
|
|
{
|
|
Deinterlaced = true,
|
|
FrameDataLocation = FrameDataLocation.Software
|
|
};
|
|
}
|