I am making an app where I need to overlay two video files one above the other using ffmpeg. I tried various commands but all it does is merging a video.
Basic method is
ffmpeg -i in1 -i in2 -filter_complex
"[1]format=yuva444p,colorchannelmixer=aa=0.5[in2];[0][in2]overlay"
out
where 0.5 sets 50% transparency for the 2nd input. The format filter is needed to make sure that the 2nd video has an alpha channel.
To resize in2 to match in1, use
ffmpeg -i in1 -i in2 -filter_complex
"[1]format=yuva444p,colorchannelmixer=aa=0.5[in2];
[in2][0]scale2ref[in2][in1];[in1][in2]overlay"
out
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With