mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 08:27:44 +01:00
Fix limited range JPEG extraction
This commit is contained in:
@@ -50,7 +50,6 @@ namespace Flowframes.Media
|
||||
if (Interpolate.currentMediaFile != null && Interpolate.currentMediaFile.VideoStreams.Any())
|
||||
{
|
||||
pixFmt = Interpolate.currentMediaFile.VideoStreams.First().PixelFormat;
|
||||
pixFmt = SimplifyPixFmt(pixFmt);
|
||||
}
|
||||
|
||||
bool inputHighBitDepth = pixFmt.Contains("p10") || pixFmt.Contains("p16");
|
||||
@@ -66,12 +65,12 @@ namespace Flowframes.Media
|
||||
else if (extension == "jpg")
|
||||
{
|
||||
// Fallback to YUV420P if not in list of supported formats
|
||||
if (!new[] { "yuv420p", "yuv422p", "yuv444p" }.Contains(pixFmt))
|
||||
if (!new[] { "yuv420p", "yuv422p", "yuv444p" }.Contains(pixFmt.Replace("yuvj", "yuv")))
|
||||
{
|
||||
pixFmt = "yuv420p";
|
||||
}
|
||||
|
||||
args = $"-q:v 1";
|
||||
args = $"-q:v 1 -qmin 1 -color_range pc";
|
||||
}
|
||||
else if (extension == "tiff")
|
||||
{
|
||||
@@ -98,14 +97,6 @@ namespace Flowframes.Media
|
||||
return args;
|
||||
}
|
||||
|
||||
private static string SimplifyPixFmt (string pixFmt)
|
||||
{
|
||||
pixFmt = pixFmt.Lower();
|
||||
pixFmt = pixFmt.Replace("yuvj", "yuv");
|
||||
pixFmt = pixFmt.Replace("bgra", "rgba");
|
||||
return pixFmt;
|
||||
}
|
||||
|
||||
public static async Task VideoToFrames(string inputFile, string framesDir, bool alpha, Fraction rate, bool deDupe, bool delSrc, Size size, string format)
|
||||
{
|
||||
Logger.Log("Extracting video frames from input video...");
|
||||
|
||||
Reference in New Issue
Block a user