<div>But, how can I set the additional flag? thank you very much.</div><div> </div><div><div style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 14px;"><div><div style="color: rgb(144, 144, 144); font-family: Arial Narrow; font-size: 12px;">------------------</div><div style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 14px;"><div><font color="#3366ff">Justin</font></div></div></div></div></div><div><div> </div><div style="padding: 2px 0px; font-family: Arial Narrow; font-size: 12px;">------------------ Original ------------------</div><div style="background: rgb(239, 239, 239); padding: 8px; font-size: 12px;"><div><b>From: </b> "Paul B Mahol"<onemda@gmail.com>;</div><div><b>Date: </b> Mon, Apr 8, 2013 04:35 PM</div><div><b>To: </b> "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter."<libav-user@ffmpeg.org>; <wbr></div><div></div><div><b>Subject: </b> Re: [Libav-user] AAC encoding error</div></div><div><br></div>On 4/7/13, Justin <justin-zhao@qq.com> wrote:<br>> Hi,<br>><br>>     I am trying to encode audio using the AAC audio encoder with the program<br>> below, but when I call the avcodec_open2 funtion, the function always return<br>> -733130664. I don't know where is wrong in it. I'll very appreciate someone<br>> who can point out the wrong.<br><br>Native AAC encoder is experimental and so you need to set additional<br>flag to use.<br><br>><br>> note:if the codec AV_CODEC_ID_AAC is changed as AV_CODEC_ID_MP2, the<br>> avcodec_open2 can return 0 successfully!<br>><br>> ============program=================<br>> main()<br>> {<br>>  int ret;<br>>  AVCodec *codec;<br>>  AVCodecContext *c;<br>>  AVFrame *frame;<br>><br>>  avcodec_register_all();<br>>  codec = avcodec_find_encoder(AV_CODEC_ID_AAC);<br>>  if (!codec)  return;<br>>  //avcodec_register(codec);<br>>  c = avcodec_alloc_context3(codec);<br>>  if (!c)  return;<br>><br>>  c->bit_rate = 64000;<br>>  c->sample_rate    = 44100;<br>>  c->channels       = 2;<br>>  c->frame_size = 88200;<br>>  c->sample_fmt = AV_SAMPLE_FMT_S16;<br>>  // open it<br>>  ret = avcodec_open2(c, codec, NULL);<br>>  if (ret >= 0)  printf("OK\r\n");<br>> }<br>><br>> Best Regards,<br>> Justin<br>_______________________________________________<br>Libav-user mailing list<br>Libav-user@ffmpeg.org<br>http://ffmpeg.org/mailman/listinfo/libav-user<br></div>