4

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) :

shovel

When i don't scale spade.png, it is displaying ok:

ok

But when i scale + rotate spade.png, the colorfill is not working properly:

problem

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

SebSob
  • 552
  • 7
  • 22

1 Answers1

5

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.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • Not sure what's wrong but it's working for me with "c=black@0" but not "c=black@" . Still great thanks for pointing out the alpha setting. – TonyQ Aug 18 '16 at 03:52