I am scaling and rotating a transparent (spade.png) image and placing it as overlay on an input image and save the output.png. This is my command:
ffmpeg -y -i input.png -i spade.png -filter_complex [1]scale=120:114,setsar=1,format=bgra,rotate=0.78:c=none:ow=rotw(0.78):oh=roth(0.78)[s];[0][s]overlay=728-114*sin(0.78):177[out] -pix_fmt bgra -strict experimental -s 640x360 -map [out] output.png
shovel.png (250x238) :
When i don't scale spade.png, it is displaying ok:
But when i scale + rotate spade.png, the colorfill is not working properly:
Is this a known ffmpeg bug? Or am I using the -filter_complex parameters in the wrong order? Should I use another pix_frmt? Any idea's? Thanks
Set c=black@0
. This will fill up the padded area with black but with an alpha of 0, so during overlay, those pixels aren't overlaid.