6
$\begingroup$

I am trying to make a youtube video and in the part of the video I'm going to have a image of a face on top of my face to preserve my privacy. I tried going frame by frame with a picture that has a transparent background but somehow it didn't work.

$\endgroup$
16
$\begingroup$

You can track a point in your footage and overlay an image in the compositor.

enter image description here

Common practice is to blur a face, when wanting to preserve the privacy of someone in a video. I will explain this first, as it is quicker to achieve.

enter image description here

Bluring a moving persons face in a video

  1. Load the video into Blenders Movie Clip Editor. Set the scene start frame, end frame and resolution.
    movie clip editor
  2. Go to the first frame of the scene. In the Tools Tab of the Movie Clip Editor in the Track section, set the Tracking Settings to Previous Frame. Click the Add button in the Marker section, then click on the video to add a marker. The marker should be positioned on the face you want to track. Markers can be translated, rotated and scaled. G, R, S
    enter image description here

  3. With the marker selected, press Ctrl + T to track it.

  4. Switch to masking mode and add a new mask.
    movie clip editor

  5. Ctrl + click to add new masking points. Add new masking points and track the face shape, which you want to mask. To close the mask, press Alt + C. Mask points can be selected, translated, rotated and scaled as usual.
    create a mask
  6. Parent the mask points to the track by selecting the track and all the mask points and press the Parent button in the Tools menu.
    [Anonymously suggested: Alternately, in case you are facing issues with track selection, click each of the mask points one after another while pressing Ctrl + P after each click. This will directly parent the mask points.]
    enter image description here
  7. The masked points will now follow the tracking marker. The mask can be keyframe at any frame by pressing I. This may be necessary if the shape of the face changes. Mask keyframes can be viewed and edited in the Dopesheet in Mask mode. In the example, a key is used on the start and on the end frame.
    enter image description here
  8. In the node editor, go into Compositing mode and check Use Nodes. Add a Movie Clip node and load your clip.
    enter image description here
  9. If the scene size and the source movie clip size are different, connect the Image output of the Movie Clip node to a Scale node set to Render Size. Connect the Scale nodes output to a Blur node. Set the amount of blurring you want in the X, Y fields. Add a MixRGB node and connect it to the Scale and the Blur node. Add a Mask node and select the mask. Connect it to the Fac input of the MixRGB node.
    enter image description here
  10. Rendering the composite will blur the area, where the mask is.
    enter image description here

Overlaying an image onto a moving persons face in a video

Do steps 1 - 3 as explained above.

  1. In the properties panel of the Movie Clip Editor, check 2D Stabilization. Select the tracked marker and add it to the Tracks for Location.
    tracking, stabilization 2D
  2. In compositor add an Image node and load the image, which you want to lay over the face. Add a Transform node to be able to position it later. Add a Stabilize 2D node and select the video which we used in the Movie Clip Editor. Check Invert. Since the Stabilization works in the space of the movie clip, we need to bring the smiley image into the Movie Clip space. To do this, add a Set Alpha node and connect it to the Movie Clip. Set the Alpha value to 0. Add an Alpha Over node and connect it to the Set Alpha and the Transform node. Append the Stabilize 2D node after the Alpha Over. After the stabilization the smiley image follow the track in the correct space. Add an Alpha Over node and connect it to the Movie Clip node and the Stabilize 2D node.
    completed node setup
  3. Rendering this will overlay the smiley image ontop of the movie clip. The smiley image is matched moved with the stabilization node.
    enter image description here
$\endgroup$
  • $\begingroup$ How do you get from 6/7 to step 8? $\endgroup$ – saiful Jun 21 '17 at 5:56

protected by David Sep 13 '17 at 16:49

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.