diff --git a/src/main/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzer.kt b/src/main/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzer.kt index 198f13e..3464217 100644 --- a/src/main/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzer.kt +++ b/src/main/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzer.kt @@ -160,7 +160,8 @@ class MediaAnalyzer channels = ffAudioStream.channels, channelLayout = ffAudioStream.channel_layout, samplingRate = ffAudioStream.sample_rate ?: audioTrack?.samplingRate, - bitrate = ffAudioStream.bit_rate ?: audioTrack?.bitrate + bitrate = ffAudioStream.bit_rate ?: audioTrack?.bitrate, + profile = ffAudioStream.profile ) } } diff --git a/src/main/kotlin/se/svt/oss/mediaanalyzer/file/AudioStream.kt b/src/main/kotlin/se/svt/oss/mediaanalyzer/file/AudioStream.kt index b4324ac..697812d 100644 --- a/src/main/kotlin/se/svt/oss/mediaanalyzer/file/AudioStream.kt +++ b/src/main/kotlin/se/svt/oss/mediaanalyzer/file/AudioStream.kt @@ -11,5 +11,6 @@ data class AudioStream( val channels: Int, val channelLayout: String?, val samplingRate: Int?, - val bitrate: Long? + val bitrate: Long?, + val profile: String? ) diff --git a/src/test/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzerIntegrationTest.kt b/src/test/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzerIntegrationTest.kt index 0cb3b48..6b4453e 100644 --- a/src/test/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzerIntegrationTest.kt +++ b/src/test/kotlin/se/svt/oss/mediaanalyzer/MediaAnalyzerIntegrationTest.kt @@ -90,5 +90,28 @@ class MediaAnalyzerIntegrationTest { .hasDuration(2.621) .hasSamplingRate(48000) .hasBitrate(128104) + .hasProfile("LC") + } + @Test + fun testAudioHeAac() { + val file = javaClass.getResource("/he-aac_test.mp4").file + + val audioFile = MediaAnalyzer() + .analyze(file) as AudioFile + + assertThat(audioFile) + .hasFormat("MPEG-4") + .hasOverallBitrate(67625) + .hasDuration(5.000) + + assertThat(audioFile.audioStreams).hasSize(1) + assertThat(audioFile.audioStreams.first()) + .hasFormat("AAC") + .hasCodec("aac") + .hasChannels(2) + .hasDuration(5.000) + .hasSamplingRate(48000) + .hasBitrate(64183) + .hasProfile("HE-AAC") } } diff --git a/src/test/resources/he-aac_test.mp4 b/src/test/resources/he-aac_test.mp4 new file mode 100644 index 0000000..a215b1b Binary files /dev/null and b/src/test/resources/he-aac_test.mp4 differ