<div dir="ltr">No. I get the same data that I send to decoder. Not the uncompressed data (pcm) as output. In my case single frame in a single AV packet size. This I checked using a while loop that compares the packet size. <div><br></div><div> Regards</div><div>Aboo</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 January 2017 at 14:23, He Lei <span dir="ltr"><<a href="mailto:helei0908@hotmail.com" target="_blank">helei0908@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="auto">
<div>do you say ,you write same packet to decoder, and get frame more then in packet? </div>
<div>look at anntation as avcodec_decode_audio4();</div>
<div>that is:</div>
<div>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4643  * Some decoders may support multiple frames in a single AVPacket. Such</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4644  * decoders would then just decode the first frame and the return value would be</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4645  * less than the packet size. In this case, avcodec_decode_audio4 has to be</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4646  * called again with an AVPacket containing the remaining data in order to</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4647  * decode the second frame, etc...  Even if no frames are returned, the packet</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4648  * needs to be fed to the decoder with remaining data until it is completely</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4649  * consumed or an error occurs.</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica">
<span style="font-size:12pt">4650  *</span></p>
</div>
<div><br>
</div>
<div>good luck<br>
<div>发自我的 iPhone</div>
</div><div><div class="h5">
<div><br>
在 2017年1月11日,20:08,Aboobeker Sidhik Koyamparambil mammu <<a href="mailto:aboosidhik@gmail.com" target="_blank">aboosidhik@gmail.com</a>> 写道:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Dear All,
<div><br>
</div>
<div>I am trying to decode opus. When I use both methods </div>
<div>avcodec_decode_audio4 and (avcodec_send_packet /avcodec_receive_frame) . I am receiving the same opus packet that I send for decoding. I got this by using the packet size of the decoded frame. Packet size is same as the input opus packet size.<br>
</div>
<div><br>
</div>
<div>I followed the decoding example given in github of ffmpeg. Please help me. Why I am receiving same packet as input?</div>
<div><br>
</div>
<div>
<div id="m_434632704048584658gmail-mainbar" style="margin:0px;padding:0px;border:0px;font-size:13px;float:left;width:728px;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">
<div class="m_434632704048584658gmail-question" id="m_434632704048584658gmail-question" style="margin:0px;padding:0px;border:0px;clear:both">
<table style="margin:0px;padding:0px;border:0px;border-collapse:collapse">
<tbody style="margin:0px;padding:0px;border:0px">
<tr style="margin:0px;padding:0px;border:0px">
<td class="m_434632704048584658gmail-votecell" style="padding:0px 15px 0px 0px;border:0px;vertical-align:top">
<br>
</td>
<td class="m_434632704048584658gmail-postcell" style="padding:0px;border:0px;vertical-align:top">
<div style="margin:0px;padding:0px;border:0px">
<div class="m_434632704048584658gmail-post-text" style="margin:0px 0px 5px;padding:0px;border:0px;font-size:15px;width:660px;word-wrap:break-word;line-height:1.3">
<pre style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit">av_register_all();
avcodec_register_all();
AVCodec *codec;
AVCodecContext *c = NULL;
AVPacket avpkt;
AVFrame *decoded_frame = NULL;
av_init_packet(&avpkt);
codec = avcodec_find_decoder(AV_CODEC_<wbr>ID_OPUS);
if (!codec) {
     printf("Codec not found\n");
     exit(1);
}
c = avcodec_alloc_context3(codec);
if (!c) {
   printf("Could not allocate audio codec context\n");
   exit(1);
}
/* put sample parameters */
c->sample_rate = 48000;
c->request_sample_fmt = AV_SAMPLE_FMT_FLT;
c->channels = 2;
/* open it */
if (avcodec_open2(c, codec, NULL) < 0) {
    printf("Could not open codec\n");
    exit(1);
}

AVPacket avpkt;
AVFrame *decoded_frame = NULL;
av_init_packet(&avpkt);
avpkt.data = Buffer;  // Buffer is packet data here
avpkt.size = len;    // length of the packet
int i, ch;

if (!decoded_frame) {
    if (!(decoded_frame = av_frame_alloc())) {
        RELAY_SERVER_PRINT("Could not allocate audio frame\n");
        exit(1);
    }
}
int ret;
int got_frame = 0;
ret = avcodec_decode_audio4(client_<wbr>sockt_num_1->c, decoded_frame, &got_frame, &avpkt);
if (ret < 0) {
        fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret));
        return ret;
    }
printf("length %i\n", decoded_frame->pkt_size);</code></pre>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><br>
</div>
-- <br>
<div class="m_434632704048584658gmail_signature">Kind Regards<br>
<br>
Aboobeker Sidhik</div>
</div>
</div>
</div>
</blockquote>
</div></div><blockquote type="cite">
<div><span>______________________________<wbr>_________________</span><br>
<span>Libav-user mailing list</span><br>
<span><a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a></span><br>
<span><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a></span><br>
</div>
</blockquote>
</div>

<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Kind Regards<br><br>Aboobeker Sidhik</div>
</div>