made test resize the output

This commit is contained in:
Fredrik Hagfjäll 2024-03-30 09:29:25 +01:00
parent 82cc9715dc
commit 7697e2767d

View file

@ -484,14 +484,14 @@ public void Video_Snapshot_PersistSnapshot()
public void Video_Snapshot_Rotated_PersistSnapshot()
{
using var outputPath = new TemporaryFile("out.png");
var input = FFProbe.Analyse(TestResources.Mp4VideoRotationNegative);
FFMpeg.Snapshot(TestResources.Mp4VideoRotationNegative, outputPath);
var size = new Size(360, 0); // half the size of original video, keeping height 0 for keeping aspect ratio
FFMpeg.Snapshot(TestResources.Mp4VideoRotationNegative, outputPath, size);
var analysis = FFProbe.Analyse(outputPath);
// height and width should be swapped
Assert.AreEqual(input.PrimaryVideoStream!.Height, analysis.PrimaryVideoStream!.Width);
Assert.AreEqual(input.PrimaryVideoStream.Width, analysis.PrimaryVideoStream!.Height);
Assert.AreEqual(size.Width, analysis.PrimaryVideoStream!.Width);
Assert.AreEqual(1280/2, analysis.PrimaryVideoStream!.Height);
Assert.AreEqual(0, analysis.PrimaryVideoStream!.Rotation);
Assert.AreEqual("png", analysis.PrimaryVideoStream!.CodecName);
}