<p dir="ltr">I do flush the encoder by passing a null frame. it returns 2 packets that get appended at the beginning of my file and increase the padding instead of giving the end samples.</p>

<p dir="ltr">Panicos</p>
<br><div class="gmail_quote"><div dir="ltr">On 17:34, Fri, 21 Aug 2015 Henry, David <<a href="mailto:David.Henry@echostar.com" target="_blank">David.Henry@echostar.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>
<div>> I am new to ffmpeg/avlib and what I am trying to do is just decode and encode back again an aac file. I don't try to make any changes to the file although the avlib encoder is producing a file with more initial padding than expected and it is cropping
 the final frames of the audio clip.</div>
</div>
</div>
<span>
<div dir="ltr">
<div>> I exported the avframes created by the decoder and all the file information is there. It is at the encoding step that I am doing something wrong.</div>
</div>
</span>
<div><br>
</div>
</div><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><span>
<div dir="ltr">
<div>It sounds like you are not flushing the libfdk-aac encoder at the end.  The encoder holds on to audio samples internally while you are encoding and you need to flush those last samples</div>
</div>
</span>
<div>When you are finished encoding.</div>
<div>- David</div>
</div>

_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div>