3

I am trying to try to de-green the video with FFmpeg. I find using blends with multiply available with the command line:

ffmpeg -i input.mp4 -i green.mp4 -filter_complex "[0:v] format=rgba [bg]; [1:v] format=rgba [fg]; [bg][fg] blend=all_mode='multiply':all_opacity=1, format=rgba"

enter image description here

I have a problem with the color of the main video turning green. What do I need to do to solve this problem?

Green screen: enter image description here

My video: enter image description here

Giacomo1968
  • 58,727

1 Answers1

0

I suppose you want to overlay the green video over the background.

ffmpeg -i input.mp4 -i green.mp4 -filter_complex     \
    '[1:v]colorkey=0x00ff00:0.4:0.2[ckout];[0:v][ckout]overlay[out]' \
    -map '[out]'  -c:v libx264 -pix_fmt yuv420p res.mp4

00ff00 is green , ff0000 is red

You must be sure to choose the right color , for the value of the chromakey.

0.4 is a similarity factor 0.2 is a opacity factor

PS: More information => https://ffmpeg.org/ffmpeg-filters.html#colorkey

PPS: To do some testing you can change length of final video by giving a arg -ts.

Giacomo1968
  • 58,727
EchoMike444
  • 511
  • 1
  • 4
  • 5