<div dir="ltr"><span style="font-size:12.8px">Hi all,</span><div style="font-size:12.8px">I am trying to build an mp3 encoder( ffmpeg integrated with lame) in C++. For some reason I am not receiving good quality output. Here are the output samples:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">FFMPEG result:<a href="https://drive.google.com/file/d/0B9DbYNPuSyiRYTFzRmliNWxLcnM/view?usp=sharing" target="_blank">https://drive.google.<wbr>com/file/d/<wbr>0B9DbYNPuSyiRYTFzRmliNWxLcnM/<wbr>view?usp=sharing</a></div><div style="font-size:12.8px">Reference Sample: <a href="https://drive.google.com/file/d/0B9DbYNPuSyiRMnlYYUtlTjEzNFU/view?usp=sharing" target="_blank">https://drive.google.<wbr>com/file/d/<wbr>0B9DbYNPuSyiRMnlYYUtlTjEzNFU/<wbr>view?usp=sharing</a></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am using avcodec_encode_audio2 API as shown in the enoding-decoding example.</div><div style="font-size:12.8px">Also wanted to add, I see some delays in the encoder as when I am doing ret = avcodec_encode_audio2(m_<wbr>pCodecCtxOut, &Encodedpkt, pInputFrame, &got_output); I dont get any output but after flushing with NULL I get some output for 2-3 loops.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Any suggestion or idea is appreciated.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks,</div><div style="font-size:12.8px">Lina</div></div>