Kdenlive is able to detect the movement of an object in a two-dimensional video: and we can take advantage of this function to avoid manually building all the key frames of a “composite” transition. Great for making gunshots or stains appear on a wall.
An action film needs, first of all, “action”, movement. Shooting should never be perfectly still, it is not advisable to use a tripod: to give a sense of action, it is better that there is a minimum flicker in the shots. This, of course, makes things more complicated with regards to applying effects in computer graphics, because even the objects that we overlay on the original video will have to follow the movement of the camera. Fortunately, Kdenlive has the tracking function, thanks to which it is possible to automatically analyze the movements of a tracking point, i.e. a small portion of the image. To demonstrate how it works, we decided to try making bullet holes appear in a wall. It all starts with a video clip that we will have to shoot, in which we see the wall with pieces of colored adhesive tape in correspondence with what will have to be the bullet holes. The effect must be added to this clip Automatic masking , which is usually used to encrypt people’s faces. This effect is able to analyze the movie and follow the movement of a point in the image. After analyzing the clip, the effect can also be hidden or removed. The next step is to overlap, with the usual transition Composite , an image of a bullet hole (which we can easily find on the internet) on the clip itself. Of course, the position and size of the hole will have to be set via a key frame. And instead of doing it manually, we can import keyframes from the original clip. In fact, when we had it analyzed by the effect Automatic masking , this recorded in the clip itself a series of key frames suitable for use with transitions Composite . If everything went well, scrolling through the project timeline we can see how the position and size of the bullet hole have automatically adapted to the movements of the camera. The image and video clips must have the same length, otherwise the key frames would be out of phase. Of course, the operation must be repeated for all the holes we want to make appear. In the same way, they can be superimposed on the tracking points of the portions of the wall, so as to reconstruct the wall itself as if the adhesive tape had never been applied. Superimposing the video of the wall with the bullet holes on that of the completely “clean” wall, and using the effect rotoscope to hide and make the holes appear at the right time, a very realistic result is obtained. To give a sense of what is happening, the audio effects are very important (in fact you have to insert the sound of a shot every time a new hole appears in the wall) and the editing with the other scenes of the final movie, which must be very fast just to fully make the idea of ”action”. You can find the example video at the following address: https://www.youtube.com/watch? v = oqQCivAESmU
Create good tracking points
To obtain a good result it is first of all necessary to have prepared some tracking points that are very easy to distinguish, with a clear separation from the background. In fact, if this were not the case, Kdenlive could struggle to correctly recognize the shape of the point and could lose the trace of its movement. The most classic shape for these points is rectangular. The best and fastest way to make them is to use adhesive tape: just attach pieces of colored adhesive tape to the wall (or in any case to the surface on which the holes will appear). The tape must have a light color (for example white), and then we can paint the inside of it with black with an indelible marker, but leaving a clear outline. This contrast will make the points more easily identifiable.
The “textures” of the holes in the wall
We download an image of bullets in a wall and adapt it


Tracking a point in four steps
Following the movement of a point is very simple




Again, master…
The procedure is the same for all tracking points




The hits that appear “by magic”
Let’s create a “clean” version of the wall and overlap the one with the bullet holes



