FF-1493: Added ability to save images to the file log

This commit is contained in:
John Andrews
2024-04-24 18:39:45 +12:00
parent 2f65ac9805
commit a1700d11ae
3 changed files with 6 additions and 3 deletions
Binary file not shown.
Binary file not shown.
@@ -218,7 +218,8 @@ public class FfmpegBuilderCropBlackBars : FfmpegBuilderNode
FileName = ffmpeg,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
RedirectStandardError = true,
CreateNoWindow = true
};
// Specify arguments using ArgumentList to avoid escaping issues
@@ -230,6 +231,8 @@ public class FfmpegBuilderCropBlackBars : FfmpegBuilderNode
// psi.ArgumentList.Add("select=eq(n\\,0),scale=640:480");
psi.ArgumentList.Add("-vframes");
psi.ArgumentList.Add("1");
psi.ArgumentList.Add("-update");
psi.ArgumentList.Add("1");
psi.ArgumentList.Add(destination);
// Start the process
@@ -243,10 +246,10 @@ public class FfmpegBuilderCropBlackBars : FfmpegBuilderNode
if (process.WaitForExit(30_000) == false)
{
args.Logger?.ELog("Timed out extracting image");
return false;
return File.Exists(destination);
}
if (process.ExitCode == 0)
if (File.Exists(destination))
return true;
args.Logger?.WLog($"Error extracting frame: {error}");
return false;