0

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 May 19 at 19:33
0

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

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

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=0x000000:0.02:0.03[ckout];[ckout]scale=1612:906[scaleout];[0][scaleout]overlay=154:170[out];
  1. colorkey, 2. scale, 3. overlay

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

Greetings

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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