Overlays and maths
It’s possible to emulate traditional titling using compositing in Kdenlive. There’s no particular advantage to doing it this way, but it does allow for flexibility in the event that you need to overlay complex graphics or charts atop your video footage.
Perhaps more importantly, this is a great exercise to help you understand how images are composited against others.
By now, if you have been following this mini-series on compositing, you are familiar with the Kdenlive “rules:” use transitions to composite and know what video layer you are compositing against. In the interest of creating a realistic titling scenario, the screenshots herein have one video layer with three color correction (curves) effects, a color layer masked and multiplied to bring out the blue in the sky, and finally the title layer. So in all the examples, the layer being composited against is manually set to video layer 3. If you don’t understand why this is, go back and read the previous articles in this series, which explain how compositing works in Kdenlive as opposed to other popular NLE’s.
#1. For the title image, use GIMP or Krita to create two different cards the same dimensions as your video canvas. First, create one with black text against a white background:
#2. Then create a second with white text against a black background:
#3. Now import these images as clips into a Kdenlive project and place them, one by one, across a layer above a video strip in the timeline.
Depending on how you have Kdenlive configured, there may already be a transition between your title and the video clip under it. If not, add one to each title.
#4. Click on one of the transitions for a black-text title and, in the Transition tab, set the transition type to Multiply. What happens? well, since black has a chroma value of 0, all black pixels in your overlay are multiplied by the the pixel in the layer beneath it. As you know from basic maths, any value multiplied by 0 is 0, so what we see in the end is a black pixel (the text).
#5. But we also have a white background, so what will happen to that? White as a digital color, as you may know, is the combination of all other values, being itself the maximum chroma value of its medium. This gets expressed in different ways depending on your industry and value of measure, so you might know it as #FFFFF, 255, or just 1. Using math again, we know that any value multiplied by 1 is the original value, so to our eyes the white simply disappears (more precisely, it has no affect on the chroma value beneath it).
#6. Conversely, if you use a Divide transition on the next black-text title, the values of the lower layer are divided by black. Not-so-basic maths will tell you that a value divided by 0 is, well, undefined, but in the compositing world we say it returns the maximum possible value (that is, white). So, the black text becomes white.
The white background also gets divided by the lower layer’s chroma values, resulting in the same chrome value. Any value divided by 1 results in no change, and that’s what it looks like after compositing; the white essentially becomes invisible.
#7. Set the transition on one of your white-on-black titles to Addition. The principle here is the same, but because the image is inverted we have to use different operators to get the same results. By all means, see what happens if you use Multiply and Divide, but for now consider the Addition transition.
The value of the white text is the maximum allowable chroma value; in other words, those pixels are already as full as they can get. So if we take the value of the layer beneath the text and add them to an already maximum value, we are left with the maximum value.
If we add the value of the black space around the text, we are simply adding 0; so there is no change and the black becomes invisible in the composite.
#8. Finally, set the other white-on-black title to a Subtract transition and see what happens. The value of the white text (full value) gets subtracted from the values beneath it. Any value minus everything is going to equal 0 (not allowing for negative integers), so instead of seeing white text, we get black.
Conversely, the black background has 0 value, and when nothing is subtracted from any value, there is no change, and so the black has no affect on the final composite.
Kdenlive title tool
Realistically, there is not really a need to use graphic overlays for your titles, because Kdenlive has a very robust title tool.
#1. To add a title, click the Add Clip button in the top right corner of your Project Tree, or just right-click any empty space within your Project Tree panel. Select Add Title.
#2. The title tool is intuitive but for its initial presentation. By default, you see text against the ubiquitous “alpha checkerboard”. If you need to see the picture meant for your text, position the playhead in the timeline over the target clip and then click the Show Background button at the bottom of the Title window.
#3. When finished, click the OK button in the bottom right corner of the Title window. This places your title in your Project Tree, but not your timeline.
#4. Drag the title clip from the Project Tree into the timeline. That’s all there is to it.
A common need for documentarians is title templating. There’s nothing quite as tedious as designing a lower third (a subtitle which appears in the lower third of the screen, common for on-screen credit in documentaries and news broadcasts) and having to recreate the same title card for each and every interviewee.
Kdenlive’s title template feature is, frankly, a little confusing, but otherwise it works just as you would expect and reduces your workload drastically.
#1. First, create your title with the title tool. This will serve as your template. Once you have something you like, click the Save button in the top left corner of the title window.
#2. Save the title clip with the suffix .kdenlivetitle. You aren’t required to use that suffix, but it is what Kdenlive uses and it will make it easier to find later.
#3. When you need to use your template, click the Add Clips button in the top right of the Project Tree panel but do not choose Add Template Title. Adding a template title fails to see user-created templates, only system templates (to which users usually cannot save). So instead, use Add Title Clip.
#4. Click the Open Document button in the top left corner of the Title Window.
#5. In the Load Title window, navigate to the directory holding your titles. Quite possibly it is the default directory (/kdenlive/titles), but the titles may not show up. If that’s the case, don’t panic.
#6. If that’s the case, enter *title in the Filter text field at the very bottom of the window. This tells Kdenlive to show you anything ending with “title.”
Select the title template you want to use and click the Open button in the bottom right corner of the window.
#7. Now all you need do is type your replacement text into the text fields of your template.
#8. To keep title clips organized, you can use the description field of your Project Tree.
Fading a title
And last, but certainly not least, is the title fade. This is endlessly frustrating to new Kdenlive users because all other NLE’s apply the fade to the title clip itself. However, in Kdenlive, titles are composited over video clips using inter-clip transitions, so the fade out is applied to the transition, not the title.
The magic happens mostly with keyframes:
#1. Create a title and composite it over a clip.
#2. The title comes with an Affine transition by default. Click on the Affine region in the timeline. This brings up the Transition tab. If the Transition tab does not appear, bring it up manually from the View > Transition menu.
#3. In the timeline, place your playhead where you want the fade to start. Usually a three to four second fade is sufficient.
#4. Click the green plus button in the Transition tab. This creates a keyframe. You’re practically an animator!
#5. In the timeline, move the playhead to the end of the clip. The easiest way to do this is to click on the title region and press the End key on your keyboard.
#6. Click the Affine region again. This brings the Transition pane back up.
#7. Click the green plus button in the Transition pane. This creates a second keyframe.
#8. To create the fade, click and drag on the slider labelled Opacity and bring it all the way to the left so that it is 0.
The result is a steady fade from full opacity to nothing. Predictably, for a fade-in you only have to reverse the direction of the opacity shift.
Titles in Kdenlive are robust, and flexible enough that you can customize the look of your titles and even the mechanisms you use to produce them. Have fun!