[FFmpeg-devel] [PATCH]lavf/webpenc: Do not set alpha flag for yuv420p

wm4 nfxjfg at googlemail.com
Wed Apr 13 10:27:03 CEST 2016

On Tue, 12 Apr 2016 19:53:13 +0000 (UTC)
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> wm4 <nfxjfg <at> googlemail.com> writes:
> > > -                flags |= 2 + 16;
> > > +                flags |= 2;
> > > +                if (st->codecpar->format != AV_PIX_FMT_YUV420P)
> > > +                    flags |= 16; // stream may contain transparency 
> > > information  
> > The pixel format shouldn't be required to be set in this muxer.  
> I am sorry, I don't understand the word "should" in this 
> sentence: Do you mean the webp specification is bad or 
> that the muxer should use a different information to 
> find out if the frames may contain transparency?
> Or that the ticket is invalid or that I misunderstand it?

No, I'm just saying that using the pixel format here (or how it's used)
is not overly robust.

Maybe there is not better way to signal alpha content to the muxer, but
even then it sounds wrong to assume alpha if the format is not set.
Maybe it should just check whether the pixel format is alpha, instead
of whether it's not yuv420p. (Just a suggestion.)

But ideally maybe it could be parsed from the image data? (I'm not sure
if that's feasible.)

> > It's generally not needed.  
> If it is not needed, why is it available?

Because the API is generic and provides many fields.

> > It also means that if the user doesn't set it,
> > everything will apparently work well, but it 
> > will be flagged as alpha.  
> The webp format afaict needs the information, if the 
> user prefers not to set it, what is the solution?
> > When will you learn to send properly formatted 
> > patches (git format-patch)?  
> Is this related to the patch?
> Or do you want to commit my patches (this is not necessary)?

It's fine if you apply your own patches, but commit messages are part
of a patch. You keep sending patches without them. We even tell new
contributors to send git format-patches, what does it look like when a
core developer doesn't follow the same suggestions?

More information about the ffmpeg-devel mailing list