Titles and Texts in Kdenlive. Chapter 6: Using the Rotoscopy Effect with Texts

06_Bnr_Rotoscopy.png

In this post we will see some aspects of the use of the Rotoscopy effect with texts in Kdenlive.

Kdenlive. Rotoscopy effect

The applications of this effect are very diverse. We have already seen in this series of tutorials some aspects of its use. In one entry it was used to trace a circular route on a map and in another article to make a very precise mask of concealment and even with different shapes that can change over time.

We have already seen that it is a very powerful effect with which you can do many more things than what we have seen and we will see in this tutorial being fully animatable but requiring a bit of practice and knowing well both the effect and its way of working to take advantage of it .

The “Rotoscopy” effect is found in the “Alpha Channel Manipulation” family of effects.

Its handling is very simple:

  1. We insert it in the video clip, image or title to which we want to apply it.
  2. We made sure to have the edit mode button activated in the project monitor to be able to draw the mask of the rotoscopy effect directly on the monitor.03 button.png
  3. We draw the desired mask with the necessary points. It is important to think carefully about the insertion of these points since once the mask is closed, points cannot be added or removed. To close the mask once the last point has been inserted, press the right mouse button and a straight line will be drawn between this last point and the first.00.png
  4. Just when we close the mask, the first keyframe is created for us. 01.png02.png
  5. If we do not animate this mask we will be able to modify its shape from the inserted points and it will remain static. These values ​​will be added to the single keyframe.
  6. If we want to animate this mask, we will have to insert new keyframes and modify the mask to our liking.
  7. These points have Bézier shooters, widely used in vector graphics, so we can curve the lines between points. Each point has a Bézier handle on each side.03.pngIf we move these Bézier points the straight lines between points are curved.04.pngIn the image above I have only moved the Bézier points from the rectangle that I show with the points outlined in red.
  8. The best of Bezier points, they can be animated by inserting keys and modifying their position.
    05.png
    I insert a keyframe.

    sec_01.gifIn this animation the only points that I have moved from the initial rectangle have been the Bézier points. For this animation I have used 10 frames, but it is slowed down so that it looks good how we can change a shape just by modifying the mentioned points.
    Then the animation in real time in a clip of one second in length; I remember that the animation lasts 10 frames.SEC__00001.gif

Some practical examples of using the Rotoscopy effect with titles in Kdenlive.

Practice 1. Phrase of a line that appears and disappears through the Rotoscopy effect

With a one line text it is very simple.

  1. We insert the effect to the title clip.
  2. We draw a mask of four points making the text a frame

    06.png

  3. Now we put the value of “Operation alpha” in “Subtract”08.pngAnd we get this result, a total transparency in the box that frames the four-point mask07.png
  4. We now proceed to animate her. We create a frame key in the temporary value that we want the text to appear late and, in this key, we move the two points from the left to the right until the entire phrase is visible.
    09.png
    I have given this sentence a second of entry time.

    10.pngDetail of how the mask is in the key in which the phrase has been discovered. The text has a semi-transparent black background so that it is easy to read without the white color of the text blurring with the light colors of the background image. In the following image I have removed this background to show the importance of putting this element to give clarity to the text. In fact, it is a very common mistake not to put it and this sometimes makes reading difficult.11.png

  5. I have done a one second text input. Now I’m going to make a one-second output also on this same clip and in the same direction it entered. Let’s see this process in parts:
    1. We create a key one second minus one frame from the end. This clip is 4 ′ 24 frames long so I insert the key in the second 3 ′ 23 frames.
    2. I advance one frame (3 ′ 24) and insert a new key, and in this, I move the mask the 4 points to the left of the phrase. What I have done is move the mask in a frame.12.png13.png
    3. Now we insert a key at the end of the clip and stretch the two points to the right of the mask until they cover the phrase.14.png15.png

Below is a gif with the result of this practice with a black background and in real time, 5 seconds. With a three-second introduction.16GIF.gifIf the time of the process of making the phrase appear slower, the result is very similar to that obtained with the effects that emulate real-time writing.

Practice 2. Sentence of several lines that appear sequentially in reading order

The objective is to make a brief sentence of three lines (if it is understood with three we can make the ones we want) that will appear sequentially by letters line by line.

These lines will appear in one second each, they will remain for another second and will hide in the same direction that they have appeared for one second each, so the time will be 3 + 1 + 3 = 7 seconds.

We will do this process with two clips, one of 4 seconds that will appear plus the second static one and an exact copy of this 4-second clip that will be cut to 3 seconds + one frame and in a very simple way it will allow us to make the exit … Well let’s see the detailed process since it is a bit laborious. to understand how we will do this in the way that seemed easiest to me and see why this extra frame is mentioned.

We start from the base that we have the initial title clip, of 4 seconds, inserted in the timeline, with the settings we see in the following image:

16.png
I emphasize that apart from centering the text I have increased the spacing between lines to facilitate the construction of the mask

the text I’m going to use is the following:17.png

And now that we have the script and elements to create the animation, let’s get to it.

  1. We insert the “Rotoscopy” effect to the title clip.
  2. Then we draw the mask as follows;
    18.png
    When we close the mask, the first keyframe is created at the beginning of the effect timeline (at the beginning of the clip)

    * As an advice, I would like to say that if a point is not exactly where we want, not to try to correct it until the mask is closed and if the mask becomes complicated and does not come out as we wish, it is best to eliminate the effect and start over.

  3. We put the effect in “Alpha” Mode and the value of the Alpha Operator in “Subtract” and the text will disappear.19.png
  4. Now we move to one second from the start of the clip and insert a key into the rotoscopy effect and move points 1 and 2 to the right.20.png21.png* After inserting the second keyframe, we can only edit the mask when the cursor is over one of the keys or inserting new ones.
  5. We move to second 2 of the clip, insert a new key and this time we move points 4 and 5 as well as 1 and 2, until we completely discover the line.22.png23.png
  6. We move to the second 3 of the clip, we insert a key and this time we move points 7 and 8.24.png25.png

We already have the input animation finished, now we need to make the output animation.

  1. We head to the timeline and copy the title clip that we just animated. Right click on the clip or “Ctrl + C” with it selected.26
  2. We press the right button of the mouse in the empty space after the clip that we have just animated and choose paste or press “Ctrl + V”. Surely it will not be perfectly adjusted but we drag it to adjust it with the previous one if there are no empty spaces between them.2728.png

    29.png
    okay

  3. Now we have a clone of the input clip and in a very simple way we will make the output one, but first we will eliminate the second one that is left from this clip; for them we place ourselves in the third key and once here we advance a frame30.pngWe press “Shift + R” to divide the clip and delete the final part.

    31.png
    First we press “Shift + R” and then Suppress (Delete) to delete the excess clip.

  4. At this point, we still have the same animation as the input clip, so to output the text, all we have to do is set the Alpha Operation to “Minimum” in effect.32.pngAnd that’s it, just with this adjustment the text becomes visible in the first key of this second clip and disappears through the animation of the mask that we have already made in the first clip.

I am attaching a gif below of how the mask looks throughout the animation, the gif is slowed down to make the process look good.Gif_preview.gif

Here is a real-time gif of this practice:sec_r.gif

Observations: It can be said that this animation is fast, the objective was to show how this effect was made, but speed is a matter for each project; generically, the duration of one second (more or less) every two words can be calculated as an average speed reference, so in this case it would take three seconds for each line to be discovered. I put a gif below of what this animation would look like with 3 seconds per line; I’m just going to make the input, since the output can be fast or the same, but we already know how to do it.

slow_.gif

With this speed it seems that we emulate the typewriter effect, although to do this effect 3 frames per word, spaces included, are calculated for fast writing and 5 frames per word for slow writing. With these calculations we see that the first line has 30 characters counting the spaces, so a slow writing would take 6 seconds and a fast one would take 3 seconds + 15 frames.

Practice 3. Text that changes color in sequence, like karaoke

In this practice we will emulate the effect of a text that will be black at the beginning and gradually colored.

For this effect to be functional on a video or image we will need two title clips, one for the background and the other with the text.

In the title clip that carries the text, it must be the color that we want it to transform from black or to change from this color to black, as we want.

Below I put an example image of the composition for this effect in which we have a video or background image, a text clip that serves as the background for the text (in this example, it is semi-transparent orange) and a title clip with the text (in this case light green).33.png53.png

Well let’s get to it, we start from the base that we have the clips in the timeline with the necessary durations.

  1. We insert the rotoscopy effect to the title clip with the text and draw the rectangle that will encompass the text.34.png
  2. Now we have to adjust the parameters of the effect to make the text turn black to turn green. What we do is simply set the Mode to “RGB” (this term means RGB, Red (Red), Green (Green), Blue (Blue)) and we activate the “Invert” box, leaving the effect as seen in the following picture.
    35.png
    The Alpha Operation box only affects the result with Alpha mode.

    36.png
    We already have the mask and effect adjusted to start the animation.

  3. We insert a key in the second 3 which is how long we want this process to last and we move the two points from the left of the mask to the right.37.png38.png

Gif that emulates the result of this animation, I have removed the background video leaving this black so that the gif is lighter.39.gif

Practice 4. Mascará for a circular text

Now we will do a practice that is similar to what was done to draw a circular line on a map.

The text I’m going to use is the following in the layout you see below.39.png

The animation will last 4 seconds, one per side of the square. We start from the base that we already have the title clip inserted in the timeline.

  1. We insert the Rotoscopy effect and draw the mask as indicated in the following image.40.png
  2. We set in effect in alpha mode and the alpha operation in subtract.08
  3. We insert the second key (the first is inserted automatically when closing the mask) one second from the start of the clip and move points 1 and 10 illustrated in the previous image as shown below42.png41.pngI also had to retouch the Bézier handles to make a correct fit.
  4. We insert the third keyframe in the second 2 and adjust the mask as we see below, making the necessary corrections also in the Bézier handles.43.png44.pngThe points accumulate as we shrink the mask.
  5. We continue with the insertion of the next key in the second 3 and we move the mask as follows.45.png46.pngAs can be seen in the image, the points are placed so that the phrase is discovered in the correct way.
  6. And now only the final stretch is missing; we insert the keyframe in second 4 and adjust the mask.47.png48.png
  7. CORRECTIONS: At this point, we check to see if the mask does its job correctly.
  8. DEPARTURE AT THE SAME ADDRESS THAT YOU ENTERED: To make the output we do exactly what we have done in practice 2.
    1. We copy this clip and paste it below, taking care to eliminate the white space between the two clips
    2. We cut out what is left over after the last key. Remember to advance one more frame of this last key.
    3. And we set the Alpha Operation value to Minimum.54.png

And we already have the practice done. I am attaching a gif with the result.53_secP4.gif

In this post we have only worked with texts, but this effect can also be used for text backgrounds (both in clips where text and background go together and in separate clips).

The possibilities of this effect are very extensive in all editing fields.

Download the kdenlive files of the practices carried out.See_Video_G

Deja un comentario