Shorten resources used for testing

This commit is contained in:
Malte Rosenbjerg 2020-10-25 17:11:52 +01:00
parent 31ee7920a9
commit adbd61c51d
12 changed files with 23 additions and 11 deletions

View file

@ -15,6 +15,18 @@
<None Update="Resources\input.webm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\input_3sec.mp4">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\input_3sec.webm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\input_audio_only_10sec.mp4">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\input_video_only_3sec.mp4">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>

View file

@ -18,7 +18,7 @@ public void Probe_TooLongOutput()
public void Probe_Success()
{
var info = FFProbe.Analyse(VideoLibrary.LocalVideo.FullName);
Assert.AreEqual(13, info.Duration.Seconds);
Assert.AreEqual(3, info.Duration.Seconds);
Assert.AreEqual(".mp4", info.Extension);
Assert.AreEqual(VideoLibrary.LocalVideo.FullName, info.Path);
@ -27,10 +27,10 @@ public void Probe_Success()
Assert.AreEqual("AAC (Advanced Audio Coding)", info.PrimaryAudioStream.CodecLongName);
Assert.AreEqual("aac", info.PrimaryAudioStream.CodecName);
Assert.AreEqual("LC", info.PrimaryAudioStream.Profile);
Assert.AreEqual(381988, info.PrimaryAudioStream.BitRate);
Assert.AreEqual(377351, info.PrimaryAudioStream.BitRate);
Assert.AreEqual(48000, info.PrimaryAudioStream.SampleRateHz);
Assert.AreEqual(862991, info.PrimaryVideoStream.BitRate);
Assert.AreEqual(1471810, info.PrimaryVideoStream.BitRate);
Assert.AreEqual(16, info.PrimaryVideoStream.DisplayAspectRatio.Width);
Assert.AreEqual(9, info.PrimaryVideoStream.DisplayAspectRatio.Height);
Assert.AreEqual("yuv420p", info.PrimaryVideoStream.PixelFormat);
@ -48,7 +48,7 @@ public void Probe_Success()
public async Task Probe_Async_Success()
{
var info = await FFProbe.AnalyseAsync(VideoLibrary.LocalVideo.FullName);
Assert.AreEqual(13, info.Duration.Seconds);
Assert.AreEqual(3, info.Duration.Seconds);
}
[TestMethod, Timeout(10000)]
@ -56,7 +56,7 @@ public void Probe_Success_FromStream()
{
using var stream = File.OpenRead(VideoLibrary.LocalVideoWebm.FullName);
var info = FFProbe.Analyse(stream);
Assert.AreEqual(10, info.Duration.Seconds);
Assert.AreEqual(3, info.Duration.Seconds);
}
[TestMethod]
@ -64,7 +64,7 @@ public async Task Probe_Success_FromStream_Async()
{
await using var stream = File.OpenRead(VideoLibrary.LocalVideoWebm.FullName);
var info = await FFProbe.AnalyseAsync(stream);
Assert.AreEqual(10, info.Duration.Seconds);
Assert.AreEqual(3, info.Duration.Seconds);
}
}
}

View file

@ -15,10 +15,10 @@ public enum ImageType
public static class VideoLibrary
{
public static readonly FileInfo LocalVideo = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input.mp4");
public static readonly FileInfo LocalVideoWebm = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input.webm");
public static readonly FileInfo LocalVideoAudioOnly = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}audio_only.mp4");
public static readonly FileInfo LocalVideoNoAudio = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}mute.mp4");
public static readonly FileInfo LocalVideo = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input_3sec.mp4");
public static readonly FileInfo LocalVideoWebm = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input_3sec.webm");
public static readonly FileInfo LocalVideoAudioOnly = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input_audio_only_10sec.mp4");
public static readonly FileInfo LocalVideoNoAudio = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input_video_only_3sec.mp4");
public static readonly FileInfo LocalAudio = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}audio.mp3");
public static readonly FileInfo LocalCover = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}cover.png");
public static readonly FileInfo ImageDirectory = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}images");

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -566,7 +566,7 @@ public void Video_With_Only_Audio_Should_Extract_Metadata()
var video = FFProbe.Analyse(VideoLibrary.LocalVideoAudioOnly.FullName);
Assert.AreEqual(null, video.PrimaryVideoStream);
Assert.AreEqual("aac", video.PrimaryAudioStream.CodecName);
Assert.AreEqual(79.5, video.Duration.TotalSeconds, 0.5);
Assert.AreEqual(3, video.Duration.TotalSeconds, 0.5);
// Assert.AreEqual(1.25, video.Size);
}