[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1062600: ffmpeg: mp3 decoding reports error (junk in stream) when there is none



Package: ffmpeg
Version: 7:5.1.4-0+deb12u1
Severity: normal

When using avcodec_receive_frame() via libchromaprint1 and fpcalc to decode
mp3 files, some mp3 files are reported as having errors when there are none,
it has just reached end of file.

The error returned from libchromaprint1 via fpcalc is:

ERROR: Error decoding audio frame (End of file)

and results from avcodec_receive_frame() returning a negative value in some
circumstances when reaching the end of input.

mp3val and mp3diags report no problems with the mp3 files in question.

Processing the same input file using ffmpeg also seems to report no errors
or warnings even with -loglevel debug:

Test Command: ffmpeg -i test.mp3 -loglevel debug out.pcm

<snip>
Opening an input file: test.mp3.
[NULL @ 0x555999b62940] Opening 'test.mp3' for reading
[file @ 0x555999b63180] Setting default whitelist 'file,crypto,data'
[mp3 @ 0x555999b62940] Format mp3 probed with size=4096 and score=51
[mp3 @ 0x555999b62940] Skipping 0 bytes of junk at 0.
[mp3 @ 0x555999b62940] Before avformat_find_stream_info() pos: 0 bytes read:65664 seeks:2 nb_streams:1
[mp3 @ 0x555999b62940] All info found
[mp3 @ 0x555999b62940] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x555999b62940] After avformat_find_stream_info() pos: 21504 bytes read:65664 seeks:2 frames:50
Input #0, mp3, from 'test.mp3':
  Duration: 00:01:08.05, start: 0.000000, bitrate: 128 kb/s
  Stream #0:0, 50, 1/14112000: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Successfully opened the file.
Parsing a group of options: output url out.pcm.
Successfully parsed a group of options.
Opening an output file: out.pcm.
[file @ 0x555999b73940] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> adpcm_ima_alp (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 0x555999b78180] Setting 'time_base' to value '1/44100'
[graph_0_in_0_0 @ 0x555999b78180] Setting 'sample_rate' to value '44100'
[graph_0_in_0_0 @ 0x555999b78180] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_0 @ 0x555999b78180] Setting 'channel_layout' to value 'stereo'
[graph_0_in_0_0 @ 0x555999b78180] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo
[format_out_0_0 @ 0x555999b79380] Setting 'sample_fmts' to value 's16'
[format_out_0_0 @ 0x555999b79380] Setting 'channel_layouts' to value 'mono|stereo'
[format_out_0_0 @ 0x555999b79380] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0x555999b659c0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_aresample_0 @ 0x555999b7abc0] [SWR @ 0x555999b8de40] Using fltp internally between filters
[auto_aresample_0 @ 0x555999b7abc0] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
Output #0, alp, to 'out.pcm':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0, 0, 1/44100: Audio: adpcm_ima_alp, 44100 Hz, stereo, s16, 352 kb/s
    Metadata:
      encoder         : Lavc59.37.100 adpcm_ima_alp
[out_0_0 @ 0x555999b78f80] EOF on sink link out_0_0:default.=2.32e+04x    
No more output streams to write to, finishing.
size=    2931kB time=00:01:08.04 bitrate= 352.8kbits/s speed= 212x    
video:0kB audio:2931kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000666%
Input file #0 (test.mp3):
  Input stream #0:0 (audio): 2605 packets read (1088784 bytes); 2605 frames decoded (3000960 samples); 
  Total: 2605 packets (1088784 bytes) demuxed
Output file #0 (out.pcm):
  Output stream #0:0 (audio): 2931 frames encoded (3000960 samples); 2931 packets muxed (3000960 bytes); 
  Total: 2931 packets (3000960 bytes) muxed
[AVIOContext @ 0x555999b73a40] Statistics: 3000980 bytes written, 0 seeks, 12 writeouts
2605 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x555999b6b540] Statistics: 1121680 bytes read, 2 seeks
<snip>

-- System Information:
Debian Release: 12.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-14-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ffmpeg depends on:
ii  libavcodec59    7:5.1.4-0+deb12u1
ii  libavdevice59   7:5.1.4-0+deb12u1
ii  libavfilter8    7:5.1.4-0+deb12u1
ii  libavformat59   7:5.1.4-0+deb12u1
ii  libavutil57     7:5.1.4-0+deb12u1
ii  libc6           2.36-9+deb12u3
ii  libpostproc56   7:5.1.4-0+deb12u1
ii  libsdl2-2.0-0   2.26.5+dfsg-1
ii  libswresample4  7:5.1.4-0+deb12u1
ii  libswscale6     7:5.1.4-0+deb12u1

ffmpeg recommends no packages.

Versions of packages ffmpeg suggests:
pn  ffmpeg-doc  <none>

-- no debconf information


Reply to: