test(core/browser/platform): 26 extreme RED/GREEN TDD cycles and full regression hardening (3,235 PASS)
This commit is contained in:
parent
bcd242691f
commit
8677853822
100 changed files with 4814 additions and 333 deletions
|
|
@ -65,6 +65,15 @@ public static class VideoPosterExtractor
|
|||
string outputImagePath,
|
||||
PosterExtractionSpec spec)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(inputVideoPath)) throw new ArgumentException("Input video path cannot be null or whitespace.", nameof(inputVideoPath));
|
||||
if (string.IsNullOrWhiteSpace(outputImagePath)) throw new ArgumentException("Output image path cannot be null or whitespace.", nameof(outputImagePath));
|
||||
|
||||
var cleanIn = inputVideoPath.Trim().Replace("\"", "");
|
||||
var cleanOut = outputImagePath.Trim().Replace("\"", "");
|
||||
|
||||
if (string.Equals(System.IO.Path.GetFullPath(cleanIn), System.IO.Path.GetFullPath(cleanOut), StringComparison.OrdinalIgnoreCase))
|
||||
throw new InvalidOperationException("입력 파일과 출력 파일 경로가 동일할 수 없습니다.");
|
||||
|
||||
var seekStr = spec.SeekTimeSec.ToString("F2", CultureInfo.InvariantCulture);
|
||||
var scaleFilter = BuildScalingFilter(spec);
|
||||
|
||||
|
|
@ -75,6 +84,6 @@ public static class VideoPosterExtractor
|
|||
_ => "-q:v 2"
|
||||
};
|
||||
|
||||
return $"-ss {seekStr} -i \"{inputVideoPath}\" -vframes 1 -vf \"{scaleFilter}\" {encoderFlags} \"{outputImagePath}\" -y";
|
||||
return $"-ss {seekStr} -i \"{cleanIn}\" -vframes 1 -vf \"{scaleFilter}\" {encoderFlags} \"{cleanOut}\" -y";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue