Search code examples
audioencodingffmpegaacffprobe

What does profile means in an aac encoded audio


I am trying to concat two video files with ffmpeg concat demuxer for most of the part it works just fine! But when I try to concat videos which has two different audio profile with same codec, it concats with the resulting video having weird sound problem. And when re-encoding the resulting video it will spit out a lots of error related to audio.

Here is ffprobe output for some audio stream from different video files Video 1

[STREAM]
index=1
codec_name=aac
codec_long_name=unknown
profile=4
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
...
[/STREAM]

Video 2

[STREAM]
index=1
codec_name=aac
codec_long_name=unknown
profile=1
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
...
[/STREAM]

Video 3

[STREAM]
index=1
codec_name=aac
codec_long_name=unknown
profile=28
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
...
[/STREAM]

Look the different profile= values.I was able to reproduce 28 and 1 but was failed for 4

28 = he_aac_v2 1 = ffmpeg default

So what I want to know the most is, What does these different values mean for aac? And how to reproduce them with any aac encode?


Solution

  • According to libavcodec/avcodec.h:

    FF_PROFILE_AAC_MAIN    0
    FF_PROFILE_AAC_LOW     1
    FF_PROFILE_AAC_SSR     2
    FF_PROFILE_AAC_LTP     3
    FF_PROFILE_AAC_HE      4
    FF_PROFILE_AAC_HE_V2   28
    FF_PROFILE_AAC_LD      22
    FF_PROFILE_AAC_ELD     38
    

    The native FFmpeg AAC encoder (-c:a aac) does not have the ability to output HE or HEv2 profiles.

    If you need HE profile (-profile:a 4 or -profile:a aac_he) you'll have to use another encoder, such as -c:a libfdk_aac, -c:a aac_at (macOS/iOS only), or a separate standalone AAC encoder.