[FFmpeg-trac] #2782(avcodec:new): aac - Malformed AAC bitstream - incorrectly fixed with -bsf:a aac_adtstoasc' option

FFmpeg trac at avcodec.org
Sat Jul 13 01:06:25 CEST 2013


#2782: aac - Malformed AAC bitstream - incorrectly fixed with -bsf:a
aac_adtstoasc' option
-------------------------------------+-------------------------------------
             Reporter:  feelart      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avcodec      |                  Version:  git-
             Keywords:  aac          |  master
  aac_adtstoasc                      |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Observing some improper fixing on a bunch of aac using FFmeg


 {{{
 F:\Youtube Extract\Music>ffmpeg -i alice.aac -c:a copy aliceFF.mp4
 ffmpeg version N-54691-g7f4a1fd Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jul 12 2013 16:31:48 with gcc 4.7.3 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --
 enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-
 libbluray --enable-libcaca --enable-libfreetype --enab
 le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --e
 nable-libopenjpeg --enable-libopus --enable-librtmp --enable-
 libschroedinger --enable-libsoxr --enable-libspeex --enable-lib
 theora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libx264
  --enable-libxavs --enable-libxvid --enable-zlib
   libavutil      52. 39.100 / 52. 39.100
   libavcodec     55. 18.102 / 55. 18.102
   libavformat    55. 12.102 / 55. 12.102
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 80.101 /  3. 80.101
   libswscale      2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  3.100 / 52.  3.100
 [aac @ 0000000002686fe0] Estimating duration from bitrate, this may be
 inaccurate
 Input #0, aac, from 'alice.aac':
   Metadata:
     title           : Alice Deejay - Better Off Alon
   Duration: 00:03:46.41, bitrate: 77 kb/s
     Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 77 kb/s
 Output #0, mp4, to 'aliceFF.mp4':
   Metadata:
     title           : Alice Deejay - Better Off Alon
     encoder         : Lavf55.12.102
     Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 77
 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 [mp4 @ 000000000030a620] Malformed AAC bitstream detected: use audio
 bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac
 _adtstoasc' option with ffmpeg)
 av_interleaved_write_frame(): Operation not permitted
 }}}

 Now trying, to fix it with -bsf:a aac_adtstoasc
 {{{
 F:\Youtube Extract\Music>ffmpeg -i alice.aac -c:a copy -bsf:a
 aac_adtstoasc aliceFF_bsf.mp4
 ffmpeg version N-54691-g7f4a1fd Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jul 12 2013 16:31:48 with gcc 4.7.3 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --
 enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-
 libbluray --enable-libcaca --enable-libfreetype --enab
 le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --e
 nable-libopenjpeg --enable-libopus --enable-librtmp --enable-
 libschroedinger --enable-libsoxr --enable-libspeex --enable-lib
 theora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libx264
  --enable-libxavs --enable-libxvid --enable-zlib
   libavutil      52. 39.100 / 52. 39.100
   libavcodec     55. 18.102 / 55. 18.102
   libavformat    55. 12.102 / 55. 12.102
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 80.101 /  3. 80.101
   libswscale      2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  3.100 / 52.  3.100
 [aac @ 00000000002db740] Estimating duration from bitrate, this may be
 inaccurate
 Input #0, aac, from 'alice.aac':
   Metadata:
     title           : Alice Deejay - Better Off Alon
   Duration: 00:03:46.41, bitrate: 77 kb/s
     Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 77 kb/s
 Output #0, mp4, to 'aliceFF_bsf.mp4':
   Metadata:
     title           : Alice Deejay - Better Off Alon
     encoder         : Lavf55.12.102
     Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 77
 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 size=    2123kB time=00:02:39.17 bitrate= 109.3kbits/s
 video:0kB audio:2142kB subtitle:0 global headers:0kB muxing overhead
 -0.899321%
 }}}

 However, one sees that the fix is incorrect
 {{{
 F:\Youtube Extract\Music>aacgain -a -k aliceFF_bsf.mp4
 aliceFF_bsf.mp4
 Error: invalid file format aliceFF_bsf.mp4, code=15
 aliceFF_bsf.mp4 is not a valid mp4/m4a file.
 }}}

 FYI: https://github.com/elfchief/mp3gain/tree/master/aacgain


 On some other aac, I see aacgain error code=6

 Finally, I tried to re-encode, but then raises another error, but still no
 proper fix.
 {{{
 F:\Youtube Extract\Music>ffmpeg -i alice.aac -bsf:a aac_adtstoasc
 aliceFF_NoCopy_bsf.mp4
 ffmpeg version N-54691-g7f4a1fd Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jul 12 2013 16:31:48 with gcc 4.7.3 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --
 enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-
 libbluray --enable-libcaca --enable-libfreetype --enab
 le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --e
 nable-libopenjpeg --enable-libopus --enable-librtmp --enable-
 libschroedinger --enable-libsoxr --enable-libspeex --enable-lib
 theora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libx264
  --enable-libxavs --enable-libxvid --enable-zlib
   libavutil      52. 39.100 / 52. 39.100
   libavcodec     55. 18.102 / 55. 18.102
   libavformat    55. 12.102 / 55. 12.102
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 80.101 /  3. 80.101
   libswscale      2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  3.100 / 52.  3.100
 [aac @ 000000000031d6c0] Estimating duration from bitrate, this may be
 inaccurate
 Input #0, aac, from 'alice.aac':
   Metadata:
     title           : Alice Deejay - Better Off Alon
   Duration: 00:03:46.41, bitrate: 77 kb/s
     Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 77 kb/s
 Output #0, mp4, to 'aliceFF_NoCopy_bsf.mp4':
   Metadata:
     title           : Alice Deejay - Better Off Alon
     encoder         : Lavf55.12.102
     Stream #0:0: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
 Hz, stereo, s16, 128 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (aac -> libvo_aacenc)
 Press [q] to stop, [?] for help
 decode_band_types: Input buffer exhausted before END element found
 Error while decoding stream #0:0: Invalid data found when processing input
 [aac @ 000000000031a280] channel element 2.0 is not allocated
 Error while decoding stream #0:0: Error number -1 occurred
 size=    2515kB time=00:02:39.13 bitrate= 129.5kbits/s
 video:0kB audio:2487kB subtitle:0 global headers:0kB muxing overhead
 1.109339%
 }}}

 Thanks

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2782>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list