2

Input file original.wav

ffmpeg -i original.wav
...
  Duration: 00:03:36.93, bitrate: 1411 kb/s

Convert wav to m4a with fdk-aac encoder:

ffmpeg -i original.wav -c:a libfdk_aac -vbr 5 ffmpeg.m4a

Check duration of resulting m4a:

ffmpeg -i ffmpeg.m4a
...
  Duration: 00:03:36.98, start: 0.046440, bitrate: 240 kb/s

So, ffmpeg adds ~2000 zero samples at beginning of resulting file. How to disable this?

Waveforms

I try few different codecs and all work fine, problem only with fdk-aac.

  • ffmpeg versions: 2.2.10 and 2.4.3
  • fdk-aac version: 0.1.1 and 0.1.3

UPD1: I try fdkaac and vlc (it also use fdk-aac library). Both produce correct file (no zero samples at begin). So problem only with ffmpeg+fdk.

1
  • 1
    Is ffmpeg adding the padding, or is it the external encoding library? Does it also occur if you use fdkaac? It's a command line encoder frontend for libfdk-aac.
    – llogan
    Nov 20, 2014 at 1:16

1 Answer 1

1

I have seen this also with libfdk_aac and x264 and am not sure what causes it but I have had success using the itsoffset flag like this:

ffmpeg -itsoffset 0.046440 -i original.wav -c:a libfdk_aac -vbr 5 ffmpeg.m4a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.