0

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?

1 Answers1

1

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.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • I see there are two MPEG2 entry ` #define FF_PROFILE_MPEG2_AAC_LOW 128 #define FF_PROFILE_MPEG2_AAC_HE 131 ` What is the difference between ` FF_PROFILE_AAC_LOW FF_PROFILE_AAC_HE ` – Ananta Prodhan Apr 23 '20 at 04:07
  • @AnantaProdhan According to [FFmpeg AAC encoder documentation](https://ffmpeg.org/ffmpeg-codecs.html#Options-6) aac_low is *"The default, AAC 'Low-complexity' profile. Is the most compatible and produces decent quality."* It is the most common AAC profile found in typical files. HE is [High-Efficiency](https://en.wikipedia.org/wiki/High-Efficiency_Advanced_Audio_Coding). – llogan Apr 23 '20 at 05:52