Opened 5 years ago
Last modified 5 years ago
#7954 new defect
MP2 audio files "Header missing" and audio drops
Reported by: | Renaud | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | mp2 |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
I have issues with a bunch of .snd audio files presenting regular audio drops. I have that issue with my own player application (self compiled ffmpeg) as well as with ffplay. But Mplayer plays these files perfectly (using mpg123).
FFmpeg complains about "Header missing" and drop the frame (error -0x41444e49 Invalid data found when processing input) causing regular audio drops. This happens systematically every +/-12 seconds (12, 24, 48,...), perfectly reproducible.
A few problematic audio files are available for download here:
https://www.dropbox.com/s/rnnbyvo2duqoq8r/MP2%20Header%20missing%20issue.7z?dl=0
I am running Windows 10 64-bit.
This is the version of ffplay I use, directly from the https://ffmpeg.zeranoe.com/builds/ webiste.
ffplay version N-94014-g80e68ce116 Copyright (c) 2003-2019 the FFmpeg developers
built with gcc 8.3.1 (GCC) 20190414
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 28.100 / 56. 28.100
libavcodec 58. 52.102 / 58. 52.102
libavformat 58. 27.103 / 58. 27.103
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 55.100 / 7. 55.100
libswscale 5. 4.101 / 5. 4.101
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Change History (5)
comment:1 by , 5 years ago
Component: | avcodec → avformat |
---|---|
Keywords: | mp2 added |
Version: | 4.1 → git-master |
comment:3 by , 5 years ago
I am not sure what originally produced this file. More likely a professional broadcast radio automation system. It is not clear to me what exactly the Musicam format is. Wikipedia says: "MP2, sometimes incorrectly called Musicam or MUSICAM". Maybe just an umbrella term for a set of standards.
Coming back to playing these files correctly and with all respect for the amazing FFmpeg project, I guess in short time frame my best bet is to use libmpg123 ?
There is seem to be no occurrence of the string "musicam" in libmpg123 source code so I guess they aren't doing anything specific with it, probably just ignore it.
For my understanding, you changed the component to avformat, I suppose because you mean we need another demuxer but actually the "Header missing" is situated in \libavcodec\mpegaudiodec_template.c, reason why I though it was related to avcodec. I had the feeling that the files are correctly demuxed but sometimes improperly decoded due to a "malformed" mpeg header. What do you think ?
comment:4 by , 5 years ago
The decoder should not be fed with metadata from the file format if that can be avoided, especially since this would also fix remuxing.
The files start with a 2086-byte header (that the demuxer - or parser - drops) that starts with
0xe30xc5MUSICAM
, 2048-byte headers are repeated throughout the file, I guess we need a MUSICAM demuxer.