mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Basic ffprobe test
This commit is contained in:
parent
f80d1fa3a6
commit
47916eac29
4 changed files with 26 additions and 0 deletions
|
@ -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>
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
FFMpegCore.Test/Resources/sample.srt
Normal file
12
FFMpegCore.Test/Resources/sample.srt
Normal 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>
|
Loading…
Reference in a new issue