Basic ffprobe test

This commit is contained in:
alex6dj 2021-07-31 16:46:21 -04:00
parent f80d1fa3a6
commit 47916eac29
4 changed files with 26 additions and 0 deletions

View file

@ -83,6 +83,9 @@
<None Update="Resources\mute.mp4"> <None Update="Resources\mute.mp4">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Update="Resources\sample.srt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -100,5 +100,15 @@ public async Task Probe_Success_FromStream_Async()
var info = await FFProbe.AnalyseAsync(stream); var info = await FFProbe.AnalyseAsync(stream);
Assert.AreEqual(3, info.Duration.Seconds); Assert.AreEqual(3, info.Duration.Seconds);
} }
[TestMethod, Timeout(10000)]
public async Task Probe_Success_Subtitle_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.SrtSubtitle);
Assert.IsNotNull(info.PrimarySubtitleStream);
Assert.AreEqual(1, info.SubtitleStreams.Count);
Assert.AreEqual(0, info.AudioStreams.Count);
Assert.AreEqual(0, info.VideoStreams.Count);
}
} }
} }

View file

@ -20,5 +20,6 @@ public static class TestResources
public static readonly string Mp3Audio = "./Resources/audio.mp3"; public static readonly string Mp3Audio = "./Resources/audio.mp3";
public static readonly string PngImage = "./Resources/cover.png"; public static readonly string PngImage = "./Resources/cover.png";
public static readonly string ImageCollection = "./Resources/images"; public static readonly string ImageCollection = "./Resources/images";
public static readonly string SrtSubtitle = "./Resources/sample.srt";
} }
} }

View file

@ -0,0 +1,12 @@
1
00:00:00,000 --> 00:00:01,500
For www.forom.com
2
00:00:01,500 --> 00:00:02,500
<i>Tonight's the night.</i>
3
00:00:03,000 --> 00:00:15,000
<i>And it's going to happen
again and again --</i>