2

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

Lea... FFmpeg
  • 91
  • 1
  • 2
  • 7

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

ps2: to do some testing you can change length of final video by giving a arg -ts

EchoMike444
  • 501
  • 1
  • 4
  • 5
  • I tried with chromakey filter but with small details will be lost. Images are not smooth. – Lea... FFmpeg Jun 27 '20 at 08:26
  • @Lea...FFmpeg did you try wil different value of `similarity` , to cut the time of the conversion you can only generate a small video by specifying a `ts` – EchoMike444 Jun 27 '20 at 16:15