FFMpegCore/FFMpegCore.Test/FFProbeTests.cs

240 lines
11 KiB
C#
Raw Normal View History

V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
using FFMpegCore.Test.Resources;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FFMpegCore.Test
{
[TestClass]
public class FFProbeTests
{
2020-12-07 00:47:47 +01:00
[TestMethod]
public async Task Audio_FromStream_Duration()
{
2020-12-07 21:00:43 +01:00
var fileAnalysis = await FFProbe.AnalyseAsync(TestResources.WebmVideo);
await using var inputStream = File.OpenRead(TestResources.WebmVideo);
2020-12-07 00:47:47 +01:00
var streamAnalysis = await FFProbe.AnalyseAsync(inputStream);
Assert.IsTrue(fileAnalysis.Duration == streamAnalysis.Duration);
}
2021-10-21 20:36:54 +02:00
[TestMethod]
public void FrameAnalysis_Sync()
{
var frameAnalysis = FFProbe.GetFrames(TestResources.WebmVideo);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
2021-10-21 20:36:54 +02:00
Assert.AreEqual(90, frameAnalysis.Frames.Count);
Assert.IsTrue(frameAnalysis.Frames.All(f => f.PixelFormat == "yuv420p"));
Assert.IsTrue(frameAnalysis.Frames.All(f => f.Height == 360));
Assert.IsTrue(frameAnalysis.Frames.All(f => f.Width == 640));
Assert.IsTrue(frameAnalysis.Frames.All(f => f.MediaType == "video"));
}
[TestMethod]
public async Task FrameAnalysis_Async()
{
var frameAnalysis = await FFProbe.GetFramesAsync(TestResources.WebmVideo);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
2021-10-21 20:36:54 +02:00
Assert.AreEqual(90, frameAnalysis.Frames.Count);
Assert.IsTrue(frameAnalysis.Frames.All(f => f.PixelFormat == "yuv420p"));
Assert.IsTrue(frameAnalysis.Frames.All(f => f.Height == 360));
Assert.IsTrue(frameAnalysis.Frames.All(f => f.Width == 640));
Assert.IsTrue(frameAnalysis.Frames.All(f => f.MediaType == "video"));
}
2021-11-08 15:28:16 +01:00
[TestMethod]
public async Task PacketAnalysis_Async()
{
var packetAnalysis = await FFProbe.GetPacketsAsync(TestResources.WebmVideo);
var packets = packetAnalysis.Packets;
Assert.AreEqual(96, packets.Count);
Assert.IsTrue(packets.All(f => f.CodecType == "video"));
Assert.AreEqual("K_", packets[0].Flags);
Assert.AreEqual(1362, packets.Last().Size);
}
[TestMethod]
public void PacketAnalysis_Sync()
{
var packets = FFProbe.GetPackets(TestResources.WebmVideo).Packets;
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
2021-11-08 15:28:16 +01:00
Assert.AreEqual(96, packets.Count);
Assert.IsTrue(packets.All(f => f.CodecType == "video"));
Assert.AreEqual("K_", packets[0].Flags);
Assert.AreEqual(1362, packets.Last().Size);
}
[TestMethod]
public void PacketAnalysisAudioVideo_Sync()
{
var packets = FFProbe.GetPackets(TestResources.Mp4Video).Packets;
Assert.AreEqual(216, packets.Count);
var actual = packets.Select(f => f.CodecType).Distinct().ToList();
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
var expected = new List<string> { "audio", "video" };
2021-11-08 15:28:16 +01:00
CollectionAssert.AreEquivalent(expected, actual);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
Assert.IsTrue(packets.Where(t => t.CodecType == "audio").All(f => f.Flags == "K_"));
2021-11-08 15:28:16 +01:00
Assert.AreEqual(75, packets.Count(t => t.CodecType == "video"));
Assert.AreEqual(141, packets.Count(t => t.CodecType == "audio"));
}
2021-03-15 23:43:22 +01:00
[DataTestMethod]
[DataRow("0:00:03.008000", 0, 0, 0, 3, 8)]
[DataRow("05:12:59.177", 0, 5, 12, 59, 177)]
2021-03-15 23:50:11 +01:00
[DataRow("149:07:50.911750", 6, 5, 7, 50, 911)]
2021-03-15 23:43:22 +01:00
[DataRow("00:00:00.83", 0, 0, 0, 0, 830)]
public void MediaAnalysis_ParseDuration(string duration, int expectedDays, int expectedHours, int expectedMinutes, int expectedSeconds, int expectedMilliseconds)
{
2021-03-15 23:43:22 +01:00
var ffprobeStream = new FFProbeStream { Duration = duration };
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
var parsedDuration = MediaAnalysisUtils.ParseDuration(ffprobeStream.Duration);
2021-03-15 23:50:11 +01:00
Assert.AreEqual(expectedDays, parsedDuration.Days);
Assert.AreEqual(expectedHours, parsedDuration.Hours);
Assert.AreEqual(expectedMinutes, parsedDuration.Minutes);
Assert.AreEqual(expectedSeconds, parsedDuration.Seconds);
Assert.AreEqual(expectedMilliseconds, parsedDuration.Milliseconds);
}
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
[TestMethod, Ignore("Consistently fails on GitHub Workflow ubuntu agents")]
2021-03-05 18:06:40 +01:00
public async Task Uri_Duration()
{
var fileAnalysis = await FFProbe.AnalyseAsync(new Uri("https://github.com/rosenbjerg/FFMpegCore/raw/master/FFMpegCore.Test/Resources/input_3sec.webm"));
Assert.IsNotNull(fileAnalysis);
}
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
[TestMethod]
public void Probe_Success()
{
2020-12-07 00:47:47 +01:00
var info = FFProbe.Analyse(TestResources.Mp4Video);
2020-10-25 17:11:52 +01:00
Assert.AreEqual(3, info.Duration.Seconds);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
2021-03-05 18:06:40 +01:00
Assert.AreEqual("5.1", info.PrimaryAudioStream!.ChannelLayout);
2020-05-09 17:53:03 +02:00
Assert.AreEqual(6, info.PrimaryAudioStream.Channels);
Assert.AreEqual("AAC (Advanced Audio Coding)", info.PrimaryAudioStream.CodecLongName);
Assert.AreEqual("aac", info.PrimaryAudioStream.CodecName);
Assert.AreEqual("LC", info.PrimaryAudioStream.Profile);
2020-10-25 17:11:52 +01:00
Assert.AreEqual(377351, info.PrimaryAudioStream.BitRate);
2020-05-09 17:53:03 +02:00
Assert.AreEqual(48000, info.PrimaryAudioStream.SampleRateHz);
Assert.AreEqual("mp4a", info.PrimaryAudioStream.CodecTagString);
Assert.AreEqual("0x6134706d", info.PrimaryAudioStream.CodecTag);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
2021-03-05 18:06:40 +01:00
Assert.AreEqual(1471810, info.PrimaryVideoStream!.BitRate);
2020-05-09 17:53:03 +02:00
Assert.AreEqual(16, info.PrimaryVideoStream.DisplayAspectRatio.Width);
Assert.AreEqual(9, info.PrimaryVideoStream.DisplayAspectRatio.Height);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
Assert.AreEqual(1, info.PrimaryVideoStream.SampleAspectRatio.Width);
Assert.AreEqual(1, info.PrimaryVideoStream.SampleAspectRatio.Height);
2020-05-09 17:53:03 +02:00
Assert.AreEqual("yuv420p", info.PrimaryVideoStream.PixelFormat);
Assert.AreEqual(1280, info.PrimaryVideoStream.Width);
Assert.AreEqual(720, info.PrimaryVideoStream.Height);
Assert.AreEqual(25, info.PrimaryVideoStream.AvgFrameRate);
Assert.AreEqual(25, info.PrimaryVideoStream.FrameRate);
Assert.AreEqual("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", info.PrimaryVideoStream.CodecLongName);
Assert.AreEqual("h264", info.PrimaryVideoStream.CodecName);
Assert.AreEqual(8, info.PrimaryVideoStream.BitsPerRawSample);
Assert.AreEqual("Main", info.PrimaryVideoStream.Profile);
Assert.AreEqual("avc1", info.PrimaryVideoStream.CodecTagString);
Assert.AreEqual("0x31637661", info.PrimaryVideoStream.CodecTag);
2020-05-09 17:53:03 +02:00
}
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
[TestMethod]
public void Probe_Rotation()
{
var info = FFProbe.Analyse(TestResources.Mp4Video);
Assert.AreEqual(0, info.PrimaryVideoStream.Rotation);
info = FFProbe.Analyse(TestResources.Mp4VideoRotation);
Assert.AreEqual(90, info.PrimaryVideoStream.Rotation);
}
2020-10-25 17:42:50 +01:00
[TestMethod, Timeout(10000)]
2020-05-09 17:53:03 +02:00
public async Task Probe_Async_Success()
{
2020-12-07 00:47:47 +01:00
var info = await FFProbe.AnalyseAsync(TestResources.Mp4Video);
2020-10-25 17:11:52 +01:00
Assert.AreEqual(3, info.Duration.Seconds);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
Assert.AreEqual(8, info.PrimaryVideoStream.BitDepth);
// This video's audio stream is AAC, which is lossy, so bit depth is meaningless.
Assert.IsNull(info.PrimaryAudioStream.BitDepth);
}
2020-05-10 12:07:28 +02:00
[TestMethod, Timeout(10000)]
2020-04-28 14:21:48 +02:00
public void Probe_Success_FromStream()
{
2020-12-07 00:47:47 +01:00
using var stream = File.OpenRead(TestResources.WebmVideo);
2020-05-08 11:07:51 +02:00
var info = FFProbe.Analyse(stream);
2020-10-25 17:11:52 +01:00
Assert.AreEqual(3, info.Duration.Seconds);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
// This video has no audio stream.
Assert.IsNull(info.PrimaryAudioStream);
2020-04-28 14:21:48 +02:00
}
2020-10-25 17:42:50 +01:00
[TestMethod, Timeout(10000)]
2020-05-08 11:07:51 +02:00
public async Task Probe_Success_FromStream_Async()
2020-04-28 14:21:48 +02:00
{
2020-12-07 00:47:47 +01:00
await using var stream = File.OpenRead(TestResources.WebmVideo);
2020-05-08 11:07:51 +02:00
var info = await FFProbe.AnalyseAsync(stream);
2020-10-25 17:11:52 +01:00
Assert.AreEqual(3, info.Duration.Seconds);
2020-04-28 14:21:48 +02:00
}
2021-07-31 22:46:21 +02:00
[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);
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
// BitDepth is meaningless for subtitles
Assert.IsNull(info.SubtitleStreams[0].BitDepth);
2021-07-31 22:46:21 +02:00
}
[TestMethod, Timeout(10000)]
public async Task Probe_Success_Disposition_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.Mp4Video);
Assert.IsNotNull(info.PrimaryAudioStream);
Assert.IsNotNull(info.PrimaryAudioStream.Disposition);
Assert.AreEqual(true, info.PrimaryAudioStream.Disposition["default"]);
Assert.AreEqual(false, info.PrimaryAudioStream.Disposition["forced"]);
}
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
[TestMethod, Timeout(10000)]
public async Task Probe_Success_Mp3AudioBitDepthNull_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.Mp3Audio);
Assert.IsNotNull(info.PrimaryAudioStream);
// mp3 is lossy, so bit depth is meaningless.
Assert.IsNull(info.PrimaryAudioStream.BitDepth);
}
[TestMethod, Timeout(10000)]
public async Task Probe_Success_VocAudioBitDepth_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.AiffAudio);
Assert.IsNotNull(info.PrimaryAudioStream);
Assert.AreEqual(16, info.PrimaryAudioStream.BitDepth);
}
[TestMethod, Timeout(10000)]
public async Task Probe_Success_MkvVideoBitDepth_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.MkvVideo);
Assert.IsNotNull(info.PrimaryAudioStream);
Assert.AreEqual(8, info.PrimaryVideoStream.BitDepth);
Assert.IsNull(info.PrimaryAudioStream.BitDepth);
}
[TestMethod, Timeout(10000)]
public async Task Probe_Success_24BitWavBitDepth_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.Wav24Bit);
Assert.IsNotNull(info.PrimaryAudioStream);
Assert.AreEqual(24, info.PrimaryAudioStream.BitDepth);
}
[TestMethod, Timeout(10000)]
public async Task Probe_Success_32BitWavBitDepth_Async()
{
var info = await FFProbe.AnalyseAsync(TestResources.Wav32Bit);
Assert.IsNotNull(info.PrimaryAudioStream);
Assert.AreEqual(32, info.PrimaryAudioStream.BitDepth);
}
}
V.5.0.0 (#391) * Move NotifyOnProgress processing to ErrorData * added HighPass filter, LowPass filter, Audiogate and Silencedetection * re-added corresponding AudioFilterOptions * Update LICENSE * Update ci.yml * Fix argument * Bump action versions * Ignore Uri_Duration until root cause found * Use action that can install specific ffmpeg version * Remove ignore * Revert "Remove ignore" This reverts commit d85a4b81abaf4ab7832020cdb2ccfb46758d3bde. * Bump dependencies * Use setup-dotnet@v2 since v3 seems to install .NET 7 * Init * WIP * Add Directory.Build.props * Add SupportedOSPlatform attribute on tests using SDC * Fix using temporarily * Add IgnoreIf attribute to only run SDC tests on Windows * Cleanup pipelines * Cleanup * Cleanup using directives * More cleanup * Simplify attribute * Fix attribute * Add missing test file * Added blackdetect and blackframe arguments * Added log levels * Add missing using directive after rebase * fix extension is not png lost path * Apply fix to methods in new location * Add Uri support for Frame Analysis, skipped Stream support as this cannot support MP4's with moov atom in the end of the file, and input pipes do not support seek. * Add select multiple streams * Add other stream types to Channel (V,s,d,t) * Add negative mapping to select stream (deselect) * Update test * Add pad video filter * Update PipeHelpers.cs * Fix GetPipePath() for MacOS * Add SampleAspectRatio property to VideoStream * Update year * Always use Path.GetTempPath() on linux and macos * Use FedericoCarboni/setup-ffmpeg@v2 * Include macos in ci matrix * AddDeviceInput similar to AddFileInput and FromDeviceInput * fixed hwaccel parameter not working in 5.0 * a hack to unconditionally kill ffmpeg when parent .NET process exits * Remove PInvoke.Kernel32 * Remove unneeded cast * Update test * Added ability to retrieve bit depth from media streams for lossless encodings (#359) * Added ability to retrieve bit depth from media streams for lossless encodings * Shortened sample AIFF file used in tests * Cleanup after splitting into two packages (#386) * Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents * fix: Switch source for rotation property from 'tags/rotate' to 'side_data_list/rotation' (incl. test case) (#388) * Init (#389) * build master branch after merge or push (#390) * Update ci.yml * Add codecov * Remove codecov for now * Add coverlet.collector and codecov --------- Co-authored-by: keg247 <44041557+keg247@users.noreply.github.com> Co-authored-by: Wilbert Bongers <msdnwilbert@muziekweb.nl> Co-authored-by: Artemii Gazizianov <107502822+ArtemiiimetrA@users.noreply.github.com> Co-authored-by: Thodoris Koskinopoulos <me@koskit.me> Co-authored-by: 赵宁 <602726286@qq.com> Co-authored-by: jeroenvanderschoot <jeroen.vanderschoot@kinetiq.tv> Co-authored-by: Sky Z <qe201020335@sina.com> Co-authored-by: Gleb Moskalenko <gleb.moskalenko.general@gmail.com> Co-authored-by: ep1kt3t0s <86835785+ep1kt3t0s@users.noreply.github.com> Co-authored-by: Victor Nova <lostfreeman@gmail.com> Co-authored-by: Tom Bogle <tom_bogle@sil.org> Co-authored-by: pklaes <10601494+pklaes@users.noreply.github.com>
2023-02-05 00:29:37 +01:00
}