[FFmpeg-user] H.264 Decoding Issue / Gray Image

Mike Hogan mhogan at timelessveterinary.com
Mon Dec 2 16:25:23 CET 2013


Sorry if this is hard to follow. I've including the output of 3 different
ffmpeg scripts for reference. My problem is occurring at #3 but I'm
wondering if there's actually an issue with #1 and/or my install.

I have a web-based system where videos can be uploaded and played using
JPlayer. I am converting all the videos to H264 using the following:

#1.

%ffmpeg -i test.avi -y -r 24 -vcodec libx264 outfile.m4v
\ffmpeg version 0.11.3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 17:01:59 with gcc 4.2.1 20070719  [FreeBSD]
  configuration: --extra-cflags=-I/usr/local/include
--extra-ldflags=-L/usr/local/lib --prefix=/usr/local --enable-shared
--enable-bzlib --enable-frei0r --enable-gpl --enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-libopencv --enable-libopenjpeg
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libxvid --enable-vdpau
--enable-x11grab --enable-zlib --enable-libx264
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'test.avi':
  Duration: 00:00:01.26, start: 0.000000, bitrate: 5151 kb/s
    Stream #0:0: Video: cinepak (cvid / 0x64697663), yuv420p, 360x256, 30
tbr, 30 tbn, 30 tbc
    Metadata:
      title           : E:\My Documents\Z contrast review\Contrast case
images\Power Do
[buffer @ 0x80520d4c0] w:360 h:256 pixfmt:yuv420p tb:1/30 sar:0/1
sws_param:flags=2
[buffersink @ 0x80520d580] No opaque field provided
[libx264 @ 0x805244c00] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x805244c00] profile High, level 1.3
[libx264 @ 0x805244c00] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft
2003-2012 - 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=6 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=24 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, ipod, to 'outfile.m4v':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 360x256,
q=-1--1, 24 tbn, 24 tbc
    Metadata:
      title           : E:\My Documents\Z contrast review\Contrast case
images\Power Do
Stream mapping:
  Stream #0:0 -> #0:0 (cinepak -> libx264)
Press [q] to stop, [?] for help
frame=   33 fps=0.0 q=32766.0 Lsize=     112kB time=00:00:01.29 bitrate=
712.1kbits/s dup=0 drop=5
video:111kB audio:0kB global headers:0kB muxing overhead 0.926950%
[libx264 @ 0x805244c00] frame I:1     Avg QP:25.24  size:  9573
[libx264 @ 0x805244c00] frame P:28    Avg QP:27.59  size:  3139
[libx264 @ 0x805244c00] frame B:4     Avg QP:30.24  size:  3933
[libx264 @ 0x805244c00] consecutive B-frames: 75.8% 24.2%  0.0%  0.0%
[libx264 @ 0x805244c00] mb I  I16..4: 29.3% 48.1% 22.6%
[libx264 @ 0x805244c00] mb P  I16..4:  1.2% 10.7%  2.4%  P16..4: 11.2%
 7.6%  6.4%  0.0%  0.0%    skip:60.5%
[libx264 @ 0x805244c00] mb B  I16..4:  1.2%  7.7%  2.5%  B16..8: 17.5%
19.2%  9.6%  direct: 7.7%  skip:34.5%  L0:43.1% L1:36.3% BI:20.6%
[libx264 @ 0x805244c00] 8x8 transform intra:69.2% inter:47.4%
[libx264 @ 0x805244c00] coded y,uvDC,uvAC intra: 83.5% 83.7% 75.4% inter:
23.3% 13.9% 5.8%
[libx264 @ 0x805244c00] i16 v,h,dc,p: 76% 16%  7%  1%
[libx264 @ 0x805244c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 17% 13%  8%  8%
 7% 15%  7% 15%
[libx264 @ 0x805244c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 21% 20%  6%  8%
 5% 13%  4%  9%
[libx264 @ 0x805244c00] i8c dc,h,v,p: 46% 19% 19% 15%
[libx264 @ 0x805244c00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x805244c00] ref P L0: 43.7% 23.1% 12.5% 20.7%
[libx264 @ 0x805244c00] ref B L0: 74.3% 25.7%
[libx264 @ 0x805244c00] kb/s:658.66

I am also generating a jpg of the first frame using:

#2.

%ffmpeg -i test.avi -y -ss 0 -vframes 1 outfile.jpg
ffmpeg version 0.11.3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 17:01:59 with gcc 4.2.1 20070719  [FreeBSD]
  configuration: --extra-cflags=-I/usr/local/include
--extra-ldflags=-L/usr/local/lib --prefix=/usr/local --enable-shared
--enable-bzlib --enable-frei0r --enable-gpl --enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-libopencv --enable-libopenjpeg
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libxvid --enable-vdpau
--enable-x11grab --enable-zlib --enable-libx264
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'test.avi':
  Duration: 00:00:01.26, start: 0.000000, bitrate: 5151 kb/s
    Stream #0:0: Video: cinepak (cvid / 0x64697663), yuv420p, 360x256, 30
tbr, 30 tbn, 30 tbc
    Metadata:
      title           : E:\My Documents\Z contrast review\Contrast case
images\Power Do
[buffer @ 0x80520d460] w:360 h:256 pixfmt:yuv420p tb:1/30 sar:0/1
sws_param:flags=2
[buffersink @ 0x80520d520] No opaque field provided
[format @ 0x80520d5e0] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'src' and the filter 'format'
[scale @ 0x80520d700] w:360 h:256 fmt:yuv420p sar:0/1 -> w:360 h:256
fmt:yuvj420p sar:0/1 flags:0x4
Output #0, image2, to 'outfile.jpg':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: mjpeg, yuvj420p, 360x256, q=2-31, 200 kb/s, 90k
tbn, 30 tbc
    Metadata:
      title           : E:\My Documents\Z contrast review\Contrast case
images\Power Do
Stream mapping:
  Stream #0:0 -> #0:0 (cinepak -> mjpeg)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=4.8 Lsize=       0kB time=00:00:00.03 bitrate=
0.0kbits/s
video:14kB audio:0kB global headers:0kB muxing overhead -100.000000%

For the most part this seems to work and the videos play fine in JPlayer.
However, I have discovered that if I take the converted video file, and try
and convert another still image, I just get a gray image.

#3.

%ffmpeg -i outfile.m4v -y -ss 0 -vframes 1 outfile.jpg -loglevel debug
ffmpeg version 0.11.3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 25 2013 17:01:59 with gcc 4.2.1 20070719  [FreeBSD]
  configuration: --extra-cflags=-I/usr/local/include
--extra-ldflags=-L/usr/local/lib --prefix=/usr/local --enable-shared
--enable-bzlib --enable-frei0r --enable-gpl --enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-libopencv --enable-libopenjpeg
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libxvid --enable-vdpau
--enable-x11grab --enable-zlib --enable-libx264
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x805219600] Format mov,mp4,m4a,3gp,3g2,mj2
probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x805219600] ISO: File Type Major Brand: M4V
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x805219600] File position before
avformat_find_stream_info() is 114978
[h264 @ 0x805244200] no picture
[h264 @ 0x805244200] top block unavailable for requested intra4x4 mode -1
at 7 0
[h264 @ 0x805244200] error while decoding MB 7 0, bytestream (9509)
[h264 @ 0x805244200] concealing 368 DC, 368 AC, 368 MV errors
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x805219600] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x805219600] File position after
avformat_find_stream_info() is 10293
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'outfile.m4v':
  Metadata:
    major_brand     : M4V
    minor_version   : 512
    compatible_brands: isomiso2avc1
    encoder         : Lavf54.6.100
  Duration: 00:00:01.37, start: 0.000000, bitrate: 668 kb/s
    Stream #0:0(und), 1, 1/24: Video: h264 (High) (avc1 / 0x31637661),
yuv420p, 360x256, 1/48, 662 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc
    Metadata:
      handler_name    : VideoHandler
[buffer @ 0x80520d400] w:360 h:256 pixfmt:yuv420p tb:1/24 sar:0/1
sws_param:flags=2
[buffersink @ 0x80520d4c0] No opaque field provided
[format @ 0x80520d580] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'src' and the filter 'format'
[scale @ 0x80520d6a0] w:360 h:256 fmt:yuv420p sar:0/1 -> w:360 h:256
fmt:yuvj420p sar:0/1 flags:0x4
[mjpeg @ 0x805244c00] intra_quant_bias = 96 inter_quant_bias = 0
[h264 @ 0x805244200] detected 4 logical cores
Output #0, image2, to 'outfile.jpg':
  Metadata:
    major_brand     : M4V
    minor_version   : 512
    compatible_brands: isomiso2avc1
    encoder         : Lavf54.6.100
    Stream #0:0(und), 0, 1/90000: Video: mjpeg, yuvj420p, 360x256, 1/24,
q=2-31, 200 kb/s, 90k tbn, 24 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
[h264 @ 0x805245b00] no picture
DTS -1, next:-41666 st:0 invalid dropping
[h264 @ 0x805245b00] top block unavailable for requested intra4x4 mode -1
at 7 0
[h264 @ 0x805245b00] error while decoding MB 7 0, bytestream (9509)
[h264 @ 0x805245b00] concealing 368 DC, 368 AC, 368 MV errors
[h264 @ 0x80533f800] no picture
[h264 @ 0x80533f300] Reference 6 >= 3
[h264 @ 0x80533f300] error while decoding MB 7 0, bytestream (6354)
[h264 @ 0x80533f300] concealing 368 DC, 368 AC, 368 MV errors
[h264 @ 0x80533ee00] Reference 6 >= 4
[h264 @ 0x80533ee00] error while decoding MB 13 0, bytestream (451)
[h264 @ 0x80533ee00] concealing 368 DC, 368 AC, 368 MV errors
[h264 @ 0x80533e900] Reference 6 >= 4
[h264 @ 0x80533e900] error while decoding MB 6 0, bytestream (5716)
[h264 @ 0x80533e900] concealing 368 DC, 368 AC, 368 MV errors
[h264 @ 0x805245b00] Reference 6 >= 4
[h264 @ 0x805245b00] error while decoding MB 7 0, bytestream (430)
[h264 @ 0x805245b00] concealing 368 DC, 368 AC, 368 MV errors
[h264 @ 0x80533f800] Reference 6 >= 4
[h264 @ 0x80533f800] error while decoding MB 7 0, bytestream (5666)
[h264 @ 0x80533f800] concealing 368 DC, 368 AC, 368 MV errors
frame=    1 fps=0.0 q=1.6 Lsize=       0kB time=00:00:00.04 bitrate=
0.0kbits/s
video:2kB audio:0kB global headers:0kB muxing overhead -100.000000%

Any thoughts on what's wrong here?


More information about the ffmpeg-user mailing list