ffmpeg overlay rotated images onto a video, how to transparent the output area not covered by the rotated image?

0

I am using ffmpeg to overlay a picture on a movie. The requirement is to rotate the picture through an arbitrary angle. Using filter_complex, I can overlay the rotated picture now. However, the output area of the picture is filled in black and not transparent. I checked the docs, it says can specify the fill color, according to this, but I failed to do so. Any ideas?

I copy my command line here:

./ffmpeg -i mersyvideo.mp4 -i avatar.jpg -filter_complex "[1:v] rotate=-30*PI/180:c=black@'0x00':ow=rotw(iw):oh=roth(ih) [rotate];[0:v][rotate] overlay=40:10" -codec:a copy output/overlayavatar.mp4

xftzg

Posted 2014-07-02T08:49:58.943

Reputation: 3

Have you tried this? -vcodec png -pix_fmt bgra overlayavatar.mov – Ĭsααc tիε βöss – 2014-07-02T10:23:53.197

sorry, but i am not using any PNGs with alpha channel. besides, I do not want to transparent the picture itself. – xftzg – 2014-07-03T04:55:01.583

Answers

0

for transparent try c=none.

ffmpeg -i mersyvideo.mp4 -i avatar.jpg -filter_complex "[1:v] rotate=-    30*PI/180:c=none:ow=rotw(iw):oh=roth(ih) [rotate];[0:v][rotate] overlay=40:10" -codec:a copy output/overlayavatar.mp4

Apostol Victor

Posted 2014-07-02T08:49:58.943

Reputation: 16