use proper nvidia accel output format for 10-bit content (#865)

This commit is contained in:
Jason Dove
2022-06-17 11:33:10 -05:00
committed by GitHub
parent 3204da8e43
commit d114db091e
5 changed files with 59 additions and 8 deletions
+19
View File
@@ -1,4 +1,5 @@
using ErsatzTV.FFmpeg.Environment;
using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.FFmpeg.Decoder;
@@ -20,4 +21,22 @@ public abstract class DecoderBase : IDecoder
public bool AppliesTo(VideoInputFile videoInputFile) => true;
public bool AppliesTo(ConcatInputFile concatInputFile) => false;
protected int InputBitDepth(InputFile inputFile)
{
var bitDepth = 8;
if (inputFile is VideoInputFile videoInputFile)
{
foreach (VideoStream videoStream in videoInputFile.VideoStreams.HeadOrNone())
{
foreach (IPixelFormat pixelFormat in videoStream.PixelFormat)
{
bitDepth = pixelFormat.BitDepth;
}
}
}
return bitDepth;
}
}