With the help of small python code snippet and different kernel or filters. Tip: #00FF00 is the pure green found in green screens. 12 Must read Text to Image AI Research Papers with their code implementation. The result includes the black background but the train video in replace off the green words, as seen in figure 2: $ ffmpeg -i input.mp4 -i greenscreen.mp4 -filter_complex 'colorkey=color=00FF00:similarity=0.85:blend=0.0 overlay' -map '' output.mp4 If you have an image with green screen content like above but want to turn the image into a video try this code out: $ ffmpeg -loop 1 -i input.png -I -c:v libx264 -pix_fmt yuv420p output.mp4 In this example, the use of greenscreen.mp4 is used as a mask to be applied to input.mp4, as seen in figure 1. Remap filter is intended to copy a source image to a target image according to two maps (ymap/xmap) which are usually supplied in two files. The colorkey filter takes an input, looks for a specific color depending on similarity, and stores the information in a new stream. One or more multimedia streams (audio, video, subtitles) can be provided as input for the filter. Each one of these filters represents a processing phase that can be used individually or daisy-chained with other such filters. They are listed and described in detail at this link. AVPERMREUSE2 The filter may output the same buffer multiple times, and may modify the image data between outputs. AVPERMREUSE The filter may output the same buffer multiple times, but the image data may not be changed for the different outputs. With FFmpeg, this can easily be accomplished using the colorkey filter. FFmpeg has lots of filters - more than you can imagine. This means that no other filters should have the AVPERMWRITE permission. By setting the scene at the purest green (not commonly found in nature) objects can interact on the green screen while computer generation can replace a new image in the background. The use of a green screen is the most common way to add a subject to a scene in video production.