FFMPEG Multiple Alpha Overlays

3102 views video
6

I have a few videos with alpha channels that I will like to overlay on top of each other. It's possible to get working with the following command

ffmpeg -i back.mov -i front.mov -filter_complex overlay -c:v png output.mov

However if I add another video to this it no longer works

ffmpeg -i back.mov -i front.mov -i front2.mov -filter_complex overlay -c:v png output.mov

Does anyone know a way of getting this to work? or would I have to output the first 2 layers and then run the code again with a new layer?

I will have more than 3 layers so looking for the most efficient way.

answered question

1 Answer

0

You need to perform successive overlays with the correct inputs at each turn,

ffmpeg -i back.mov -i front.mov -i front2.mov -filter_complex [0][1]overlay[o];[o][2]overlay -c:v png out.mov

posted this

Have an answer?

JD

Please login first before posting an answer.