<div>Hi, </div><div><br></div><div>thanks for the reply but your answer didn't help. first of all, i need to register a codec and open it automatically, but decode_audio.c did not show the right way.</div><div>second, I copied a third party demo, it works well but still have some warning for the OLD API and decode_audio.c did not use the latest API to demostrate what ffmpeg suggest to do. I need a perfect demo, anybody could help?</div><div><br></div><div>Best regards,</div><div>pp</div><div><br></div><div><br></div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Gonzalo Garramuño";<ggarra13@gmail.com>;</div><div><b>发送时间:</b> 2017年5月12日(星期五) 晚上9:15</div><div><b>收件人:</b> "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter."<libav-user@ffmpeg.org>; <wbr></div><div></div><div><b>主题:</b> Re: [Libav-user]回复: just wanna get a decode demo for libav</div></div><div><br></div>
  
    
  
  
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">El 12/05/17 a las 07:25, 坚定前行 escribió:<br>
    </div>
    <blockquote cite="mid:tencent_7089E6CC16D8B7CA392976D3@qq.com" type="cite">
      <div>Hi, </div>
      <div>
        <div><br>
        </div>
        <div>that's the demo I tried </div>
        <div>
          <div style="line-height: 21px;">with warning 'avcodec_decode_<wbr>audio4'
            is deprecated.</div>
          <div style="line-height: 21px;">and that demo could not work
            with : Codec not found.</div>
        </div>
        <div style="line-height: 21px;"><br>
        </div>
        <div style="line-height: 21px;">Best regards,</div>
        <div style="line-height: 21px;">pp<br>
        </div>
      </div>
    </blockquote>
    Usually, if you get "codec not found" it means your ffmpeg
    compilation was lacking a certain codec.  The audio example uses
    mpeg2 audio, so you need to have ffmpeg compiled with mpeg2.<br>
    You can check the codecs you have by doing:<br>
    <br>
    $ ffmpeg -codecs<br>
    <br>
    For it to work, you should have a line like:<br>
    <br>
     DEA.L. mp2                  MP2 (MPEG audio layer 2) (decoders: mp2
    mp2float ) (encoders: mp2 mp2fixed )<br>
    <br>
    <br></div>