<div dir="rtl"><div dir="ltr"><br>I am reading a udp data and recieve:<br><br><span style="background-color:rgb(204,204,204)">Input #0, mpegts, from 'udp://<a href="http://224.10.0.15:1234">224.10.0.15:1234</a>':<br>  Duration: N/A, start: 66502.042356, bitrate: N/A<br>  Program 29 <br>    Metadata:<br>      service_name    : Galatz<br>      service_provider: Idan +<br>    Stream #0:0[0xb81]: Audio: aac_latm (HE-AAC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp<br></span><br></div><div dir="ltr">But when I print the codec context I receive the following data:<br><div>Bits: 8, Channels:2048<br>sample_rate: 8.<br><br></div><div>What is the meaning of 2048 channels (2 - is stereo)?<br></div><div>and why do I have 8 bit for fltp?<br><br></div><div>The code part is:<br></div><div><br></div><div><div style="margin-left:40px"> <span style="background-color:rgb(153,153,153)">av_register_all();<br>   avformat_network_init();<br>  <br>  <br>    const char* input_filename=argv[1];<br>   <br>   AVFormatContext* container=avformat_alloc_context();<br>    if(avformat_open_input(&container,input_filename,NULL,NULL)<0)<br>        die("Could not open file");<br>   <br>    if(avformat_find_stream_info(container,NULL)<0)<br>        die("Could not find file info");<br>   <br>  <br>   av_dump_format(container,0,input_filename,0);<br><br>   <br>    int stream_id=-1;<br>    int i;<br>    for(i=0;i<container->nb_streams;i++)<br>    {<br>       if(container->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO)<br>        {<br>            stream_id=i;//audio stream index<br>            break;<br>        }<br>    }<br>    if(stream_id==-1){<br>        die("Could not find Audio Stream");<br>    }<br><br>  //  AVDictionary *metadata=container->metadata;<br><br>    AVCodecContext *ctx=container->streams[stream_id]->codec;<br>    AVCodec *codec=avcodec_find_decoder(ctx->codec_id);<br> <br>   // ctx=avcodec_alloc_context3(codec);<br>    <br>    if(codec==NULL){<br>        die("cannot find codec!");<br>    }<br><br>   <br>    if(avcodec_open2(ctx,codec, NULL)<0){<br>        die("Codec cannot be found");<br>    }<br>int bits;<br>if(sfmt==AV_SAMPLE_FMT_U8){<br>        printf("U8\n");<br><br>        bits=8;<br>    }else if(sfmt==AV_SAMPLE_FMT_S16){<br>        printf("S16\n");<br>        bits=16;<br>    }else if(sfmt==AV_SAMPLE_FMT_S32){<br>        printf("S32\n");<br>       bits=32;<br>    }<br>   else if(sfmt==AV_SAMPLE_FMT_FLTP){<br>        bits=32;<br>   }<br>printf("\nBits: %d, Channels:%d\nRate: %d, byte_format:%d matrix:%s\n",bits, ctx->channels, sformat.rate, sformat.byte_format,sformat.matrix);</span><br><br></div></div><div><div class="gmail_signature"><div dir="rtl"><div style="text-align:center" dir="ltr">Yosef Alon<br></div></div></div>
</div></div></div>