From 81053334437fe77500d92c545585c9ec396c186a Mon Sep 17 00:00:00 2001 From: Mike Cochran Date: Mon, 6 Jul 2020 16:33:50 -0500 Subject: [PATCH] Added audio codec profile to AudioStream Added the audio codec profile and accompanying test. Former-commit-id: 24f79fe3c8193fc0984990ab702048964611f6d8 --- FFMpegCore.Test/FFProbeTests.cs | 1 + FFMpegCore/FFProbe/AudioStream.cs | 1 + FFMpegCore/FFProbe/MediaAnalysis.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/FFMpegCore.Test/FFProbeTests.cs b/FFMpegCore.Test/FFProbeTests.cs index 558f29c..d0f5f7d 100644 --- a/FFMpegCore.Test/FFProbeTests.cs +++ b/FFMpegCore.Test/FFProbeTests.cs @@ -26,6 +26,7 @@ public void Probe_Success() 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); Assert.AreEqual(381988, info.PrimaryAudioStream.BitRate); Assert.AreEqual(48000, info.PrimaryAudioStream.SampleRateHz); diff --git a/FFMpegCore/FFProbe/AudioStream.cs b/FFMpegCore/FFProbe/AudioStream.cs index ad1e513..d6f4b33 100644 --- a/FFMpegCore/FFProbe/AudioStream.cs +++ b/FFMpegCore/FFProbe/AudioStream.cs @@ -5,5 +5,6 @@ public class AudioStream : MediaStream public int Channels { get; internal set; } public string ChannelLayout { get; internal set; } = null!; public int SampleRateHz { get; internal set; } + public string Profile { get; internal set; } = null!; } } \ No newline at end of file diff --git a/FFMpegCore/FFProbe/MediaAnalysis.cs b/FFMpegCore/FFProbe/MediaAnalysis.cs index 8f02a4f..1dbf49c 100644 --- a/FFMpegCore/FFProbe/MediaAnalysis.cs +++ b/FFMpegCore/FFProbe/MediaAnalysis.cs @@ -94,6 +94,7 @@ private AudioStream ParseAudioStream(FFProbeStream stream) ChannelLayout = stream.ChannelLayout, Duration = ParseDuration(stream), SampleRateHz = !string.IsNullOrEmpty(stream.SampleRate) ? ParseIntInvariant(stream.SampleRate) : default, + Profile = stream.Profile, Language = stream.Tags?.Language }; }