FF-1227 - tweaking hw check to use ss instead of -vframes

This commit is contained in:
John Andrews
2024-01-28 11:33:56 +13:00
parent 1d443e8629
commit 4b2a9e7566
2 changed files with 21 additions and 3 deletions
@@ -291,7 +291,10 @@ public class FfmpegBuilderExecutor: FfmpegBuilderNode
{
"-i", localFile,
"-frames:v", "10",
testFile
"-ss", "1",
// instead of file output to null
"-f", "null", "-"
// testFile
});
var result = args.Execute(new ExecuteArgs
@@ -311,7 +314,7 @@ public class FfmpegBuilderExecutor: FfmpegBuilderNode
}
}
args.Logger?.ILog("No hardware decoding availble");
args.Logger?.ILog("No hardware decoding available");
return new string[] { };
}
finally
+16 -1
View File
@@ -55,7 +55,6 @@ public class VideoHasErrors: VideoNode
if (result.NoErrors)
return 2;
args.Logger.WLog(result.Log);
return 1;
}
@@ -115,12 +114,28 @@ public class VideoHasErrors: VideoNode
StartInfo = processStartInfo
};
var line = "Executing: " + (ffmpegPath.IndexOf(" ") > 0 ? "\"" + ffmpegPath + "\"" : ffmpegPath) + " " +
string.Join(" ",
processStartInfo.ArgumentList.Select(x => x.IndexOf(" ") > 0 ? "\"" + x + "\"" : x)
.ToArray());
args.Logger?.ILog(new string('-', line.Length));
args.Logger?.ILog(line);
args.Logger?.ILog(new string('-', line.Length));
process.Start();
string output = process.StandardError.ReadToEnd();
process.WaitForExit();
if (output.Contains("error"))
{
args.Logger?.ILog("Errors detected in file");
args.Logger?.WLog(output);
return (false, output);
}
args.Logger?.ILog("No errors detected");
if(string.IsNullOrWhiteSpace(output) == false)
args.Logger?.ILog(output);
return (true, string.Empty);
}