[MEncoder-users] Color Space Problem with a Sequence of RGB JPEG Images

Irv Elshoff elshoff at wldelft.nl
Wed Oct 7 23:25:49 CEST 2009


  Reimar Döffinger wrote:
> On Wed, Oct 07, 2009 at 12:35:04AM +0200, Irv Elshoff wrote:
>   
>> The JPEG images were produced by my own  C++ program using the
>> ubiquitous libjpeg "6b" library.  In my output routine I set the
>> color space to JCS_RGB ...
>>     
>
> Better test with and report to FFmpeg, MPlayer should be using their decoder.
>   

Riemar, thanks for your reply.

Today I downloaded, compiled and installed FFmpeg, and indeed I'm having 
the same problem.

I also tried Adobe Premiere (CS3 on a Mac) and it produces the same 
(incorrect) result.  I presume Premiere uses a completely different code 
base (100% proprietary).

It looks like the problem is that Mencoder, FFmpeg and Premiere are 
*assuming* my JPEG files are YCbCr, even though they're actually RGB.  A 
Wikipedia article 
(http://en.wikipedia.org/wiki/JPEG#Color_space_transformation) suggests 
that YCbCr is the prefered encoding and that RGB is less "compatible".

Both Mencoder and FFmpeg include and use "libopenjpeg" 
(http://www.openjpeg.org).  ImageMagick and my own JPEG image generating 
program use "libjpeg6b" from the Independent JPEG Group 
(http://www.ijg.org/).  ImageMagick has no problem with RGB JPEG 
images.  Neither does MATLAB, by the way (presumably another proprietary 
image reader).

It looks like the problem is in the JPEG input routines (= library).

I'd appreciate any opinion on the matter.

Are caveats about "RGB JPEG" something that needs to better documented?

Cheers,
    Irv.




More information about the MEncoder-users mailing list