Skip to content

Commit

Permalink
made test resize the output
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagfjall committed Mar 30, 2024
1 parent 82cc971 commit 7697e27
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions FFMpegCore.Test/VideoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7697e27

Please sign in to comment.