[FFmpeg-devel] [PATCH] lavfi/overlay: add format option

Stefano Sabatini stefasab at gmail.com
Wed Feb 20 19:53:17 CET 2013

On date Wednesday 2013-02-20 17:45:01 +0100, Nicolas George encoded:
> Le duodi 2 ventôse, an CCXXI, Stefano Sabatini a écrit :
> > This can't work, since I need to know the output when doing
> > query_formats(), and set main and overlay input accordingly.
> I see, thanks for explaining.
> > Note that a possibly better fix would be to rescale the main and
> > overlay input to the output format, forced with another mechanism, but
> > this would add a dependency on libswscale and would possibly
> > complicate the logic, thus the current hack is good enough for me.
> There is format negotiation and automatic insertion of scale filters
> specifically to avoid all filters reinventing the (square) wheel by doing
> their own format conversions, so I agree with you for not wanting to
> implement that, although not for the same reason.
> Therefore, I have no objection to the patch. The code looks right to me; you
> may be able to make it slightly simpler with an array of arrays for the
> format lists, but this is very minor.

Patch pushed, feel free to improve it as I was not sure what you
actually meant.

> > Feel free to propose a better fix.
> It seems to me the problem is the same as amerge: you have a relation
> between the format of the various pads that is more subtle than just "be the
> same". I have on my TODO list the task of finding a solution.
> My idea for that is to let query_formats() return EAGAIN: if that happens,
> lavfi is supposed to leave that filter alone for the time being and merge
> some other formats, then it can call query_formats() again, looping until
> all filters are finally configured. Filters that need something subtle just
> return EAGAIN until their input and/or output pads are reduced enough to let
> them make a decision. I have implemented nothing yet.

Yes, please send an RFC so people won't miss the proposal.
FFmpeg = Fundamental and Freak Mastering Pacific Ecumenical Guru

More information about the ffmpeg-devel mailing list