[Ffmpeg-devel] Add some other PIX_FMT_ ---> IMGFMT conversionsto libswscale

Luca Abeni lucabe72
Sat Aug 5 09:47:12 CEST 2006

Hi Michael,

On Sat, 2006-08-05 at 01:03 +0200, Michael Niedermayer wrote:
> Hi
> On Sat, Aug 05, 2006 at 12:17:05AM +0200, Luca Abeni wrote:
> > Hi all,
> > 
> > while testing a version of ffmpeg using libswscale (see my previous
> > email) I noticed that some PIX_FMT_* values are not converted in
> > IMGFT_*...
> > 
> > In particular, I noticed PIX_FMT_YUVJ420P, PIX_FMT_GRAY8, and
> > PIX_FMT_MONOWHITE. Looking at some code in mplayer, I coocked up the
> > attached patch for libswscale (is it correct?), but I do not know how to
> > convert PIX_FMT_MONOWHITE. Can anyone help me?
> i think thats not supported, and there arent many codecs which use it
> after all mplayer with lavc doenst support it either ...
> IMHO ignore it for now and after the swscaler move is done you can
> add support for it to swscale :)
Fine by me ;-)
In the meanwhile, "make test" will segfault when "--enable-swscaler" is
used. Uhmmm... No, I can fix ffmpeg.c to exit cleanly instead of
segfaulting :)

> >  /* Used for ffmpeg --> MPlayer format name conversion */
> >  static const int fmt_name[PIX_FMT_NB] = {
> >      [PIX_FMT_YUV420P] = IMGFMT_I420,   ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
> > +    [PIX_FMT_YUVJ420P] = IMGFMT_I420,
> its not so simple, there are many slightly different YUV types, fabrice
> picked 2, the one most commonly used in mpeg videos and the one used in jpeg
> swscale supports any (minus bugs and half implemented stuff), via 
> sws_setColorspaceDetails()
I was not sure about this part of the patch. I just copied it from
mplayer/libmpcodecs/vd_ffmpeg.c:init_vo(), but I probably missed some
So, the correct solution would be to use sws_setColorspaceDetails()?
I'll have a look into it.

I assume the "[PIX_FMT_GRAY8] = IMGFMT_Y800" part is correct? If so,
I'll commit it.


More information about the ffmpeg-devel mailing list