[FFmpeg-devel] [PATCH] Set color_space instead of?deprecated?YUVJ* pixel formats

Michael Niedermayer michaelni at gmx.at
Thu Sep 1 16:29:42 CEST 2011


On Thu, Sep 01, 2011 at 09:24:34AM +0100, Gavin Kinsey wrote:
> On Thursday 01 September 2011 08:20:44 Gavin Kinsey wrote:
> > On Wednesday 31 August 2011 21:13:01 Michael Niedermayer wrote:
> > > On Wed, Aug 31, 2011 at 02:02:40PM +0100, Gavin Kinsey wrote:
> > > > On Wednesday 31 August 2011 13:52:35 Gavin Kinsey wrote:
> > > > > On Wednesday 31 August 2011 13:27:56 Michael Niedermayer wrote:
> > > > > > On Wed, Aug 31, 2011 at 08:20:47AM +0100, Gavin Kinsey wrote:
> > > > > > > Set color_space instead of deprecated YUVJ* pixel formats in
> > > > > > > MJPEG decoder.
> > > > > > 
> > > > > > i think the pixel format should be left for compatibility for
> > > > > > now, just setting color_range in addition seems better
> > > > > 
> > > > > The colour conversion is different in that case.  Something
> > > > > different happens in swscale if the pixel format is YUVJ*, with or
> > > > > without color_range.
> > > > > 
> > > > > Now perhaps this altered colour palette is correct, it wouldn't be
> > > > > the first time our servers send the wrong data, but it just looks
> > > > > washed-out to me.
> > > 
> > > as you say "our servers" could you maybe check what they send and
> > > elaborate on that a bit ?
> 
> Okay, I've talked with one of the server guys and got some details on what 
> is being sent.  The server just passes through the colour space that is used 
> by the camera, so it sends CCIR 601 format for both JPEG and MPEG.  It 
> doesn't appear to set the "CS=ITU601" in the JPEG comment data that ffmpeg is 
> looking for though, so as a result ffmpeg picks the wrong pixel format.
> 
> I'll have to adjust this in my application as ffmpeg is doing the right thing 
> as far as it knows.

Is there some other way than "CS=ITU601" to detect this ?
i think it might make sense if ffmpeg had a workaround and detected
that



> 
> New patch attached that just sets color_range and leaves pixel format 
> unchanged.
> 
> > I understand keeping YUVJ* in for application compatibility, but YUV420p
> > + AVCOL_RANGE_JPEG should be functionally equivalent to YUVJ420p inside
> > ffmpeg. If it isn't, then that's a bug surely?  Or am I misunderstanding
> > something?
> 
> Still think this is an issue though.

absolutley agree, and patch is welcome :)

and patch applied and
thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110901/ad6d09a7/attachment.asc>


More information about the ffmpeg-devel mailing list