[FFmpeg-user] Problems decoding h.264 video

Oliver Fromme oliver at fromme.com
Tue Jul 29 18:45:24 CEST 2014


Hi,

I have problems decoding h.264 video.  This affects _all_ files
with h.264 video that I have tried so far, even files that have
been created with ffmpeg itself.  Therefore I believe this is
not a bug, but I am doing something wrong.  The question is:
What is it that I'm doing wrong?  :-)

I'm using a git snapshot that's just a few days old.
The input file was written with the very same ffmpeg version,
it's a short clip for testing purposes (2 seconds, 160 x 120
pixel resolution, no audio, 67 KB).

$ ffmpeg -i test.mkv test2.mkv
ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 29 2014 14:36:31 with gcc 4.2.1 (GCC) 20070831 patched [FreeBSD]
  configuration: --enable-x11grab --prefix=/usr/local --mandir=/usr/local/man --incdir=/usr/local/include/ffmpeg1 --libdir=/usr/local/lib/ffmpeg1 --shlibdir=/usr/local/lib/ffmpeg1 --datadir=/usr/local/share/ffmpeg1 --build-suffix=1 --progs-suffix=1 --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --disable-debug --disable-libaacplus --disable-indev=alsa --disable-outdev=alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libass --disable-libcdio --disable-libcelt --enable-libfaac --disable-libfdk-aac --enable-fontconfig --enable-libfreetype --disable-frei0r --disable-gnutls --disable-libgsm --enable-libmp3lame --enable-libbluray --enable-libv4l2 --disable-libmodplug --disable-openal --disable-libopencv --enable-libopen!
 jpeg --disable-libopus --disable-libpulse --enable-librtmp --enable-libschroedinger --disable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-nonfree
  libavutil      52. 92.101 / 52. 92.101
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 49.100 / 55. 49.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x80a8a4120] left block unavailable for requested intra4x4 mode -1 at 0 0
[h264 @ 0x80a8a4120] error while decoding MB 0 0, bytestream 2164
[h264 @ 0x80a8a4120] concealing 80 DC, 80 AC, 80 MV errors in I frame
Input #0, matroska,webm, from 'test.mkv':
  Metadata:
    ENCODER         : Lavf55.49.100
  Duration: 00:00:02.17, start: 0.125000, bitrate: 249 kb/s
    Stream #0:0: Video: h264 (High), yuv420p, 160x120 [SAR 1:1 DAR 4:3], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      ENCODER         : Lavc55.69.100 libx264
[libx264 @ 0x80a8a5a20] using SAR=1/1
[libx264 @ 0x80a8a5a20] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x80a8a5a20] profile High, level 1.1
[libx264 @ 0x80a8a5a20] 264 - core 136 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'test2.mkv':
  Metadata:
    encoder         : Lavf55.49.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 160x120 [SAR 1:1 DAR 4:3], q=-1--1, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc55.69.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264 @ 0x80a8a7820] left block unavailable for requested intra4x4 mode -1 at 0 0
[h264 @ 0x80a8a7820] error while decoding MB 0 0, bytestream 2164
[h264 @ 0x80a8a7820] concealing 80 DC, 80 AC, 80 MV errors in I frame
[h264 @ 0x80a8a8220] Cannot use next picture in error concealment
[h264 @ 0x80a8a8220] concealing 34 DC, 34 AC, 34 MV errors in P frame
[h264 @ 0x80a8a8c20] Reference 4 >= 2
[h264 @ 0x80a8a8c20] error while decoding MB 9 1, bytestream 1071
[h264 @ 0x80a8a8c20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9120] concealing 61 DC, 61 AC, 61 MV errors in B frame
[h264 @ 0x80a8a9620] top block unavailable for requested intra mode at 8 0
[h264 @ 0x80a8a9620] error while decoding MB 8 0, bytestream 1487
[h264 @ 0x80a8a9620] concealing 80 DC, 80 AC, 80 MV errors in P frame
[h264 @ 0x80a8a9b20] Reference 3 >= 3
[h264 @ 0x80a8a9b20] error while decoding MB 1 2, bytestream 1067
[h264 @ 0x80a8a9b20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a7820] top block unavailable for requested intra4x4 mode -1 at 3 0
[h264 @ 0x80a8a7820] error while decoding MB 3 0, bytestream 1166
[h264 @ 0x80a8a7820] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8720] top block unavailable for requested intra mode at 1 0
[h264 @ 0x80a8a8720] error while decoding MB 1 0, bytestream 1054
[h264 @ 0x80a8a8720] concealing 80 DC, 80 AC, 80 MV errors in P frame
[h264 @ 0x80a8a8c20] left block unavailable for requested intra4x4 mode -1 at 0 0
[h264 @ 0x80a8a8c20] error while decoding MB 0 0, bytestream 2476
[h264 @ 0x80a8a8c20] concealing 80 DC, 80 AC, 80 MV errors in I frame
[h264 @ 0x80a8a9120] Reference 13 >= 9
[h264 @ 0x80a8a9120] error while decoding MB 5 3, bytestream 1885
[h264 @ 0x80a8a9120] concealing 80 DC, 80 AC, 80 MV errors in P frame
[h264 @ 0x80a8a9b20] top block unavailable for requested intra4x4 mode -1 at 2 0
[h264 @ 0x80a8a9b20] error while decoding MB 2 0, bytestream 1310
[h264 @ 0x80a8a9b20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a7820] Reference 2 >= 2
[h264 @ 0x80a8a7820] error while decoding MB 2 0, bytestream 1231
[h264 @ 0x80a8a7820] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8220] top block unavailable for requested intra mode at 2 0
[h264 @ 0x80a8a8220] error while decoding MB 2 0, bytestream 1179
[h264 @ 0x80a8a8220] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8720] top block unavailable for requested intra mode at 2 0
[h264 @ 0x80a8a8720] error while decoding MB 2 0, bytestream 1837
[h264 @ 0x80a8a8720] concealing 80 DC, 80 AC, 80 MV errors in P frame
[h264 @ 0x80a8a8c20] top block unavailable for requested intra4x4 mode -1 at 2 0
[h264 @ 0x80a8a8c20] error while decoding MB 2 0, bytestream 1375
[h264 @ 0x80a8a8c20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9120] top block unavailable for requested intra mode at 5 0
[h264 @ 0x80a8a9120] error while decoding MB 5 0, bytestream 1189
[h264 @ 0x80a8a9120] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9620] Reference 3 >= 2
[h264 @ 0x80a8a9620] error while decoding MB 8 1, bytestream 1028
[h264 @ 0x80a8a9620] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9b20] Reference 2 >= 2
[h264 @ 0x80a8a9b20] error while decoding MB 4 0, bytestream 1159
[h264 @ 0x80a8a9b20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a7820] concealing 30 DC, 30 AC, 30 MV errors in B frame
[h264 @ 0x80a8a9120] left block unavailable for requested intra4x4 mode -1 at 0 0
[h264 @ 0x80a8a9120] error while decoding MB 0 0, bytestream 1829
[h264 @ 0x80a8a9120] concealing 80 DC, 80 AC, 80 MV errors in I frame
[h264 @ 0x80a8a7820] top block unavailable for requested intra4x4 mode -1 at 1 0
[h264 @ 0x80a8a7820] error while decoding MB 1 0, bytestream 1144
[h264 @ 0x80a8a7820] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8220] Reference 3 >= 2
[h264 @ 0x80a8a8220] error while decoding MB 5 0, bytestream 1154
[h264 @ 0x80a8a8220] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8720] Reference 2 >= 2
[h264 @ 0x80a8a8720] error while decoding MB 1 1, bytestream 963
[h264 @ 0x80a8a8720] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8c20] Reference 3 >= 2
[h264 @ 0x80a8a8c20] error while decoding MB 7 1, bytestream 1228
[h264 @ 0x80a8a8c20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9120] Reference 4 >= 4
[h264 @ 0x80a8a9120] error while decoding MB 6 4, bytestream 961
[h264 @ 0x80a8a9120] Cannot use next picture in error concealment
[h264 @ 0x80a8a9120] concealing 80 DC, 80 AC, 80 MV errors in P frame
[h264 @ 0x80a8a9b20] Reference 4 >= 2
[h264 @ 0x80a8a9b20] error while decoding MB 5 1, bytestream 1201
[h264 @ 0x80a8a9b20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a7820] top block unavailable for requested intra mode at 4 0
[h264 @ 0x80a8a7820] error while decoding MB 4 0, bytestream 1151
[h264 @ 0x80a8a7820] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8220] top block unavailable for requested intra4x4 mode -1 at 1 0
[h264 @ 0x80a8a8220] error while decoding MB 1 0, bytestream 1108
[h264 @ 0x80a8a8220] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9120] top block unavailable for requested intra4x4 mode -1 at 4 0
[h264 @ 0x80a8a9120] error while decoding MB 4 0, bytestream 1053
[h264 @ 0x80a8a9120] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9620] concealing 8 DC, 8 AC, 8 MV errors in B frame
[h264 @ 0x80a8a8220] Reference 2 >= 2
[h264 @ 0x80a8a8220] error while decoding MB 5 1, bytestream 844
[h264 @ 0x80a8a8220] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a8720] Reference 10 >= 10
[h264 @ 0x80a8a8720] error while decoding MB 0 1, bytestream 1227
[h264 @ 0x80a8a8720] concealing 80 DC, 80 AC, 80 MV errors in P frame
[h264 @ 0x80a8a8c20] top block unavailable for requested intra mode at 2 0
[h264 @ 0x80a8a8c20] error while decoding MB 2 0, bytestream 1449
[h264 @ 0x80a8a8c20] concealing 80 DC, 80 AC, 80 MV errors in B frame
[h264 @ 0x80a8a9120] Reference 2 >= 2
[h264 @ 0x80a8a9120] error while decoding MB 1 1, bytestream 1192
[h264 @ 0x80a8a9120] concealing 80 DC, 80 AC, 80 MV errors in B frame
frame=   48 fps=0.0 q=-1.0 Lsize=      11kB time=00:00:01.96 bitrate=  47.3kbits/s    
video:10kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.618292%
[libx264 @ 0x80a8a5a20] frame I:2     Avg QP:11.23  size:   326
[libx264 @ 0x80a8a5a20] frame P:28    Avg QP:20.51  size:   245
[libx264 @ 0x80a8a5a20] frame B:18    Avg QP:21.07  size:   133
[libx264 @ 0x80a8a5a20] consecutive B-frames: 37.5% 33.3% 12.5% 16.7%
[libx264 @ 0x80a8a5a20] mb I  I16..4: 59.4% 32.5%  8.1%
[libx264 @ 0x80a8a5a20] mb P  I16..4:  2.8% 11.1%  1.9%  P16..4: 11.8%  1.7%  1.4%  0.0%  0.0%    skip:69.3%
[libx264 @ 0x80a8a5a20] mb B  I16..4:  0.3%  0.9%  0.1%  B16..8: 15.3%  2.3%  0.7%  direct: 4.3%  skip:76.0%  L0:20.5% L1:67.7% BI:11.8%
[libx264 @ 0x80a8a5a20] 8x8 transform intra:58.9% inter:61.8%
[libx264 @ 0x80a8a5a20] coded y,uvDC,uvAC intra: 35.3% 26.8% 8.3% inter: 5.9% 5.9% 1.3%
[libx264 @ 0x80a8a5a20] i16 v,h,dc,p: 59% 12% 26%  2%
[libx264 @ 0x80a8a5a20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 28% 43%  2%  1%  1%  1%  1%  3%
[libx264 @ 0x80a8a5a20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 39% 19% 27%  4%  2%  2%  2%  3%  3%
[libx264 @ 0x80a8a5a20] i8c dc,h,v,p: 76% 13% 11%  1%
[libx264 @ 0x80a8a5a20] Weighted P-Frames: Y:25.0% UV:17.9%
[libx264 @ 0x80a8a5a20] ref P L0: 67.2% 15.0%  8.9%  8.8%  0.2%
[libx264 @ 0x80a8a5a20] ref B L0: 83.3% 16.7%
[libx264 @ 0x80a8a5a20] kb/s:38.79

The resulting file is unusable, it contains a grey background
with random artifacts and static.

I have uploaded the file, but I guess nobody will be able to
reproduce the problem.  However, it's only 67 KB, so I uploaded
it anyway, I named it "h264-decoding-problems.mkv".

Is there any way to find out what is wrong?  What's the next
step that I should try?  BTW, I have no problems with other
kind of input:  MPEG2, MPEG4-ASP ("xvid") and others all work.
The problem affects only the native h264 decoder.

Best regards
   Oliver


-- 
``We are all but compressed light'' (Albert Einstein)


More information about the ffmpeg-user mailing list