[FFmpeg-user] v360: filling unmapped pixels with a color

Michael Koch astroelectronic at t-online.de
Sun Dec 27 22:59:21 EET 2020


Hello,

In the v360 filter the alpha_mask option can be used to make unmapped 
pixels transparent.
What's the simplest method for filling all transparent pixels with a color?
Let's assume the size of the video isn't known in advance.
This command line is working as expected:

ffmpeg -i input.mp4 -f lavfi -i color=red -lavfi 
"[0]v360=e:ball:alpha_mask=1[a];[1][a]scale2ref,overlay=shortest=1" 
output.mp4

But it looks unnecessary complicated to use a second input, scale it to 
the same size, and then use overlay.
Does anybody know a better solution? The job is simple: If a pixel is 
transparent, then fill it with a color.
I know it can be done with the geq filter, but that's too slow.

Michael


More information about the ffmpeg-user mailing list