Added audio codec profile to AudioStream

Added the audio codec profile and accompanying test.


Former-commit-id: 24f79fe3c8
This commit is contained in:
Mike Cochran 2020-07-06 16:33:50 -05:00
parent 4456fa7b5e
commit 8105333443
3 changed files with 3 additions and 0 deletions

View file

@ -26,6 +26,7 @@ public void Probe_Success()
Assert.AreEqual(6, info.PrimaryAudioStream.Channels); Assert.AreEqual(6, info.PrimaryAudioStream.Channels);
Assert.AreEqual("AAC (Advanced Audio Coding)", info.PrimaryAudioStream.CodecLongName); Assert.AreEqual("AAC (Advanced Audio Coding)", info.PrimaryAudioStream.CodecLongName);
Assert.AreEqual("aac", info.PrimaryAudioStream.CodecName); Assert.AreEqual("aac", info.PrimaryAudioStream.CodecName);
Assert.AreEqual("LC", info.PrimaryAudioStream.Profile);
Assert.AreEqual(381988, info.PrimaryAudioStream.BitRate); Assert.AreEqual(381988, info.PrimaryAudioStream.BitRate);
Assert.AreEqual(48000, info.PrimaryAudioStream.SampleRateHz); Assert.AreEqual(48000, info.PrimaryAudioStream.SampleRateHz);

View file

@ -5,5 +5,6 @@ public class AudioStream : MediaStream
public int Channels { get; internal set; } public int Channels { get; internal set; }
public string ChannelLayout { get; internal set; } = null!; public string ChannelLayout { get; internal set; } = null!;
public int SampleRateHz { get; internal set; } public int SampleRateHz { get; internal set; }
public string Profile { get; internal set; } = null!;
} }
} }

View file

@ -94,6 +94,7 @@ private AudioStream ParseAudioStream(FFProbeStream stream)
ChannelLayout = stream.ChannelLayout, ChannelLayout = stream.ChannelLayout,
Duration = ParseDuration(stream), Duration = ParseDuration(stream),
SampleRateHz = !string.IsNullOrEmpty(stream.SampleRate) ? ParseIntInvariant(stream.SampleRate) : default, SampleRateHz = !string.IsNullOrEmpty(stream.SampleRate) ? ParseIntInvariant(stream.SampleRate) : default,
Profile = stream.Profile,
Language = stream.Tags?.Language Language = stream.Tags?.Language
}; };
} }