Batch Processing fixes and improvements

This commit is contained in:
N00MKRAD
2021-05-30 15:03:24 +02:00
parent c53bf9166f
commit 2fda79aad7
6 changed files with 48 additions and 37 deletions

View File

@@ -109,6 +109,7 @@ namespace Flowframes
if (entry.Contains(" fps") && !entry.Contains("Input ")) // Avoid reading FPS from the filename, in case filename contains "fps"
{
string num = entry.Replace(" fps", "").Trim().Replace(",", ".");
Logger.Log($"Float FPS from ffmpeg: {num.GetFloat()}", true, false, "ffmpeg");
ffmpegFps = new Fraction(num.GetFloat());
}
}
@@ -118,10 +119,14 @@ namespace Flowframes
Logger.Log("GetFramerate ffmpeg Error: " + ffmpegEx.Message, true, false);
}
if(preferFfmpeg)
Logger.Log($"ffmpegFps.GetFloat() = {ffmpegFps.GetFloat()}", true, false, "ffmpeg");
if (preferFfmpeg)
{
Logger.Log($"preferring ffmpeg");
if (ffmpegFps.GetFloat() > 0)
return ffmpegFps;
{ Logger.Log($"returning {ffmpegFps}"); return ffmpegFps; }
else
return ffprobeFps;
}

View File

@@ -75,7 +75,7 @@ namespace Flowframes.Media
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...");
Logger.Log($"VideoToFrames() - Alpha: {alpha} - Size: {size}", true, false, "ffmpeg");
Logger.Log($"VideoToFrames() - Alpha: {alpha} - Rate: {rate} - Size: {size} - Format: {format}", true, false, "ffmpeg");
string sizeStr = (size.Width > 1 && size.Height > 1) ? $"-s {size.Width}x{size.Height}" : "";
IOUtils.CreateDir(framesDir);
string mpStr = deDupe ? ((Config.GetInt(Config.Key.mpdecimateMode) == 0) ? mpDecDef : mpDecAggr) : "";