[FFmpeg-user] AAC mpeg2_aac_low profile and ADTS header question

Yoon-Soo, Lee dan.lee at jocoos.com
Thu Sep 20 18:03:55 EEST 2018


> On 20 Sep 2018, at 7:56 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 
> 2018-09-20 12:22 GMT+02:00, Dan Lee <dan.lee at jocoos.com>:
> 
>> I’m having some trouble transcoding audio to mpeg2 aac.
> 
> Could you elaborate a little why it makes sense for
> FFmpeg to not only support writing mpeg4 aac but
> also mpeg2 aac?

I was asked if I am able to transcode a video so that it could be played on a certain set top box which unfortunately I don’t have much information about. One of the requirement for the video was to have audio stream transcoded into mpeg2 acc. Like I said, I don’t have much information about the device which the video is going to be played on and my only guess is that it is capable of playing only mpeg2 aac audio.

Some videos that are playable on the device were provided and all the adts headers of those videos had the bit indicating whether it is mpeg2 set. I suspect that it really doesn’t matter for modern day players whether the bit is set or cleared because probably most players are supporting mpeg4. However, in such a situation where you have to transcode an audio stream that is playable on a legacy player, I think it might make sense to support the feature to indicate aac is used within the mpeg2 standards.

> And is it sufficient to change the bit you mention,
> or are other changes necessary?

I am not completely sure but I think it is sufficient. I suppose the bit in the adts header kind of gives a hint to the decoder.

As far as what I have learned in the past few days mpeg4 acc is nothing more than utilizing several more algorithms in the encoding process. Such as pns(perceptual noise substitution) and ltp(long term prediction). And ffmpeg seems like it is already sorting out which features could be turned on and off depending on the profile or exits with an error and does the job quite thoroughly. For example, when using mpeg2_aac_low, aac_pns is turned off by code(in aacenc.c).

> 
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

I have made some modifications to the code(accenc.c and adtsenc.c) so that adts header is constructed as I expected and got the desired result but I wanted to confirm if I’m doing anything that doesn’t conform to the aac/adts standard or specification. It anyone could confirm my solution is meaningful, I’m willing to submit a patch.

Yoon-Soo



More information about the ffmpeg-user mailing list