fixing pixel format issue

This commit is contained in:
John Andrews
2024-01-29 02:29:34 +13:00
parent 1fc5e86645
commit 19a746f385
2 changed files with 2 additions and 4 deletions

View File

@@ -197,7 +197,7 @@ public class FfmpegBuilderExecutor: FfmpegBuilderNode
if (targetIs10Bit && video?.Stream?.Is10Bit == true)
pxtFormat = "p010le";
else if (targetIs10Bit == false && video?.Stream?.Is10Bit == false && video?.Stream?.Is12Bit == false)
pxtFormat = "yuv420p";
pxtFormat = "nv12";
else if (targetIs10Bit)
pxtFormat = string.Empty; // clear it, if we use a 8bit pixel format this will break the colours
@@ -296,8 +296,6 @@ public class FfmpegBuilderExecutor: FfmpegBuilderNode
continue;
}
if (hwOrig.Any(x => x.Contains("qsv")) && pixelFormat == "yuv420p")
pixelFormat = "nv12";
var hw = hwOrig.Select(x => x.Replace("#FORMAT#", pixelFormat)).ToArray();

View File

@@ -461,7 +461,7 @@ public class VideoInfoHelper
if(Regex.IsMatch(line, @"p(0)?10l(b)?e"))
return "p010le";
if(line.IndexOf("yuv420p", StringComparison.Ordinal) > 0)
return "yuv420p";
return "nv12"; // use nv12 instead of yuv420p
// if (line.IndexOf("nv12", StringComparison.Ordinal) >= 0)
// return "nv12";
// if (line.IndexOf("yuv444p", StringComparison.Ordinal) >= 0)