Browse Source

more nvidia fixes (#661)

* dont use mpeg2_cuvid with interlaced content

* fix nvidia scaling when padding is not needed
pull/662/head
Jason Dove 3 years ago committed by GitHub
parent
commit
f8412c4f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ErsatzTV.FFmpeg/Decoder/AvailableDecoders.cs
  2. 8
      ErsatzTV.FFmpeg/Filter/Cuda/ScaleCudaFilter.cs

4
ErsatzTV.FFmpeg/Decoder/AvailableDecoders.cs

@ -23,6 +23,10 @@ public static class AvailableDecoders @@ -23,6 +23,10 @@ public static class AvailableDecoders
(HardwareAccelerationMode.Nvenc, VideoFormat.H264, PixelFormat.YUV420P10LE or PixelFormat.YUV444P10LE)
=> new DecoderH264(),
// mpeg2_cuvid seems to have issues when yadif_cuda is used, so just use software decoding
(HardwareAccelerationMode.Nvenc, VideoFormat.Mpeg2Video, _) when desiredState.Deinterlaced =>
new DecoderMpeg2Video(),
(HardwareAccelerationMode.Nvenc, VideoFormat.H264, _) => new DecoderH264Cuvid(),
(HardwareAccelerationMode.Nvenc, VideoFormat.Mpeg2Video, _) => new DecoderMpeg2Cuvid(
desiredState.Deinterlaced),

8
ErsatzTV.FFmpeg/Filter/Cuda/ScaleCudaFilter.cs

@ -37,7 +37,13 @@ public class ScaleCudaFilter : BaseFilter @@ -37,7 +37,13 @@ public class ScaleCudaFilter : BaseFilter
format = $":format={pixelFormat.FFmpegName}";
}
scale = $"scale_cuda={targetSize}:force_original_aspect_ratio=1{format}";
string aspectRatio = string.Empty;
if (_scaledSize != _paddedSize)
{
aspectRatio = ":force_original_aspect_ratio=1";
}
scale = $"scale_cuda={targetSize}{aspectRatio}{format}";
}
// TODO: this might not always upload to hardware, so NextState could be inaccurate

Loading…
Cancel
Save