How to add an overlay with opacity to a video in ffmpeg?

Viewed 360

I am new to ffmpeg and am trying to add an overlay on my video. The overlay is scaled to video's size but the problem is that i need to add opacity. Here is the command:

ffmpeg -y -i video.mp4 -i overlay.png -filter_complex "[1][0]scale2ref[i][m];[m][i]overlay[v]" -map "[v]" -map 0:a? -ac 2 output.mp4
1 Answers

Use the colorchannelmixer filter to set transparency.

ffmpeg -y -i video.mp4 -i overlay.png -filter_complex "[1][0]scale2ref[i][m];[i]colorchannelmixer=aa=0.65[i];[m][i]overlay[v]" -map "[v]" -map 0:a? -ac 2 output.mp4

The filter sets the image opacity to 65%

Related