[FFmpeg-devel] avcodec_decode_audio3 problem

byte bytegm at gmail.com
Tue Apr 10 09:18:02 CEST 2012


hi all:
    today, I try to decode a audio stream from:
http://c.xiai.tv/channels/cutv/shenzhentv/flv:sd/live. When I use the VLC
to play the url, everything seems to be ok. But when I decode the stream
use the avcodec_decode_audio3 I found the error log as these:

*[flv @ 0x7ab7c00] Stream discovered after head already parsed*

*[aac @ 0x6aca200] channel layout does not match number of channels*

*[flv @ 0x7ab7c00] Estimating duration from bitrate, this may be inaccurate*

*Input #0, flv, from '(null)':*

*  Duration: N/A, start: 454880.945000, bitrate: N/A*

*    Stream #0:0: Video: h264 (High), yuv420p, 640x480, 25 tbr, 1k tbn, 50
tbc*

*    Stream #0:1: Audio: aac, 48000 Hz, 2 channels, s16*

*    Stream #0:2: Data: none*

*
*
 *[aac @ 0x21a5800] Input buffer exhausted before END element found*

* [aac @ 0x21a5800] channel element 0.0 is not allocated*

* [aac @ 0x21a5800] channel element 0.0 is not allocated*

* [aac @ 0x21a5800] channel element 0.0 is not allocated*

* [aac @ 0x21a5800] channel element 0.0 is not allocated*

* [aac @ 0x21a5800] channel element 0.0 is not allocated*

* [aac @ 0x21a5800] channel element 0.0 is not allocated*

*
*

*It seems that the stream of the audio has some problems. I post the code I
write here:*

 while (av_read_frame(current_player.httpInfo->fmt, &avpkt) >= 0)

{

  if (avpkt.stream_index == current_player.httpInfo->audioStreamID)

  {

    while (avpkt.size > 0)

  {

     out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;

    len = avcodec_decode_audio3(codecContex, (short*)decodecBuf, &out_size,
&avpkt);

  if (len < 0)

  {

    break;

  }

  if (out_size > 0)

  {

    [data appendBytes:decodecBuf length:out_size];

    [self sinkData:data];

}

  avpkt.size -= len;

  avpkt.data += len;

 }

 }

}//end while


I can not find the problem,any one can give me some advices? Thanks!


More information about the ffmpeg-devel mailing list