Opened 12 years ago

Closed 2 years ago

#1614 closed defect (fixed)

AAC stream with SBR fails with "channel element 0.1 is not allocated"

Reported by: iceman12c Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: AAC SBR
Cc: batguano999@zoho.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Getting the following message repeatedly when trying to play the AAC stream with ffplay from master:
[aac @ 0x7ff1c2023800] channel element 0.1 is not allocated

Stream is http://3043.live.streamtheworld.com/SAM04AAC41_SC

This stream works fine in VideoLan VLC player.

How to reproduce:
./ffplay http://3043.live.streamtheworld.com/SAM04AAC41_SC

Attachments (2)

SAM04AAC41_SC (981.0 KB ) - added by Carl Eugen Hoyos 12 years ago.
aac_broken.mp4 (1.5 MB ) - added by Carl Eugen Hoyos 10 years ago.

Change History (11)

by Carl Eugen Hoyos, 12 years ago

Attachment: SAM04AAC41_SC added

comment:1 by Carl Eugen Hoyos, 12 years ago

Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

For future bug-reports: Please always add complete, uncut console output.

$ ffmpeg -i SAM04AAC41_SC
ffmpeg version N-43296-g13c5069 Copyright (c) 2000-2012 the FFmpeg developers
  built on Aug  7 2012 20:51:48 with gcc 4.3.2 (GCC)
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl --enable-libopenjpeg --enable-libvorbis --enable-libspeex --enable-libmp3lame --enable-libtheora --extra-ldflags=-lm --enable-libvpx --enable-libxavs --enable-x11grab --enable-libass --enable-nonfree --enable-libfaac --enable-libopus --enable-libfdk-aac
  libavutil      51. 66.101 / 51. 66.101
  libavcodec     54. 50.100 / 54. 50.100
  libavformat    54. 22.101 / 54. 22.101
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3.  6.100 /  3.  6.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[aac @ 0x911b780] channel element 0.1 is not allocated
    Last message repeated 2703 times
[aac @ 0x9115500] decoding for stream 0 failed
[aac @ 0x9115500] Could not find codec parameters for stream 0 (Audio: aac, stereo, s16, 60 kb/s): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[aac @ 0x9115500] Estimating duration from bitrate, this may be inaccurate
SAM04AAC41_SC: could not find codec parameters

comment:2 by bat999, 11 years ago

Hi
The "3043.live.streamtheworld.com/SAM04AAC41_SC" stream is no longer active.
Is there an alternative stream to test instead?

Maybe the attached file "SAM04AAC41_SC" corrupt.
Latest FFplay seems to play similar files OK.

Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : HE-AACv2 / HE-AAC / LC
Bit rate mode : Variable
Channel(s) : 2 channels / 1 channel / 1 channel
Channel positions : Front: L R / Front: C / Front: C
Sampling rate : 44.1 KHz / 44.1 KHz / 22.05 KHz

@Xubuntu:~/ffmpeg-HEAD-6286bb5$ ./ffplay similar_file.aac
ffplay version 2.2.git-6286bb5 Copyright (c) 2003-2014 the FFmpeg developers

built on Jun 12 2014 21:03:29 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration:
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 66.100 / 55. 66.100
libavformat 55. 43.100 / 55. 43.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 8.100 / 4. 8.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100

[aac @ 0xb0e026a0] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'similar_file.aac':

Duration: 00:00:32.36, bitrate: 45 kb/s

Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 45 kb/s

41.02 M-A: -0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0

comment:3 by bat999, 11 years ago

Cc: batguano999@zoho.com added

comment:4 by Carl Eugen Hoyos, 10 years ago

The file is a stereo file but has chan_config set to 1.

by Carl Eugen Hoyos, 10 years ago

Attachment: aac_broken.mp4 added

comment:6 by Carl Eugen Hoyos, 10 years ago

Additional sample from ticket #4576 attached.

comment:7 by Cosmin Stejerean, 3 years ago

Recently encountered the same issue, on latest ffmpeg 5.0. I took a look at the attached file to this ticket and it exhibits the same problem as the streams I'm seeing errors on. This "stereo" audio is actually coded as single channel elements instead of 1 channel pair element. From the header we see that it's a typical AAC-LC stereo

5E291            AudioSpecificConfig (2 bytes)
5E291             audioObjectType - 2 (0x2) - AAC - LC (0 bytes)
5E291              audioObjectType:           2 (0x02) - (5 bits)
5E291             samplingFrequencyIndex:     3 (0x3) - (4 bits) - 48000 (0xBB80)
5E292             channelConfiguration:       2 (0x2) - (4 bits) - Front: L R

but the AAC data contains two individual SCEs

0002C  1 (379 bytes)
0002C   raw_data_block (379 bytes)
0002C    SCE - single_channel_element (184 bytes)
0002C     id_syn_ele:                         0 (0x0) - (3 bits) - SCE - single_channel_element
0002E    SCE - single_channel_element (376 bytes)
000E4     id_syn_ele:                         0 (0x0) - (3 bits) - SCE - single_channel_element
00032    END - End (372 bytes)
001A6     id_syn_ele:                         7 (0x7) - (3 bits) - END - End
001A6    byte_alignment:                      0 (0x0) - (3 bits)

whereas a typica AAC stereo channel pair element would look like this

00913  1 (441 bytes)
00913   raw_data_block (441 bytes)
00913    CPE - channel_pair_element (439 bytes)
00913     id_syn_ele:                         1 (0x1) - (3 bits) - CPE - channel_pair_element
00915    FIL - fill_element (438 bytes)
00ACA     id_syn_ele:                         6 (0x6) - (3 bits) - FIL - fill_element
00916    END - End (438 bytes)
00ACB     id_syn_ele:                         7 (0x7) - (3 bits) - END - End

comment:8 by Cosmin Stejerean, 3 years ago

The parsing code in aacdec_template.c seems to intend to be able to parse stereo from individual single channel elements (SCE), but it seems to trip on a bug when getting to the second SCE.

As a workaround using the fdk_aac decoder will work, but it would be great to fix the AAC decoder in ffmpeg itself to handle such cases.

comment:9 by James, 2 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.