Merge pull request #86 from vongrippen/Add-audio-profile

Added audio codec profile to AudioStream

Former-commit-id: 5828a35469
This commit is contained in:
Malte Rosenbjerg 2020-07-07 12:54:49 +02:00 committed by GitHub
commit 9fc6177e61
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("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);

View file

@ -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!;
}
}

View file

@ -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
};
}