I have a problem with encoding in acc with FFmpeg.
I have au mp4 file with aac audio. I tried to copy the audio with ffmpeg.
In the source mp4 file, the first audio noise appears at 0.30 seconds.
After conversion using ffmpeg -i inputfile.mp4 -c:a copy outputfile.aac
, the resulting file is wrong, the first audio noise appears at 0.32 seconds.
The duration of the file is not the same too.
When i force the encoder to libfaac, it works but the file is too big.
So why it doesn't work when the default encoder is used (aac, libfdk_aac) ? Note that the same thing appears when i convert from audacity.
Thanks a lot
There is a padding frame in the audio stream which is needed by the decoder in order to decode the first frame. This is technical requirement of MDCT audio codecs like AAC. In a timed sample container like MP4/MKV, that first frame has a negative presentation timestamp. In a raw AAC bitstream, that first frame is naively decoded. Each frame has 1024 samples and so has a duration of 21-23 ms. Your difference in timing is due to that offset. Rewrap to a container like M4A to avoid this.
For background, from Apple:
and