Config key for image sequence analysis sample count

This commit is contained in:
N00MKRAD
2021-08-31 11:42:58 +02:00
parent 0122ad9bb3
commit 3b1583a08d
2 changed files with 3 additions and 1 deletions

View File

@@ -343,6 +343,7 @@ namespace Flowframes.IO
h265Crf,
av1Crf,
imgSeqFormat,
imgSeqSampleCount,
jpegFrames,
jpegInterp,
keepAspectRatio,

View File

@@ -166,7 +166,8 @@ namespace Flowframes.Media
return false;
}
Image[] randomSamples = files.OrderBy(arg => Guid.NewGuid()).Take(10).Select(x => IoUtils.GetImage(x.FullName)).ToArray();
int sampleCount = Config.GetInt(Config.Key.imgSeqSampleCount, 10);
Image[] randomSamples = files.OrderBy(arg => Guid.NewGuid()).Take(sampleCount).Select(x => IoUtils.GetImage(x.FullName)).ToArray();
bool allSameSize = randomSamples.All(i => i.Size == randomSamples.First().Size);