Opened 5 years ago

Last modified 5 years ago

#3662 new defect

Corrupt media file causes ffmpeg to output confusing error messages about "options"

Reported by: b_jonas Owned by:
Priority: minor Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Dear ffmpeg team!

This report demonstrates an example when reading a corrupt media file causes ffmpeg to output confusing error messages. The media file is known to be wrong, you should not be able to play it. However, ffmpeg outputs such error messages that suggest the error is in the command-line options I gave to ffmpeg. In particular, notice the two lines

[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'pix_fmt' to value '-1'
[buffer @ 000000000051aa40] Unable to parse option

value "-1" as pixel format
which I thought would refer to the command-line options I gave. Further, these messages are errors, not merely warnings (I'm sort of used to seeing warnings about color space or frame rate when reading jpeg files by now).

To reproduce the problem, I have uploaded the file pix_fmt_unknown.mp4 to the ftp server "ftp://upload.ffmpeg.org/incoming". I have tried to save the first frame of this video with the command line

ffmpeg -v 99 -report -i tmp/pix_fmt_unknown.mp4 -frames 1 -pix_fmt gray -y tmp/sampl0.png

which gives the above mentioned error messages. This has happened on Windows x86_64. Below I reproduce the entire log file.

ffmpeg started on 2014-05-22 at 14:25:56
Report written to "ffmpeg-20140522-142556.log"
Command line:
"E:
ambrus
local
ffmpeg-20140429-git-21c7e99-win64-shared
bin
ffmpeg.exe" -v 99 -report -i tmp/pix_fmt_unknown.mp4 -frames 1 -pix_fmt gray -y tmp/sampl0.png
ffmpeg version N-62777-g21c7e99 Copyright (c) 2000-2014 the FFmpeg developers

built on Apr 28 2014 22:12:47 with gcc 4.8.2 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 79.100 / 52. 79.100
libavcodec 55. 59.101 / 55. 59.101
libavformat 55. 37.101 / 55. 37.101
libavdevice 55. 13.100 / 55. 13.100
libavfilter 4. 4.100 / 4. 4.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100

Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '99'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input file with argument 'tmp/pix_fmt_unknown.mp4'.
Reading option '-frames' ... matched as option 'frames' (set the number of frames to record) with argument '1'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'gray'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'tmp/sampl0.png' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 99.
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file tmp/pix_fmt_unknown.mp4.
Successfully parsed a group of options.
Opening an input file: tmp/pix_fmt_unknown.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000052c480] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000052c480] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000052c480] Before avformat_find_stream_info() pos: 1422165 bytes read:1454854 seeks:0
[h264 @ 000000000063efc0] AVC: Consumed only 7831 bytes instead of 8812
[h264 @ 000000000063efc0] Frame num gap 5 3
[h264 @ 000000000063efc0] bytestream overread -7
[h264 @ 000000000063efc0] error while decoding MB 64 57, bytestream -7
[h264 @ 000000000063efc0] Cannot use next picture in error concealment
[h264 @ 000000000063efc0] concealing 545 DC, 545 AC, 545 MV errors in P frame
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[h264 @ 000000000063efc0] AVC: nal size 0
[h264 @ 000000000063efc0] no frame!
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000052c480] decoding for stream 1 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000052c480] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 1280x1024, 1/2000000): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000052c480] After avformat_find_stream_info() pos: 2151250 bytes read:2097153 seeks:1 frames:61
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tmp/pix_fmt_unknown.mp4':

Metadata:

major_brand : isom
minor_version : 0
compatible_brands: mp41avc1qt
creation_time : 2014-05-17 08:22:35
encoder : vlc 2.1.3 stream output
encoder-eng : vlc 2.1.3 stream output

Duration: 01:25:32.53, start: 0.000000, bitrate: 3 kb/s

Stream #0:0(eng), 0, 1/1000000: Video: h264 (avc1 / 0x31637661), 1280x1024, 1/2000000, 1000k tbr, 1000k tbn, 2000k tbc (default)
Metadata:

creation_time : 2014-05-17 08:22:35
handler_name : VideoHandler?

Stream #0:1(eng), 61, 1/1000000: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt470bg), 1280x1024, 1001/60000, 1747 kb/s, 25.01 fps, 29.97 tbr, 1000k tbn, 59.94 tbc (default)
Metadata:

creation_time : 2014-05-17 08:22:35
handler_name : VideoHandler?

Successfully opened the file.
Parsing a group of options: output file tmp/sampl0.png.
Applying option frames (set the number of frames to record) with argument 1.
Applying option pix_fmt (set pixel format) with argument gray.
Successfully parsed a group of options.
Opening an output file: tmp/sampl0.png.
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'video_size' to value '1280x1024'
[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'pix_fmt' to value '-1'
[buffer @ 000000000051aa40] Unable to parse option value "-1" as pixel format
[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'time_base' to value '1/1000000'
[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 000000000063be20] Setting 'frame_rate' to value '2000000/2'
[buffer @ 000000000051aa40] Unable to parse option value "-1" as pixel format
[buffer @ 000000000051aa40] Error setting option pix_fmt to value -1.
[graph 0 input from stream 0:0 @ 000000000063be20] Error applying options to the filter.
Error opening filters!
[AVIOContext @ 0000000000534ae0] Statistics: 2097153 bytes read, 1 seeks
Conversion failed!

Attachments (1)

pix_fmt_unknown.mp4 (2.0 MB) - added by cehoyos 5 years ago.

Change History (2)

Changed 5 years ago by cehoyos

comment:1 Changed 5 years ago by cehoyos

You have to read the messages that FFmpeg prints from top to bottom:

[h264 @ 0x2338760] error while decoding MB 64 57, bytestream -7
[h264 @ 0x2338760] Cannot use next picture in error concealment
[h264 @ 0x2338760] concealing 545 DC, 545 AC, 545 MV errors in P frame
[h264 @ 0x2338760] AVC: nal size 0
[h264 @ 0x2338760] no frame!                                                                  
[h264 @ 0x2338760] AVC: nal size 0
[h264 @ 0x2338760] no frame!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2336ae0] decoding for stream 1 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2336ae0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 1280x1024): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options

unspecified pixel format is printed (which is correct) and a suggestion (that does not help in your case but in many other cases) is given. I don't see how this can be easily improved.
Later messages are not necessarily relevant: There are many examples for error messages that are superseded by messages printer earlier.

Note: See TracTickets for help on using tickets.