Mask a Specific Area of a Video in Kdenlive

Masking allows you to isolate, hide, or highlight a specific area of a video frame for creative edits like blurring faces, adding effects to specific regions, or creating custom transitions. In this article, you will learn the step-by-step process of masking a specific area of a video in Kdenlive using the Rotoscoping effect for custom shapes and the Shape Alpha effect for simple geometric shapes.

Method 1: Using the Rotoscoping Effect for Custom Shapes

Rotoscoping is the most flexible masking tool in Kdenlive, allowing you to draw custom shapes and track moving objects.

  1. Add the Effect: Drag your video clip onto the timeline. Open the Effects panel, search for Rotoscoping, and drag the effect onto your timeline clip.
  2. Draw the Mask: Click on the project monitor to place control points around the area you want to mask. Continue clicking to outline the area, and right-click to close the loop and complete the shape.
  3. Refine the Shape: Click and drag individual control points to adjust the mask. Use the effect settings panel to adjust the Feather width to soften the edges of your mask.
  4. Animate the Mask (Optional): If the subject in your video is moving, move the playhead forward in the timeline, adjust the control points to match the subject’s new position, and Kdenlive will automatically create keyframes to animate the mask.

Method 2: Using the Shape Alpha Effect for Geometric Shapes

For simple shapes like rectangles, ellipses, or triangles, the Shape Alpha effect is the quickest option.

  1. Add the Effect: Search for Shape Alpha in the Effects panel and apply it to your timeline clip.
  2. Choose the Shape: In the effect properties panel, select your desired shape from the Shape dropdown menu (e.g., Rectangle or Ellipse).
  3. Position and Size: Adjust the Position X and Position Y sliders to center the mask over the area you want to target. Use the Size X and Size Y sliders to scale the mask.
  4. Feather the Edges: Adjust the Transition width slider to create a soft edge, allowing the masked area to blend smoothly with the rest of the frame.

How to Apply Effects Only to the Masked Area

To apply an effect—such as a blur or color correction—exclusively to your masked area, follow these steps:

  1. Duplicate the Clip: Place your video clip on Track V2, and place an identical copy of the clip directly beneath it on Track V1.
  2. Apply the Mask: Apply either the Rotoscoping or Shape Alpha effect to the clip on Track V2.
  3. Add the Target Effect: Apply the effect you want to isolate (like Gaussian Blur) to the clip on Track V2. The effect will now only appear inside the boundaries of your mask, while the background clip on Track V1 remains untouched.