Opened 8 years ago

Closed 6 years ago

#5725 closed defect (fixed)

ffmpeg: error during decoding mp3 with APE tag

Reported by: Radoslaw Szkodzinski Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mp3
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

FFmpeg tool as well as certain applications have problems decoding MP3 files with APE tags.
The tag is reported as an error while decoding stream and some applications using ffmpeg libraries abort decoding in such case.

Issue is also reproducible in ffmpeg 2.7.7 and probably in all releases up to date.

ffmpeg -loglevel trace -i Ice\ Wharf.mp3 Ice\ Wharf.wav
ffmpeg version N-80901-gfebc862 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input file with argument 'Ice Wharf.mp3'.
Reading option 'Ice Wharf.wav' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input file Ice Wharf.mp3.
Successfully parsed a group of options.
Opening an input file: Ice Wharf.mp3.
[file @ 0xa9af6e0] Setting default whitelist 'file,crypto'
Probing aac score:1 size:1875
Probing mp3 score:25 size:1875
Probing aac score:1 size:3923
Probing mp3 score:51 size:3923
[mp3 @ 0xa9aef60] Format mp3 probed with size=4096 and score=51
[mp3 @ 0xa9aef60] id3v2 ver:3 flags:00 len:163
[mp3 @ 0xa9aef60] pad 576 1681
[mp3 @ 0xa9aef60] Skipping 0 bytes of junk at 590.
[mp3 @ 0xa9aef60] Before avformat_find_stream_info() pos: 590 bytes read:32768 seeks:0 nb_streams:1
[mp3 @ 0xa9aef60] demuxer injecting skip 1105 / discard 0
[mp3 @ 0xa9b01e0] skip 1105 / discard 0 samples due to side data
[mp3 @ 0xa9b01e0] skip 1105/1152 samples
[mp3 @ 0xa9aef60] All info found
[mp3 @ 0xa9aef60] stream 0: start_time: 0.025 duration: 238.341
[mp3 @ 0xa9aef60] format: start_time: 0.025 duration: 238.341 bitrate=128 kb/s
[mp3 @ 0xa9aef60] After avformat_find_stream_info() pos: 22094 bytes read:32768 seeks:0 frames:50
Input #0, mp3, from 'Ice Wharf.mp3':
  Metadata:
    title           : Ice Wharf
    artist          : Work Drugs
    album           : Aurora Lies
    track           : 6
  Duration: 00:03:58.34, start: 0.025057, bitrate: 128 kb/s
    Stream #0:0, 50, 1/14112000: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
    Metadata:
      encoder         : LAME3.96r
    Side data:
      replaygain: track gain - -6.200000, track peak - unknown, album gain - unknown, album peak - unknown, 
Successfully opened the file.
Parsing a group of options: output file Ice Wharf.wav.
Successfully parsed a group of options.
Opening an output file: Ice Wharf.wav.
[file @ 0xa9bfd40] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 0:0 @ 0xa9b2880] Setting 'time_base' to value '1/44100'
[graph 0 input from stream 0:0 @ 0xa9b2880] Setting 'sample_rate' to value '44100'
[graph 0 input from stream 0:0 @ 0xa9b2880] Setting 'sample_fmt' to value 's16p'
[graph 0 input from stream 0:0 @ 0xa9b2880] Setting 'channel_layout' to value '0x3'
[graph 0 input from stream 0:0 @ 0xa9b2880] tb:1/44100 samplefmt:s16p samplerate:44100 chlayout:0x3
[audio format for output stream 0:0 @ 0xa9c0820] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:0 @ 0xa9c0820] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
[AVFilterGraph @ 0xa9b2800] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0xa9c1e80] [SWR @ 0xa9db240] Using s16p internally between filters
[auto-inserted resampler 0 @ 0xa9c1e80] ch:2 chl:stereo fmt:s16p r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
[wav @ 0xa9b16c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, wav, to 'Ice Wharf.wav':
  Metadata:
    INAM            : Ice Wharf
    IART            : Work Drugs
    IPRD            : Aurora Lies
    IPRT            : 6
    ISFT            : Lavf57.41.100
    Stream #0:0, 0, 1/44100: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc57.48.101 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mp3 @ 0xa9b0720] skip 1105 / discard 0 samples due to side data
[mp3 @ 0xa9b0720] skip 1105/1152 samples
[mp3 @ 0xa9aef60] demuxer injecting skip 0 / discard 1152eed= 242x    
[mp3 @ 0xa9b0720] skip 0 / discard 1152 samples due to side data
[mp3 @ 0xa9b0720] Header missing
Error while decoding stream #0:0: Invalid data found when processing input
[output stream 0:0 @ 0xa9c0b80] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
size=   41049kB time=00:03:58.29 bitrate=1411.2kbits/s speed= 245x    
video:0kB audio:41049kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000347%
Input file #0 (Ice Wharf.mp3):
  Input stream #0:0 (audio): 9125 packets read (3813711 bytes); 9123 frames decoded (10508591 samples); 
  Total: 9125 packets (3813711 bytes) demuxed
Output file #0 (Ice Wharf.wav):
  Output stream #0:0 (audio): 9123 frames encoded (10508591 samples); 9123 packets muxed (42034364 bytes); 
  Total: 9123 packets (42034364 bytes) muxed
9123 frames successfully decoded, 1 decoding errors
[AVIOContext @ 0xa9b26c0] Statistics: 4 seeks, 9126 writeouts
[AVIOContext @ 0xa9b7880] Statistics: 3814255 bytes read, 0 seeks

Attachments (1)

Ohh.mp3 (12.8 KB ) - added by Radoslaw Szkodzinski 8 years ago.
Sample file exhibiting the problem

Download all attachments as: .zip

Change History (4)

by Radoslaw Szkodzinski, 8 years ago

Attachment: Ohh.mp3 added

Sample file exhibiting the problem

comment:1 by Radoslaw Szkodzinski, 8 years ago

The problematic tag is generated using mp3gain utility but is a valid APEv2 tag.

comment:2 by Carl Eugen Hoyos, 8 years ago

Keywords: mp3 added
Priority: importantnormal

comment:3 by Carl Eugen Hoyos, 6 years ago

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