[FFmpeg-user] Blending two inputs with custom expression

SviMik svimik at gmail.com
Tue May 9 05:17:36 EEST 2017


Let's assume A is a video, and B is a png image with alpha channel. I need
to do the following blending (assuming the format is rgba and B_alpha is in
0...1 range):

red = (A_red - B_red * B_alpha) / (1 - B_alpha);
green = (A_green - B_green * B_alpha) / (1 - B_alpha);
blue = (A_blue - B_blue * B_alpha) / (1 - B_alpha);

I was looking into "blend" filter, but it seems I can't access the other
channels data.
The "geq" filter is limited to a single source.

What shall I use it that case?
I really hate the idea of digging into ffmpeg sources and writing my own
filter. Is there any chance to do this kind of blending without that?


More information about the ffmpeg-user mailing list