From 7697e2767d22d6316c91681b5f3dff541e23bd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Hagfj=C3=A4ll?= Date: Sat, 30 Mar 2024 09:29:25 +0100 Subject: [PATCH] made test resize the output --- FFMpegCore.Test/VideoTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs index ee6c5de..4d516c9 100644 --- a/FFMpegCore.Test/VideoTest.cs +++ b/FFMpegCore.Test/VideoTest.cs @@ -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); }