<div dir="ltr"><div>Hi everyone,</div><div><br></div>



    
        <div class="gmail-votecell gmail-post-layout--left"><div class="gmail-js-voting-container gmail-d-flex gmail-jc-center gmail-fd-column gmail-ai-stretch gmail-gs4 gmail-fc-black-200">

</div>I would like to encode a simple pcm to amr using libavcodec.
</div><div class="gmail-postcell gmail-post-layout--right"><div class="gmail-s-prose gmail-js-post-body"><p>To begin with, I compiled ffmpeg and ran the <code>encode_audio</code> example and it worked fine for the default Mp2 codec.</p>
<p>Then modified the <a href="https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/encode_audio.c" rel="nofollow noreferrer">encode_audio</a> example and replace <code>AV_CODEC_ID_MP2</code> with <code>AV_CODEC_ID_AMR_NB</code> and changed <code>bit_rate</code>, <code>sample_rate</code>, and <code>channel_layout</code> to <code>12200</code>, <code>8000</code>, and <code>AV_CH_LAYOUT_MONO</code> respectively. Now, I am getting <code>invalid fastbin entry (free)</code> error.</p>
<p>The compiled <code>ffmpeg</code> cli binary worked as expected and encodes audio files to <code>amr</code> successfully, so the issue is not in compilation or the linking step.</p>
<p>Any help would be much appreciated,</p><p>Pouya<br></p>
    </div></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div title="MDH:LS0tLTxkaXY+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZTogMGVtOyI+PGJyPjwvc3Bhbj48L2Rpdj48
ZGl2PjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDBlbTsiPuKAizwvc3Bhbj48L2Rpdj4=" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px"><br></div></div></div></div></div></div></div></div></div></div></div></div>