Opened 7 years ago
Last modified 7 years ago
#7107 new defect
ffmpeg fails silently and generates corrupt file if -ss is used on MP3 file with wrong length
Reported by: | Federico Dossena | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | mp3 |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
I have an MP3 file that seems to have the incorrect length specified in the header.
The file says it's 11m38s long, but it's actually 3m52s.
Normally if I try this:
ffmpeg -ss 600 -i file.mp3 ...
I would get an error, and an exit code != 0; however with this file, I get exit code == 0, and a corrupt output.
Here's the data needed to reproduce the bug, as well as the log: https://drive.google.com/file/d/1Ua5hyB8iwULI6px-wRu9n4AqpDGE1F4c/view?usp=sharing
How to reproduce:
Download the linked archive and run this command
% ffmpeg -ss 600 -i "01-Do Whats Good For Me.mp3" -c:a libopus test.opus ffmpeg version 3.4, official build, on Win64 (also happens on linux amd64)
It should produce an error, but instead it executes normally and test.opus is corrupt
Change History (2)
comment:1 by , 7 years ago
Keywords: | -ss opus corrupt file removed |
---|---|
Version: | 3.4 → unspecified |
comment:2 by , 7 years ago
The bug is still present in the latest version, here's the log.
C:\Users\Federico\Desktop>ffmpeg -v 9 -loglevel 99 -ss 600 -i "01-Do Whats Good For Me.mp3" -c:a libopus test.opus ffmpeg version N-90425-gdb2a7c947e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 7.3.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --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-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth libavutil 56. 12.100 / 56. 12.100 libavcodec 58. 15.100 / 58. 15.100 libavformat 58. 10.100 / 58. 10.100 libavdevice 58. 2.100 / 58. 2.100 libavfilter 7. 13.100 / 7. 13.100 libswscale 5. 0.102 / 5. 0.102 libswresample 3. 0.101 / 3. 0.101 libpostproc 55. 0.100 / 55. 0.100 Splitting the commandline. Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'. Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '600'. Reading option '-i' ... matched as input url with argument '01-Do Whats Good For Me.mp3'. Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'libopus'. Reading option 'test.opus' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set logging level) with argument 9. Successfully parsed a group of options. Parsing a group of options: input url 01-Do Whats Good For Me.mp3. Applying option ss (set the start time offset) with argument 600. Successfully parsed a group of options. Opening an input file: 01-Do Whats Good For Me.mp3. [NULL @ 00000226f13ca4c0] Opening '01-Do Whats Good For Me.mp3' for reading [file @ 00000226f13cb640] Setting default whitelist 'file,crypto' Probing mp3 score:51 size:1792 [mp3 @ 00000226f13ca4c0] Format mp3 probed with size=2048 and score=51 id3v2 ver:3 flags:00 len:246 [mp3 @ 00000226f13ca4c0] Skipping 417 bytes of junk at 256. [mp3 @ 00000226f13ca4c0] Before avformat_find_stream_info() pos: 673 bytes read:32768 seeks:0 nb_streams:1 [mp3 @ 00000226f13ca4c0] All info found [mp3 @ 00000226f13ca4c0] Estimating duration from bitrate, this may be inaccurate [mp3 @ 00000226f13ca4c0] stream 0: start_time: 0.000 duration: 698.036 [mp3 @ 00000226f13ca4c0] format: start_time: 0.000 duration: 698.036 bitrate=74 kb/s [mp3 @ 00000226f13ca4c0] After avformat_find_stream_info() pos: 12961 bytes read:32768 seeks:0 frames:50 Input #0, mp3, from '01-Do Whats Good For Me.mp3': Metadata: title : Do What's Good For Me comment : ThuGGinOutLaW track : 1 album : The Very Best Of 2 Unlimited artist : 2 Unlimited genre : Dance date : 2006 id3v2_priv.AverageLevel: \xa3\x1e\x00\x00 id3v2_priv.PeakValue: \xff\x7f\x00\x00 Duration: 00:11:38.04, start: 0.000000, bitrate: 74 kb/s Stream #0:0, 50, 1/14112000: Audio: mp3, 44100 Hz, stereo, s16p, 74 kb/s Successfully opened the file. Parsing a group of options: output url test.opus. Applying option c:a (codec name) with argument libopus. Successfully parsed a group of options. Opening an output file: test.opus. File 'test.opus' already exists. Overwrite ? [y/N] y [file @ 00000226f13cc440] Setting default whitelist 'file,crypto' Successfully opened the file. Stream mapping: Stream #0:0 -> #0:0 (mp3 (native) -> opus (libopus)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) detected 12 logical cores [graph_0_in_0_0 @ 00000226f13e9040] Setting 'time_base' to value '1/44100' [graph_0_in_0_0 @ 00000226f13e9040] Setting 'sample_rate' to value '44100' [graph_0_in_0_0 @ 00000226f13e9040] Setting 'sample_fmt' to value 's16p' [graph_0_in_0_0 @ 00000226f13e9040] Setting 'channel_layout' to value '0x3' [graph_0_in_0_0 @ 00000226f13e9040] tb:1/44100 samplefmt:s16p samplerate:44100 chlayout:0x3 [format_out_0_0 @ 00000226f13e9d40] Setting 'sample_fmts' to value 's16|flt' [format_out_0_0 @ 00000226f13e9d40] Setting 'sample_rates' to value '48000|24000|16000|12000|8000' [format_out_0_0 @ 00000226f13e9d40] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0' [AVFilterGraph @ 00000226f13eb680] query_formats: 5 queried, 9 merged, 3 already done, 0 delayed [auto_resampler_0 @ 00000226f13e9c40] picking s16 out of 2 ref:s16p [auto_resampler_0 @ 00000226f13e9c40] [SWR @ 00000226f146a000] Using s16p internally between filters [auto_resampler_0 @ 00000226f13e9c40] ch:2 chl:stereo fmt:s16p r:44100Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz [libopus @ 00000226f13cbe40] No bit rate set. Defaulting to 96000 bps. Output #0, opus, to 'test.opus': Metadata: title : Do What's Good For Me comment : ThuGGinOutLaW track : 1 album : The Very Best Of 2 Unlimited artist : 2 Unlimited genre : Dance date : 2006 id3v2_priv.AverageLevel: \xa3\x1e\x00\x00 id3v2_priv.PeakValue: \xff\x7f\x00\x00 encoder : Lavf58.10.100 Stream #0:0, 0, 1/48000: Audio: opus (libopus), 48000 Hz, stereo, s16, delay 312, 96 kb/s Metadata: encoder : Lavc58.15.100 libopus title : Do What's Good For Me DESCRIPTION : ThuGGinOutLaW TRACKNUMBER : 1 album : The Very Best Of 2 Unlimited artist : 2 Unlimited genre : Dance date : 2006 id3v2_priv.AverageLevel: \xa3\x1e\x00\x00 id3v2_priv.PeakValue: \xff\x7f\x00\x00 cur_dts is invalid (this is harmless if it occurs once at the start per stream) Last message repeated 1 times [out_0_0 @ 00000226f13e8040] EOF on sink link out_0_0:default. No more output streams to write to, finishing. size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (01-Do Whats Good For Me.mp3): Input stream #0:0 (audio): 1 packets read (104 bytes); 1 frames decoded (1152 samples); Total: 1 packets (104 bytes) demuxed Output file #0 (test.opus): Output stream #0:0 (audio): 0 frames encoded (0 samples); 0 packets muxed (0 bytes); Total: 0 packets (0 bytes) muxed 1 frames successfully decoded, 0 decoding errors [AVIOContext @ 00000226f13e7440] Statistics: 0 seeks, 2 writeouts [AVIOContext @ 00000226f13d3880] Statistics: 6460473 bytes read, 0 seeks
Please test current FFmpeg git head and provide the command line you tested including the complete, uncut console output to make this a valid ticket. If libopus output is not required to reproduce the issue, please use an internal encoder, not one that has an external depedency.