<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px"><div id="yiv6982181238"><div id="yui_3_16_0_ym19_1_1461796465459_161676"><div id="yui_3_16_0_ym19_1_1461796465459_161675" style="color:#000;background-color:#fff;font-family:Helvetica Neue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px;"><div id="yui_3_16_0_ym19_1_1461796465459_161681"><div id="yui_3_16_0_ym19_1_1461796465459_161711">Ok added the code from filtering_audio.c to create a filterchain, changed my code to take the decoded frames and push into the filter.</div><div id="yui_3_16_0_ym19_1_1461796465459_161837"><br></div><div id="yui_3_16_0_ym19_1_1461796465459_161838" dir="ltr">filt_frame is returned and this is pushed into the avcodec_encode_audio2 and guess what error i get<br></div><div id="yui_3_16_0_ym19_1_1461796465459_161896" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1461796465459_161969" dir="ltr">[mp2 @ xxxxxxxxxxx] nb_samples (1024) != frame_size (1152) (avencode_encoder_audio2)</div></div><div id="yui_3_16_0_ym19_1_1461796465459_161680"><div id="yui_3_16_0_ym19_1_1461796465459_161999"><br></div><div id="yui_3_16_0_ym19_1_1461796465459_162253">So question one, How do i fix this</div><div id="yui_3_16_0_ym19_1_1461796465459_162252"><br clear="none"></div><div id="yui_3_16_0_ym19_1_1461796465459_162254">Question Two</div><br><div dir="ltr" id="yui_3_16_0_ym19_1_1461796465459_162031">In this example code a filter string is passed "aresample=32000,aformat=sample_fmts=s16,channel_layout=stereo", to init_filter and parsed by a call to avfilter_graph_parse_ptr <br></div><div id="yui_3_16_0_ym19_1_1461796465459_162069"><br></div><div id="yui_3_16_0_ym19_1_1461796465459_162070">but also in the code these values are set <br></div><div id="yui_3_16_0_ym19_1_1461796465459_162071"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1461796465459_162088">static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, -1);</div><div id="yui_3_16_0_ym19_1_1461796465459_162125" dir="ltr">static const int64_t out_channel_layouts[] = { AV_CH_LAYOUT_STEREO, -1 };</div><div dir="ltr">static const int out_sample_rates[] = { 32000, -1 };</div><div id="yui_3_16_0_ym19_1_1461796465459_162346" dir="ltr">etc</div><div id="yui_3_16_0_ym19_1_1461796465459_162126" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1461796465459_162135" dir="ltr">Is this duplication needed?</div><div id="yui_3_16_0_ym19_1_1461796465459_162127" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1461796465459_162128" dir="ltr">joolz</div><div id="yui_3_16_0_ym19_1_1461796465459_162129" dir="ltr"><br clear="none"></div></div><div><span></span></div><div class="qtdSeparateBR"><br><br></div><div class="yiv6982181238yqt8687621676" id="yiv6982181238yqt93141"></div></div></div></div><div class=".yiv6982181238yahoo_quoted"> <div style="font-family:Helvetica Neue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px;"> <div dir="ltr"><font face="Arial" size="2"> On Thursday, 28 April 2016, 15:11, Andrey Utkin <andrey_utkin@fastmail.com> wrote:<br clear="none"></font></div> <blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;margin-top:5px;padding-left:5px;"> <br clear="none"><br clear="none"> <div class="yiv6982181238y_msg_container">On Thu, Apr 28, 2016 at 01:00:37PM +0000, JULIAN GARDNER wrote:<div class="yiv6982181238yqt4631716637" id="yiv6982181238yqtfd78629"><br clear="none">> So my question is do I have to split the input to be the correct size or am i missing something in the audio encoding setup to allow it to do the buffering correctly?</div><br clear="none"><br clear="none">Apparently yes.<br clear="none">I believe libavfilter API can do both parts (resampling and splitting)<br clear="none">for you, filtering is easier to setup than handling of every aspect of<br clear="none">conversion manually.<div class="yiv6982181238yqt4631716637" id="yiv6982181238yqtfd84164"><br clear="none"></div><br clear="none"><br clear="none"></div> </blockquote> </div> </div>  </div></div></body></html>