[FFmpeg-user] Problem with white-washed images

fatalaccidents thefatalaccidents at gmail.com
Mon Jul 8 22:02:03 CEST 2013


Hey guys, 

I have been having a problem with converting multiple jpegs into an mp4. 
The problem seems to be with the colorspaces, or at least in the way that
most video players play back certain mp4s with certain colorspaces.  I have
posted on this without being able to resolve it, but I thought giving more
information might help me come to a working conclusion.  The images I start
with are grey, and an identify -verbose of one looks like: 

[code] 
Image: GA1_264000_b3.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: PseudoClass
  Geometry: 1800x1800+0+0
  Resolution: 72x72
  Print size: 25x25
  Units: PixelsPerInch
  Type: Grayscale
  Endianess: Undefined
  Colorspace: Gray
  Depth: 8-bit
  Channel depth:
    gray: 8-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 255 (1)
      mean: 211.31 (0.828667)
      standard deviation: 92.5697 (0.363019)
      kurtosis: 1.30688
      skewness: -1.79377
  Colors: 256
  Histogram: 
  Colormap:
  Rendering intent: Undefined
  Gamma: 1
  Background color: gray(255)
  Border color: gray(223)
  Matte color: gray(189)
  Transparent color: gray(0)
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 1800x1800+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 100
  Orientation: Undefined
  Properties:
    date:create: 2013-07-02T10:27:12-05:00
    date:modify: 2013-05-26T11:16:54-05:00
    jpeg:colorspace: 1
    jpeg:sampling-factor: 1x1
    signature:
abeb35b2067e33de189df94bb0f1b973aa8c9ce47a70ebdd3da71661abd4c6fc
  Artifacts:
    filename: GA1_264000_b3.jpg
    verbose: true
  Tainted: True
  Filesize: 285KB
  Number pixels: 3.24M
  Pixels per second: 29.45MB
[/code]


I took the Histogram and Colormap out for space, but the colors go from 0 to
255.  I think somewhere along the lines it is being compressed into a
smaller scale, and white washing the resulting video.  FFplay will play the
video with the correct colors, but every other player messes it up.  Has
anyone encountered this problem before?   I've been trying to fix it for
quite some time now.

The command: ffmpeg -f image2 -r 10 -pattern_type glob -i '*.jpg' -c:v
libx264 out.mp4   gives this output:
[code]
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 29 2013 17:51:44 with gcc 4.2.1 (GCC) (Apple Inc. build 5666)
(dot 3)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter
--enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora
--enable-libschroedinger --enable-libopenjpeg --enable-libmodplug
--enable-libvpx --enable-libspeex --enable-libfreetype
--mandir=/opt/local/share/man --enable-shared --enable-pthreads
--cc=/usr/bin/gcc-4.2 --enable-gpl --enable-postproc --enable-libx264
--enable-libxvid --arch=x86_64 --enable-yasm
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, image2, from '*.jpg':
  Duration: 00:00:12.10, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, gray, 1800x1800 [SAR 72:72 DAR 1:1], 10 fps,
10 tbr, 10 tbn, 10 tbc
[libx264 @ 0x102009e00] using SAR=1/1
[libx264 @ 0x102009e00] using cpu capabilities: none!
[libx264 @ 0x102009e00] profile High, level 5.0
[libx264 @ 0x102009e00] 264 - core 129 - 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=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=10 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, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf54.63.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 1800x1800
[SAR 1:1 DAR 1:1], q=-1--1, 10240 tbn, 10 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> libx264)
Press [q] to stop, [?] for help
frame=  121 fps=3.0 q=-1.0 Lsize=    1955kB time=00:00:11.90
bitrate=1345.7kbits/s    
video:1953kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.107075%
[libx264 @ 0x102009e00] frame I:2     Avg QP:15.70  size:108097
[libx264 @ 0x102009e00] frame P:51    Avg QP:19.14  size: 30949
[libx264 @ 0x102009e00] frame B:68    Avg QP:20.66  size:  3003
[libx264 @ 0x102009e00] consecutive B-frames: 23.1%  3.3%  7.4% 66.1%
[libx264 @ 0x102009e00] mb I  I16..4: 66.7% 19.1% 14.2%
[libx264 @ 0x102009e00] mb P  I16..4: 13.6%  8.7%  2.3%  P16..4:  7.1%  0.7% 
0.7%  0.0%  0.0%    skip:66.8%
[libx264 @ 0x102009e00] mb B  I16..4:  0.1%  0.2%  0.1%  B16..8:  3.0%  0.2% 
0.1%  direct: 1.6%  skip:94.7%  L0:37.0% L1:58.6% BI: 4.4%
[libx264 @ 0x102009e00] 8x8 transform intra:33.5% inter:65.0%
[libx264 @ 0x102009e00] coded y,uvDC,uvAC intra: 29.2% 0.0% 0.0% inter: 4.4%
0.0% 0.0%
[libx264 @ 0x102009e00] i16 v,h,dc,p: 94%  3%  1%  2%
[libx264 @ 0x102009e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 23% 25%  6%  8% 
5% 11%  4%  9%
[libx264 @ 0x102009e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 26% 23%  6%  8% 
5% 10%  3%  6%
[libx264 @ 0x102009e00] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x102009e00] Weighted P-Frames: Y:47.1% UV:0.0%
[libx264 @ 0x102009e00] ref P L0: 48.0% 33.3% 10.3%  3.3%  5.1%
[libx264 @ 0x102009e00] ref B L0: 78.2% 17.5%  4.3%
[libx264 @ 0x102009e00] ref B L1: 94.6%  5.4%
[libx264 @ 0x102009e00] kb/s:1321.53
[/code]

When played with mplayer, I'm getting this output: 
[code]
MPlayer 1.1-4.2.1 (C) 2000-2012 MPlayer Team
192 audio & 400 video codecs

Playing out.mp4.
libavformat version 54.6.101 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
VIDEO:  [H264]  1800x1800  24bpp  10.000 fps  1322.0 kbps (161.4 kbyte/s)
Clip info:
 major_brand: isom
 minor_version: 512
 compatible_brands: isomiso2avc1mp41
 encoder: Lavf54.63.104
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.23.100 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.00:1 - prescaling to correct movie aspect.
[swscaler @ 0x100b41620]BICUBIC scaler, from yuv420p to yuyv422 using MMX2
VO: [corevideo] 1800x1800 => 1800x1800 Packed YUY2 
[/code]

If I capture the first image from the video and identify it, it is much
different in terms of its histogram than the first jpeg.
Any help would be greatly, greatly appreciated. 

Thanks!



--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Problem-with-white-washed-images-tp4659873.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list