ffmpegandroid-ffmpegffmpeg-python

FFMPEG: How to add transparency to watermark logo? Getting error: "Filter scale2ref has an unconnected output"


Hey guys I am new to Ffmpeg, I want to resize a watermark logo according to the video size and add transparency to it. The code I have is not working as expected.

This is the code

ffmpeg -i $initialFilePath -i $assetLogoFilePath -y -filter_complex '[1][0]scale2ref=w=oh*mdar:h=ih*0.03[logo][video];[1]format=rgba,colorchannelmixer=aa=0.5[logo];[video][logo]overlay=W-w-5:H-h-5' -c:a copy $temporaryDirectoryPath/$finalVideoPath"

I am getting this error Filter scale2ref has an unconnected output.

Please do help. Thanks


Solution

  • The colorchannelmixer has to be used on the result from the scale2ref filter, so it should be

    [logo]format=rgba,colorchannelmixer=aa=0.5[logo];[video]