[FFmpeg-user] Image sequence to h264 anything but grayscale is black

Damon Edwards dzedward at gmail.com
Wed Oct 31 02:41:56 CET 2012


When compiling an image sequence of pngs to h264, if the image has any
color the resulting video is all black frames. If the images don't have
color (grayscale) the video plays perfect. Am I missing some dependency or
something? Any help is greatly appreciated!

Below are the two outputs of ffmpeg. It's the same mp3, and the same image
sequence for both of these except one batch is color and one is grayscale.

ffmpeg -i audio.mp3 -f image2 -r 24 -i %6d.png -vcodec libx264 -acodec
libfaac -ab "96k" -ac 2 -b:v "780K" -y output.mp4

Color Images Output (results in black image for the duration of the video,
audio plays)
_____________________________________________________________

ffmpeg version N-46203-g1730dcf Copyright (c) 2000-2012 the FFmpeg
developers
  built on Oct 30 2012 23:48:35 with gcc 4.4.6 (GCC) 20120305 (Red Hat
4.4.6-4)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3 --enable-libfaac --enable-nonfree --enable-libfreetype
--enable-libass
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 70.100 / 54. 70.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.113 /  3. 20.113
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mp3 @ 0x2e0f240] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'audio.mp3':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    date-eng        : 2012-10-30T17:57:02-0700
    date            : 2012-10-30T17:57:02-0700
    encoder-eng     : 6.0
    encoder         : Lavf54.35.100
  Duration: 00:00:00.75, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Input #1, image2, from '%6d.png':
  Duration: 00:00:05.28, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: png, rgb24, 480x360, 24 fps, 24.02 tbr, 24.02 tbn,
24.02 tbc
[libx264 @ 0x2e26720] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x2e26720] profile High 4:4:4 Predictive, level 2.1, 4:4:4 8-bit
[libx264 @ 0x2e26720] 264 - core 128 r2216 198a7ea - H.264/MPEG-4 AVC codec
- Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0
ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0
me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=0 chroma_qp_offset=0 threads=3 lookahead_threads=1
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=24 scenecut=0
intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    date-eng        : 2012-10-30T17:57:02-0700
    date            : 2012-10-30T17:57:02-0700
    encoder-eng     : 6.0
    encoder         : Lavf54.35.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 480x360,
q=-1--1, 19216 tbn, 24.02 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo,
s16, 96 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (png -> libx264)
  Stream #0:0 -> #0:1 (mp3 -> libfaac)
Press [q] to stop, [?] for help
frame=   40 fps=0.0 q=0.0 size=    1402kB time=00:00:01.49
bitrate=7663.8kbits/s
frame=   91 fps= 91 q=0.0 size=    1402kB time=00:00:03.62
bitrate=3171.2kbits/s
frame=  127 fps= 87 q=-1.0 Lsize=   11846kB time=00:00:05.28
bitrate=18354.4kbits/s
video:11835kB audio:9kB subtitle:0 global headers:0kB muxing overhead
0.019483%
[libx264 @ 0x2e26720] frame I:1     Avg QP: 0.00  size:136391
[libx264 @ 0x2e26720] frame P:126   Avg QP: 0.00  size: 95099
[libx264 @ 0x2e26720] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x2e26720] mb P  I16..4: 38.8%  0.0%  0.0%  P16..4: 51.8%  0.0%
 0.0%  0.0%  0.0%    skip: 9.4%
[libx264 @ 0x2e26720] coded y,u,v intra: 92.5% 83.9% 84.9% inter: 73.0%
64.0% 64.5%
[libx264 @ 0x2e26720] i16 v,h,dc,p: 56% 40%  4%  0%
[libx264 @ 0x2e26720] kb/s:18336.74
_____________________________________________________________



Grayscale Images Output (works, both video and audio)
_____________________________________________________________

ffmpeg version N-46203-g1730dcf Copyright (c) 2000-2012 the FFmpeg
developers
  built on Oct 30 2012 23:48:35 with gcc 4.4.6 (GCC) 20120305 (Red Hat
4.4.6-4)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3 --enable-libfaac --enable-nonfree --enable-libfreetype
--enable-libass
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 70.100 / 54. 70.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.113 /  3. 20.113
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mp3 @ 0x2263240] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from 'audio.mp3':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    date-eng        : 2012-10-30T17:57:02-0700
    date            : 2012-10-30T17:57:02-0700
    encoder-eng     : 6.0
    encoder         : Lavf54.35.100
  Duration: 00:00:05.32, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Input #1, image2, from '%6d.png':
  Duration: 00:00:05.28, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: png, gray, 480x360, 24 fps, 24.02 tbr, 24.02 tbn,
24.02 tbc
[libx264 @ 0x227b7e0] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x227b7e0] profile High, level 2.1
[libx264 @ 0x227b7e0] 264 - core 128 r2216 198a7ea - 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=3 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=abr mbtree=1 bitrate=829 ratetol=1.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    date-eng        : 2012-10-30T17:57:02-0700
    date            : 2012-10-30T17:57:02-0700
    encoder-eng     : 6.0
    encoder         : Lavf54.35.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 480x360,
q=-1--1, 829 kb/s, 19216 tbn, 24.02 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo,
s16, 96 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (png -> libx264)
  Stream #0:0 -> #0:1 (mp3 -> libfaac)
Press [q] to stop, [?] for help
frame=   71 fps=0.0 q=17.0 size=      65kB time=00:00:00.91 bitrate=
576.9kbits/s
frame=  114 fps=106 q=16.0 size=     258kB time=00:00:02.70 bitrate=
780.6kbits/s
frame=  127 fps= 77 q=-1.0 Lsize=     511kB time=00:00:05.34 bitrate=
782.9kbits/s
video:442kB audio:63kB subtitle:0 global headers:0kB muxing overhead
1.043501%
[libx264 @ 0x227b7e0] frame I:1     Avg QP:18.77  size:  8908
[libx264 @ 0x227b7e0] frame P:35    Avg QP:12.30  size:  7536
[libx264 @ 0x227b7e0] frame B:91    Avg QP:18.08  size:  1971
[libx264 @ 0x227b7e0] consecutive B-frames:  3.1%  1.6%  7.1% 88.2%
[libx264 @ 0x227b7e0] mb I  I16..4: 73.9%  1.3% 24.8%
[libx264 @ 0x227b7e0] mb P  I16..4:  1.1%  0.1%  0.1%  P16..4: 12.4%  8.6%
 7.6%  0.0%  0.0%    skip:70.0%
[libx264 @ 0x227b7e0] mb B  I16..4:  0.2%  0.0%  0.0%  B16..8: 15.4%  5.4%
 3.5%  direct: 2.9%  skip:72.6%  L0:45.4% L1:33.5% BI:21.1%
[libx264 @ 0x227b7e0] final ratefactor: 10.96
[libx264 @ 0x227b7e0] 8x8 transform intra:4.3% inter:17.8%
[libx264 @ 0x227b7e0] coded y,uvDC,uvAC intra: 25.4% 0.0% 0.0% inter: 11.7%
0.0% 0.0%
[libx264 @ 0x227b7e0] i16 v,h,dc,p: 86% 10%  4%  0%
[libx264 @ 0x227b7e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 19% 35%  2%  1%
 2%  2%  1%  3%
[libx264 @ 0x227b7e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 18% 20%  5%  5%
 5%  4%  4%  5%
[libx264 @ 0x227b7e0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x227b7e0] Weighted P-Frames: Y:22.9% UV:0.0%
[libx264 @ 0x227b7e0] ref P L0: 52.4% 31.0% 10.8%  5.6%  0.2%
[libx264 @ 0x227b7e0] ref B L0: 91.9%  6.1%  1.9%
[libx264 @ 0x227b7e0] ref B L1: 96.3%  3.7%
[libx264 @ 0x227b7e0] kb/s:683.96
_____________________________________________________________


More information about the ffmpeg-user mailing list