user6813: 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?

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.

user6294: 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


6813: <p>Input file original.wav</p>

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

<p>Convert wav to m4a with fdk-aac encoder:</p>

<pre><code>ffmpeg -i original.wav -c:a libfdk_aac -vbr 5 ffmpeg.m4a
</code></pre>

<p>Check duration of resulting m4a:</p>

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

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

<p><img src="https://i.stack.imgur.com/hvxER.png" alt="Waveforms"></p>

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

<ul>
<li>ffmpeg versions: 2.2.10 and 2.4.3</li>
<li>fdk-aac version: 0.1.1 and 0.1.3</li>
</ul>

<p>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.</p>
 6294: <p>I have seen this also with libfdk_aac and x264 and am not sure what causes it but I have had success using the <code>itsoffset</code> flag like this:</p>

<pre><code>ffmpeg -itsoffset 0.046440 -i original.wav -c:a libfdk_aac -vbr 5 ffmpeg.m4a
</code></pre>
