Sunday, 13 May 2018

FFMPEG scale video according to image height when overlaying video on image


I am trying to overlay a video over an image in FFMPEG. For this I am using the below command.


-i C:\Users\Vivek\Desktop\SAM\Effects\bubbles.mp4 -i C:\Users\Vivek\Desktop\selfie.jpg -filter_complex "[1:v][0:v]scale2ref[ua][b];[ua]setsar=1,format=yuva444p,colorchannelmixer=aa=0.5[u];[b][u]overlay[v]" -map "[v]" C:\Users\Vivek\Desktop\selfie.gif

The above commands work perfectly but this stretches the image according to the video's width while I want the reverse of it i.e to stretch video to width and height of image.



Answer



Switch the inputs to the scale2ref filter.


[0:v][1:v]scale2ref[ua][b]

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...