Video Face Overlay with a Picture


I would like to know if I can make a video with Kdenlive, where the face of a person is overlaid by a picture of another person.

For example like in this Video:

I think of something like an anchor, which is stuck to a point of a video and the picture is connected with this anchor. So, if the video plays and the point is moving, the picture moves with it.

Therefore I need help from you all.



I think that blender is a more suitable tool for something like this. As for the motion tracking, I don't know of any software in Linux that can do a decent tracking job... yet. Might have to track it by hand.

There is already an effect called Auto Mask which features some sort of motion tracking. frei0r also has an effect called facedetect (disabled in kdenlive: instability?), which uses opencv (
OpenCV seems to be quite good, so if somebody is going to pick up on this topic he definitely should have a good basis.

I understand that MLT actually has 2D tracking, and Kdenlive makes use of it for the Obscure effect (if that's it's name, not sure about it...). But for me the Obscure has never worked properly, so it's either a problem with the MLT implementation or with the Kdenlive effect.

The Auto Mask effect has an Obscure checkbox within it, and it does work for me with simple tasks, but you need to make sure you split the clip where the area to be obscured ends or changes drastically. And, of course, you must set the rectangle to the area of interest because it is not a face detector. It needs work within both MLT and Kdenlive to be more general purpose and work with any filter.

Most motion tracking stuff on linux is coming from cinelerra guys, right ?
Does anyone have experience with this motion tracker and is able to
compare/rate it against other (non-Linux) tools ?


What I can tell you about the MLT motion tracker is that, first, it is not written by me. The guy extracted the motion estimation algorithm from ffmpeg's mpeg4 encoder. So, it has the limitations that has. It was a funded development for a specific purpose -obscuring in realtime on SD playout. Therefore, it has much SIMD acceleration and not so easy for others to maintain and enhance.

I can tell you from experience that Blender works very simply and very well for this kind of thing.

There is a script that you can use to export gimp layers as animatable planes from gimp to blender.. here..

Go half way down the page and someone has posted the script.

Camera tracking can be done with the vodoo camera tracker. Found here..

For usage.. hmm I could make a tut if you need it...

@streamux actually motion tracking software on linux is pretty common. Vodoo is free, the comercial version voocat also works on linux and is $99. Hfpoe is comercial and is a very nice app to use runs on linux and is $200. PFtrack is the king of motion tracking (IMHO) and runs on linux and goes for about $1500.