- 1 Making an animated background with different moving parts with the Kdenlive title wizard
- 2 Export the result in a video clip with transparent background
The goal of this post is to use Kdenlive as if it were a video compositing application. Since in this tutorial we are going to make a background with animated input and output for texts using several tracks, for this and we will export the result in a video clip with alpha channel (that is, with transparent background) to be able to insert it in the project that we wish.
To carry out this practice I have used version 18.12.1; Some details change in the new version 19.04 but I will indicate these changes to be able to carry out my practice with it.
The first thing I want to indicate about the new version 19.04 and later is that although the timeline has a different aspect, the workflow is the same as the previous versions except for some small details that I will indicate.
What I do want to warn is that it is still too early to get to work with her; At the moment (October 2019) it is still in the testing phase and correcting bugs, but the truth is that the team is doing an excellent job and we will soon be able to enjoy this new, improved and stable version.
In the previous chapters of Kdenlive, about texts and animated backgrounds, I did some practices that consisted of animations of a single track or two at the most, then we also saw how to make a sequence of images for an animated background, we even saw how to do more projects advanced with the 2D animation vector application “Synfig Studio”. But this time we will carry out the entire project only in Kdenlive.
Just remember briefly that in a video montage project the titles or texts are already inserted on the track of the already mounted project, that is, what the video is we already have mounted and exported in a single clip, and it is about this video clip on which the insertion of the texts and their ornaments is made.
The idea is to create an animated background for titles that will occupy one track and the texts will be inserted in another, since the background is always the same and the texts vary.
Making an animated background with different moving parts with the Kdenlive title wizard
This time I will only use the insertion of rectangles to create the different parts of the background, but remember that the Kdenlive title assistant can load images, so very versatile backgrounds can be made with this application.
Next I put a static capture of what will be the background that we are going to make and animate.
This text background is made up of 5 parts, so I have created it from 5 title clips and used 5 video tracks. Below I put a capture of each part.
These two previous parts, when put together form the background for the text. Here are the three remaining trim items.
I put a gif with the animation that I have made.
This background project consists of a 15-frame input of the elements, then remains static for 5 seconds, except for the orange trim line that moves continuously and exits with another 15 frames.
For the animation I have used the “Transform” effect and the “Box blur” effect. Below I detail this process in steps.
I create a new project at the resolution that I will need for my video (in this case Full-HD) with 5 video tracks and none of audio, since in this case I will not use it, but as the result of this project will be a clip of video if we wish we can insert an audio to the animation.
I skip the process of creating the 5 title clips with the items presented above. I take it for granted that we know how to work with the kdenlive title creation wizard; if not, it is advisable to take a look at the entries entitled “Titles and texts in Kdenlive” to learn the use and possibilities of this tool.
Below we see a screenshot of the project folder with the five title clips.
I insert the five title clips (which are 5 seconds long by default) in the timeline one above the other in the following order that we see in the image:
Annotation on version 19.04
In the new version we can continue with this same methodology, but it turns out that the developers have now decided that the first keyframe of the effects is fixed and we cannot move or delete it … without a doubt, more than an advance, it is a true step back if this is the brilliant solution they give to the possible problems with the aforementioned frame. So for now it is better to continue working with version 18.12.
Now I place the mouse cursor on frame 16 of the timeline and press the “I” key to define the zone start here.
Now I stretch the zone line to the end of the clips, this can be done by stretching with the mouse from the extreme right of the zone line or by placing the cursor at the end of the clips and pressing the “O” to define the final point.
Once the zone line has been defined as indicated, click on the delete icon below that line to eliminate the excess of the initial 15 frames at a stroke. The delete icon is this and its hotkey is “Z”
We already have the 5 clips with a duration of 15 frames to be able to make the entrance animation.
We create the animation; As I have indicated, to make this entry I have only used the “Transformation” effect for the movement of the pieces and the “Box blur” effect to give it a decorative nuance during the animation.
Here is a screenshot of the effects used for the first clip. If we do not know how the insertion and animation of the effects works, before continuing we must read the entry in which I talk about them and indicate how to insert and animate them.
We animate each track, that is, each element, in the way that we like the most.
Below I attach a gif with this input slowed down so that you can see the animation of each element in these 15 frames, each frame lasts 500ms when it should be 40ms.
Annotation on version 19.04
Note that in the new version the box blur uses the keyframe line just like the transformation one, which is much more intuitive and easier to handle. In this case, we can consider it an advance.
Once the input animation of each element is done individually, we now insert the static part that will last 5 seconds after each clip.
In the two upper clips (the ones that when put together form what will be the base of the text) I do not insert any effect. The remaining three have a subtle static box blur (this is optional), but if we look at the track “Video 2” (where we have the track called ornament 2, it is the orange line) I have decided that it should move throughout the entire length of the duration of this background (as we will have seen in the first gif that I have inserted with the result of the practice). We also see that this track is 15 frames longer than the others. This is because since I have inserted the “Transform” effect to make the animation of this passage fragment I already use this same effect to make the output. The clip is lengthened by stretching with the mouse at the far right of the track.
To lengthen or shorten the duration of a track we can do it by stretching or shrinking from the end of it.
In the case of a video clip, it can only be stretched to its maximum duration, when it is an image, color or title clip, there is no maximum duration limit; the minimum in all cases is one frame.
Now we are going to make the exit animation; We do this in the following way: we make a multiple selection of the four clips to be copied at the end, which are those of the 15 seconds from the beginning. To make a multiple selection we must select the first clip and then hold down the “Control” key to select the rest.
Annotation on version 19.04
In the new version, to make multiple selections, the method is exactly the same only that instead of using the control key we must use the shift key, which is usually more frequent in other applications when we make selections. multiple.
Now we right-click on one of the selected clips and choose the “Copy” option.
Now in the final part, after the existing clips, in a blank space, in the first track where the pasting must be carried out, we press the right button and choose the option “Paste”
We see that the clips are pasted from where we have clicked with the right button, being separated from the previous ones.
To put them together quickly we take the block move tool (we can click on its icon or its quick key which is the “M”)
We go to the end of one of the clips and drag them until they collide with the previous ones.
Running out of any space between the clips.
This operation can also be done by right-clicking on the empty space between the tracks and choosing the option “Remove space on all tracks”.
These clips that we just copied are animated to be the input, so if I reverse the animation I will already have the output.
How do you reverse the animation?
Annotation on version 19.04
Remember that in this version the first frame of the effects is fixed and cannot be moved, but we can change its values, so we can put the values of the last one here, in the first one and vice versa. These values can be consulted in the corresponding clip at the beginning (or perform the output animation manually and custom and not a mirror of the input).
Well, in a very simple way, in the transformation effect we do it in three simple steps that I illustrate with images:
- We take the keyframe from the beginning and put it near the end
- Now we take the one at the end and put it at the beginning
- And finally the one that was at the beginning (which is now almost at the end) we put it at the end of the whole
In this simple way we have already inverted the animation that has become the output. Here’s how to reverse the blur effect.
This is done in one step, we simply invert the values.
We see that the first value in this case is 20 and the second 15, because with double click on the number we change these values by inverting them. To go from the first value to the next we can use the tabular key.
And that’s it, now we must repeat this process on each track (in this case the remaining three) since the one with the orange line has already animated the exit.
Then I put an animated gif image in slow motion so that the output can be seen as it has been. In this case it is nothing more than an investment of the input,
Consideration on the technique used to fragment the clips into three parts, input, static and output
The explained technique of fragmenting the clips is widely used in composition applications to make this type of animations, but we can perfectly do this without fragmenting the clips and managing them in a single piece, making the input of the piece with the transformation effect and the exit.
Here is an example of how a track would look if we have not fragmented it. The blue lines with a dot in the center are the graphical representation of the keyframes in the track of the selected effect (in this case the “Transform”).
And now we see the effect where I have highlighted the input animation in red and the output animation in green.
Let’s use the technique that we use the result will be exactly the same. The reason for explaining the way by fragmenting the tracks is so that this technique is known, which as I have indicated is sometimes used. And if we work with the new version 19.04, since it is not possible to invert the keyframes in a simple way, perhaps working with the clips of a piece is more advisable. Anyway, the objective of these tutorials is to learn the more things the better, so now we already know two ways to deal with this type of animations and in each case one chooses the one that seems most practical.
Export the result in a video clip with transparent background
In a video, when we use transparency and there is nothing in the background, it looks black and this is how it is exported by default. Kdenlive natively does not have any preset to export with transparency, but this is not a problem since we can easily create a preset to export the result of our practice in a video with alpha channel, that is, transparency.
But first we must prepare our project so that it is exported with a transparent background and not with a black background.
One of the essential steps that we must carry out is to insert the “Compose” transition (Composite in English) between the tracks. The simple thing is to insert it in the track above and this will be combined with the one below. If we wish we can use the Compose and Transform one, for this practice the effect will be the same.
and then stretch this transition so that it fills the entire clip and overlaps it by one frame at the end.
If we do not know how to work with transitions, we must consult the entry that talks about them.
Annotation on version 19.04
In version 19.04 it is advisable to use the transition “Compose and transform” sometimes it is not translated and we find it as “Composite and transform”, I quote this because using the “Compose” I have had some problems … which I have reported as a bug and I suppose that will be solved, anyway with the one of “Composite and transform” the result is the one that corresponds.
We stretch from the beginning so that it reaches the beginning of the clip.
Then we stretch the end until it exceeds the clip by one frame.
To carry out this step (to stretch the transition so that it exceeds the clips by one frame) it is advisable to maximize the view of the clips in the timeline and in this way we can very easily make this adjustment.
In the following image we see the result after having adjusted the transition ,. We observe that with this zoom level the overflow of the end is not appreciated
but if we enlarge the view in the timeline then it is perfectly appreciated that the transition exceeds the clip, in this particular case in a frame.
This is how all the tracks must be so that the transparency when exported in a video clip correctly covers the entire clip.
If we do not carry out this overflow of a frame when exporting, we will obtain at the end of the video clip an annoying black frame without transparency.
Now we copy this transition and by pasting we insert it between the following tracks, we can do this as follows.
- Right click on the transition and choose to copy.
- We place the playhead at the beginning, select the track “Video 4” (the second starting from the top) and use the key combination to paste (which is “Control + V”)
- We repeat these steps on the remaining tracks.
And we get this result.
Expanded detail of the end where we see that the transition exceeds the clips by one frame (in this case the title).
Now comes a fit very important What is it set the project quality to “None”; This is essential to export with transparency.
If we do not put this option in “None” we will not obtain the transparent background.
Annotation on version 19.04
What we have seen in this section is done exactly the same in the new version. What I have observed is that it is not necessary to exceed the transitions in one frame. In this version, the aforementioned error does not occur.
Creating the custom profile to export the animated background that we just made with alpha channel (transparency)
Kdenlive by default until version 18.12.1 does not have any profile or predefined setting to export with transparency, so we must create it ourselves.
Annotation on version 19.04
The new version has a setting called “Transparent” which works perfectly if we have inserted the “Compose” transition between all the tracks and we have set the composition to “None”. In this way we will obtain the transparent background. Also We have the option, mentioned above, which is to use the “Composite and Transform” transition between the tracks.
In the new version, the wizard to choose the composition of the tracks is now by default hidden in a drop-down menu that is where the aforementioned wizard was before.
With the profile that I recommend below, and that is necessary for previous versions of kdenlive, we get slightly smaller clips with the same quality. So if we wish we can also create it in this new version and thus we have two alternatives to go testing with which one we like the result the most.
We open the export assistant and click the icon to create a new profile or predefined setting (preset).
A wizard will open to us for this and we will fill in its fields as follows:
- Group: Custom
- Profile Name: MKV + Alpha Video
(These group and name sections can be changed to others of our preference, from now on we must respect the indicated values)
- Extension: mkv
- Parameters: Copy and paste the following line in this field
f=matroska pix_fmt=bgra acodec=aac vcodec=ffv1 qscale=%quality ab=%audiobitrate+'k
- Video Quality: 5.15
- Audio Sampling Rate: 192.64
- Speed options:
cpu-used = 2
cpu-used = 3
cpu-used = 4
cpu-used = 5
In the next screenshot we see how this wizard should be filled in.
Now we press the “OK” button and we have created our custom profile to export the animated tablet project with several tracks that we have just created with transparency.
Remember have the quality selector set to “None” in the timeline to be able to export with transparency.
And now we only need to indicate the location where we want to create our clip, choose the profile that we have just created and press “Process”. I have disabled audio export because in this project I don’t use it.
And in this way we export our animated clip with the transparent background for the texts.
Using the background clip for texts
We already have our clip, which in this case will be used for all backgrounds of the video texts, the ones that do change are the texts, for this we need a project with a minimum of three video tracks:
- one for the base, in principle our montage about to insert the texts,
- another for the background we just created
- and another for the texts
in the order we see in the following image.
And as simple as inserting the background clip for texts that we have just made where we need it and creating (with the wizard to create title clips) the corresponding text.
Here is an example of the timeline, in this case I have made two versions of the same background, one as I have explained in the tutorial and another without using the box blur effects. This is usually done when we make a video on request so that the client can choose which version he likes the most, or even to teach a third person, but hey, the animation is exactly the same and is as simple as doing a “Save as ”And in this new version disable or remove the used box blur effects.
The result using blur
And the result without blur
As we can appreciate the change is very subtle.
As we have seen, Kdenlive is very versatile to make our own backgrounds, decorative elements or graphics with multiple tracks by being able to export the result in a single video clip with alpha channel, (Alpha chanel = transparency).
Indicate that an animation lasting 15 frames on a 25 frames per second basis is considered a slow animation. For more dynamic videos it is normal to use between 3 and 10 frames, but it all depends on the content: it is not the same rhythm of animation on a ChillOut theme, where 15 or even more frames is ideal than on a metal theme where we will surely make animations well below 10 frames.
Note about the new version 19.04
With the new version, it is also essential to work with the most recent distribution that we can, this is due to libraries or this is what a developer told me when I reported some problems that arose. We can also use the Flatpak or Appimage version that solve dependency problems. But it really is still a version in the testing phase of which bugs are being reported daily, so today (October 2019) it is best to work with version 18.12 or earlier until this new version is fully operational and we can work with her smoothly.
In this tutorial I have made two videos: one that is the usual summary of the article and the second that indicates how to carry out this project with the new version of Kdenlive.
Article summary with Kdenlive version 18.12.
Video tutorial on how to carry out this same project with the new version of Kdenlive, in this particular case the 19.08