Having an issue with the chromakey portion not working after the scale. Any ideas?

ffmpeg -i background1080.png -i file.mp4 -filter_complex "[1]scale=1612:906[inner];[0][inner]overlay=154:170; [1:v]colorkey=0x000000:0.02:0.03[ckout];[0:v][ckout]overlay[out]" -map "[out]" -map 1:a -c:a copy -y -b:v 2000k -b:a 192k -vcodec libx264 -x264-params keyint=20:scenecut=0 -acodec copy file_FINAL.mp4

  • So this crops but the chroma-key doesn't work. If I remove the crop, the chroma key works - I think I'm just not understanding the syntax relationship fully for the [out] commands, etc.
    – Dot Matrix
    Commented May 19, 2020 at 19:33

1 Answer 1


The issue is, that you reference the input file two times.


what you actually want is to use the scaled version. so:

[1]scale=1612:906[inner];[0][inner]overlay=154:170[ovout]; [ovout]colorkey=0x000000:0.02:0.03[ckout];[0:v][ckout]overlay[out]

But I don't really understand why you overlay the image twice... wouldn't this work?

  1. colorkey, 2. scale, 3. overlay

You should almost always colorkey first and then scale to reduce colorkey artifacts


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.