Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-13T16:20:16.707Z
Answers.LastActivityDate: 2014-12-13T16:20:16.707Z
Answers.UserDisplayName: denjello
Body: <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.sstatic.net/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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-11-20T01:16:52.293Z
Comments.Text: Is `ffmpeg` adding the padding, or is it the external encoding library? Does it also occur if you use [`fdkaac`](https://github.com/nu774/fdkaac)? It's a command line encoder frontend for libfdk-aac.
Comments.UserDisplayName: llogan
Tags: <ffmpeg>
Title: ffmpeg adds unneeded zero samples at beginning of resulting m4a file
UserDisplayName: Kootuve
ThreadText: # ffmpeg adds unneeded zero samples at beginning of resulting m4a file
  
  (Asked by: username_0 on 2014-11-20)
  
  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](https://i.sstatic.net/hvxER.png)
  
  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.
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Is `ffmpeg` adding the padding, or is it the external encoding library? Does it also occur if you use [`fdkaac`](https://github.com/nu774/fdkaac)? It's a command line encoder frontend for libfdk-aac.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-12-13. Score: 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
  
  ```
  
  
  ---
  
  