Skip to content
Snippets Groups Projects
Commit c0539b7a authored by Anduin Xue's avatar Anduin Xue
Browse files

Only parser larger than 20MB.

parent 3e3800ca
No related branches found
No related tags found
No related merge requests found
......@@ -56,11 +56,12 @@ namespace Parser
{
var folder = Path.GetDirectoryName(filePath) ?? throw new Exception($"{filePath} is invalid!");
var baseFileInfo = await _commandService.RunCommand("ffmpeg.exe", $@"-i ""{filePath}""", folder);
var shouldParse =
var fileInfo = new FileInfo(filePath);
var shouldParse =
fileInfo.Length > 20 * 1024 * 1024 && // 20MB
!baseFileInfo.Contains("Video: hevc") || // Not HEVC
baseFileInfo.Contains("creation_time") || // Or contains privacy info
!filePath.EndsWith(".mp4"); // Or not MP4
var fileInfo = new FileInfo(filePath);
var bareName = Path.GetFileNameWithoutExtension(filePath);
var newFileName = $"{fileInfo.Directory}{Path.DirectorySeparatorChar}{bareName}_265.mp4";
if (shouldParse)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment