#8700: MP2 audio stream in MP4 container is recognized as MP3 ----------------------------------+-------------------------------------- Reporter: Nomis101 | Type: defect Status: new | Priority: normal Component: avformat | Version: git-master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ----------------------------------+-------------------------------------- Summary of the bug: An MP4 file that contains an MP2 audio stream is incorrectly recognized as MP3 stream. Mediainfo recognizes the same stream as "MPEG Audio (Version 1) (Layer 2)" and VLC as "MPEG Audio Layer 1/2 (mpga)".
How to reproduce: I have an MKV file that contains MP2 audio. I converted this into MP4. % ffmpeg -i /Volumes/Developer/Testfile.mkv -c copy /Volumes/Developer/Testfile.mp4 ffmpeg version N-98021-g2a9ffd89fc Copyright (c) 2000-2020 the FFmpeg developers built with Apple clang version 11.0.3 (clang-1103.0.32.62) configuration: --pkg-config-flags=--static --enable-swscale --enable- avfilter --enable-fontconfig --enable-gpl --enable-version3 --enable- libass --enable-libbluray --enable-libfreetype --enable-libsoxr --enable- libaom --enable-libmp3lame --enable-librav1e --enable-libtheora --enable- libvorbis --enable-libvpx --enable-libwavpack --disable-debug --enable- libmysofa --enable-libx264 --enable-libx265 --enable-libxvid --enable- nonfree --enable-libfdk-aac --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=ipod --enable-encoder=eac3 --enable-encoder=ac3 --enable- encoder=flac --enable-ffplay --enable-librtmp --enable-libsmbclient --enable-opencl --enable-libssh --enable-openssl --enable-encoder=truehd --enable-bsf=aac_adtstoasc --enable-encoder=h264_videotoolbox --enable- encoder=hevc_videotoolbox --enable-sdl --extra-ldflags=-L/opt/local/lib libavutil 56. 49.100 / 56. 49.100 libavcodec 58. 90.100 / 58. 90.100 libavformat 58. 44.100 / 58. 44.100 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 84.100 / 7. 84.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, matroska,webm, from '/Volumes/Developer/Testfile.mkv': Metadata: title : Elephant's Dream ENCODER : Lavf58.42.101 Duration: 00:00:03.33, start: 0.000000, bitrate: 9360 kb/s Stream #0:0(eng): Video: vp9 (Profile 3), yuv444p10le(tv, bt709/unknown/unknown), 1920x1080, SAR 1:1 DAR 16:9, 24 fps, 24 tbr, 1k tbn, 1k tbc (default) Metadata: DURATION : 00:00:03.332000000 Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s (default) Metadata: ENCODER : Lavc58.82.100 mp2 DURATION : 00:00:03.317000000 Output #0, mp4, to '/Volumes/Developer/Testfile.mp4': Metadata: title : Elephant's Dream encoder : Lavf58.44.100 Stream #0:0(eng): Video: vp9 (Profile 3) (vp09 / 0x39307076), yuv444p10le(tv, bt709/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 24 tbr, 16k tbn, 1k tbc (default) Metadata: DURATION : 00:00:03.332000000 Stream #0:1(eng): Audio: mp2 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 384 kb/s (default) Metadata: ENCODER : Lavc58.82.100 mp2 DURATION : 00:00:03.317000000 Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 80 fps=0.0 q=-1.0 Lsize= 3808kB time=00:00:03.29 bitrate=9473.1kbits/s speed=38.5x video:3653kB audio:152kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.081670% It seems everything went fine. But inspecting the MP4 file with FFmpeg, gives: % ffmpeg -i /Volumes/Developer/Testfile.mp4 ffmpeg version N-98021-g2a9ffd89fc Copyright (c) 2000-2020 the FFmpeg developers built with Apple clang version 11.0.3 (clang-1103.0.32.62) configuration: --pkg-config-flags=--static --enable-swscale --enable- avfilter --enable-fontconfig --enable-gpl --enable-version3 --enable- libass --enable-libbluray --enable-libfreetype --enable-libsoxr --enable- libaom --enable-libmp3lame --enable-librav1e --enable-libtheora --enable- libvorbis --enable-libvpx --enable-libwavpack --disable-debug --enable- libmysofa --enable-libx264 --enable-libx265 --enable-libxvid --enable- nonfree --enable-libfdk-aac --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=ipod --enable-encoder=eac3 --enable-encoder=ac3 --enable- encoder=flac --enable-ffplay --enable-librtmp --enable-libsmbclient --enable-opencl --enable-libssh --enable-openssl --enable-encoder=truehd --enable-bsf=aac_adtstoasc --enable-encoder=h264_videotoolbox --enable- encoder=hevc_videotoolbox --enable-sdl --extra-ldflags=-L/opt/local/lib libavutil 56. 49.100 / 56. 49.100 libavcodec 58. 90.100 / 58. 90.100 libavformat 58. 44.100 / 58. 44.100 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 84.100 / 7. 84.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/Developer/Testfile.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Elephant's Dream encoder : Lavf58.44.100 Duration: 00:00:03.33, start: 0.000000, bitrate: 9362 kb/s Stream #0:0(eng): Video: vp9 (Profile 3) (vp09 / 0x39307076), yuv444p10le(tv, bt709/unknown/unknown), 1920x1080, 8981 kb/s, SAR 1:1 DAR 16:9, 24.01 fps, 24 tbr, 16k tbn, 16k tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 384 kb/s (default) Metadata: handler_name : SoundHandler At least one output file must be specified Now, it tells it is MP3, but it is MP2 audio. I have attached both files. -- Ticket URL: <https://trac.ffmpeg.org/ticket/8700> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker _______________________________________________ FFmpeg-trac mailing list FFmpeg-trac@avcodec.org https://ffmpeg.org/mailman/listinfo/ffmpeg-trac To unsubscribe, visit link above, or email ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".