[FFmpeg-devel] [PATCH]Support encoding gray8a in pam

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 15 14:00:07 CET 2012


On Sun, Jan 15, 2012 at 12:53:06PM +0100, Stefano Sabatini wrote:
> On date Sunday 2012-01-15 00:17:16 +0000, Carl Eugen Hoyos encoded:
> > Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
> > 
> > > Michael Niedermayer <michaelni <at> gmx.at> writes:
> > > 
> > > > > Attached patch allows encoding gray8a in pam.
> > > > > Decoding currently unsupported.
> > > > 
> > > > if it has been tested it should be ok
> > > 
> > > Patch applied.
> > 
> > This "broke" pam encoding insofar as avcodec_find_best_pix_fmt2() prefers gray8a
> > over all (?) other pix_fmts...
> > 
> > I don't know how to fix this, Carl Eugen
> > 
> > $ ffmpeg -i out.jpg out.pam
> > ...
> > Input #0, image2, from 'out.jpg':
> >   Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
> >     Stream #0:0: Video: mjpeg, yuvj420p, 256x256, 25 tbr, 25 tbn, 25 tbc
> > Incompatible pixel format 'yuvj420p' for codec 'pam', auto-selecting format
> > 'gray8a'
> > [buffer @ 0x8dd6aa0] w:256 h:256 pixfmt:yuvj420p tb:1/1000000 sar:0/1 sws_param:
> > [buffersink @ 0x8dc9100] auto-inserting filter 'auto-inserted scale 0' between
> > the filter 'src' and the filter 'out'
> > Impossible to convert between the formats supported by the filter 'auto-inserted
> > scale 0' and the filter 'out'
> > Error opening filters!
> 
> A possible solution would be to implement gray8 in libswscale (and
> thus support it in the scale filter).

That wouldn't have been a "fix" for the bigger issue, namely that
all images would become grayscale no matter how colorful they
were originally, which is nonsense (and Michael has fixed that).
Also I think gray8 is supported, just gray8a is at issue here.


More information about the ffmpeg-devel mailing list