[FFmpeg-devel] [PATCH] swscale: set sane alpha blending defaults

Hendrik Leppkes h.leppkes at gmail.com
Sun Aug 30 21:06:54 CEST 2015


On Sun, Aug 30, 2015 at 8:22 PM, wm4 <nfxjfg at googlemail.com> wrote:
> On Sun, 30 Aug 2015 18:09:05 +0000 (UTC)
> Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>
>> wm4 <nfxjfg <at> googlemail.com> writes:
>>
>> > Change the default to blend with black, which
>> > gives generally expected results.
>>
>> Given that this introduces a speed regression, is
>> rarely needed and it is immediately visible that
>> the function is needed, I don't think this is a
>> sensible change.
>
> Performance is no argument in this case. Alpha video is rare in the
> first place, so it won't affect most ffmpeg uses. Also, you can assume
> the alpha channel exists for a reason.
>
> As for speed, the user can always disable alpha blending. I'd rather
> prefer sane, correct default behavior, over fast and broken.
>
>> Note that contrary to visual issue, the performance
>> regression is not immediately visible.
>
> It's the other way around. Did you even look at the test video in the
> issue tracker? Judging whether the result is correct requires manual
> checking of the whole video. On the other hand, libswscale is an
> obvious thing to check when the conversion seems to be going too
> slowly. libswscale is known not to be the fastest, especially with
> "obscure" pixel formats.
>
>> And "black" may be sensible for prores, in all
>> other cases, it is either suboptimal or bad.
>
> Such as? Name all the counter examples you know. I'm curious.
>
> But side from that, blending with _any_ color is still more reasonable
> than discarding the alpha.

I agree, simply discarding information is not a good default. Defaults
should be for reference quality, and degrading-but-faster modes should
be options.

- Hendrik


More information about the ffmpeg-devel mailing list